music filter uses ⏸
This commit is contained in:
parent
162509777c
commit
674f8e1a7a
1 changed files with 2 additions and 5 deletions
|
@ -1,9 +1,6 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
filter() {
|
filter() { mpc | sed "/^volume:/d;s/\\&/&/g;s/\\[paused\\].*/⏸/g;/\\[playing\\].*/d" | tr '\n' ' ' | sed 's/ $//' ;}
|
||||||
[ "$(pidof dwmblocks)" ] && sed "/^volume:/d" | tac | sed -e "s/\\&/&/g;s/\\[paused\\].*/\\[paused\\] /g;s/\\[playing\\].*//" | tr -d '\n' | sed -e "s/\..*$//g" \
|
|
||||||
|| sed "/^volume:/d" | tac | sed -e "s/\\&/&/g;s/\\[paused\\].*/<span color=\"gray\" font_style=\"italic\">/g;s/\\[playing\\].*/<span>/g" | tr -d '\n' | sed -e "s/$/<\\/span>\n/g"
|
|
||||||
}
|
|
||||||
|
|
||||||
case $BLOCK_BUTTON in
|
case $BLOCK_BUTTON in
|
||||||
1) mpc status | filter && setsid "$TERMINAL" -e ncmpcpp & ;; # right click, pause/unpause
|
1) mpc status | filter && setsid "$TERMINAL" -e ncmpcpp & ;; # right click, pause/unpause
|
||||||
|
@ -16,4 +13,4 @@ case $BLOCK_BUTTON in
|
||||||
4) mpc prev | filter ;; # scroll up, previous
|
4) mpc prev | filter ;; # scroll up, previous
|
||||||
5) mpc next | filter ;; # scroll down, next
|
5) mpc next | filter ;; # scroll down, next
|
||||||
*) mpc status | filter ;;
|
*) mpc status | filter ;;
|
||||||
esac; exit
|
esac
|
||||||
|
|
Loading…
Reference in a new issue