commit 01347a0e43bc95377f79b938cf532db97389c195
parent acd5c4f67b580fe24311e7c4700d0e9c70b55cbc
Author: Shimmy Xu <shimmy.xu@shimmy1996.com>
Date: Sun, 22 Sep 2019 12:37:25 -0400
Update music block
Diffstat:
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/.local/bin/i3blocks/music b/.local/bin/i3blocks/music
@@ -7,7 +7,7 @@ filter() {
case $BLOCK_BUTTON in
1) mpc status | filter && setsid "$TERMINAL" -e ncmpcpp & ;; # left click, bring up player
- 2) mpc toggle | filter ;; # left click, nothing && pgrep -x dunst >/dev/null
+ 2) mpc toggle | filter ;; # middle click, toggle play/bause
3) mpc status | filter && notify-send "🎵 Music module:
- Shows mpd song playing.
- Italic when paused.
@@ -18,3 +18,11 @@ case $BLOCK_BUTTON in
5) mpc next | filter ;; # scroll down, next
*) mpc status | filter ;;
esac
+
+status=$(mpc status | filter)
+
+if [[ "${status}" != "" ]]; then
+ echo
+else
+ echo "NONE"
+fi