diff options
author | 2025-02-13 14:13:49 +0530 | |
---|---|---|
committer | 2025-02-13 14:13:49 +0530 | |
commit | 8a2e1006b3b272126332aa064f3ad95387129544 (patch) | |
tree | 944c80ac612a65980d94a54ba11b6c7102037ecf /.local/bin/statusbar/sb-music | |
parent | dcbb16d8b08ff5956abef5e6478b59df2e93ad35 (diff) | |
download | dotfiles-8a2e1006b3b272126332aa064f3ad95387129544.tar.gz dotfiles-8a2e1006b3b272126332aa064f3ad95387129544.tar.bz2 dotfiles-8a2e1006b3b272126332aa064f3ad95387129544.zip |
Diffstat (limited to '.local/bin/statusbar/sb-music')
-rwxr-xr-x | .local/bin/statusbar/sb-music | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/.local/bin/statusbar/sb-music b/.local/bin/statusbar/sb-music new file mode 100755 index 0000000..6734eeb --- /dev/null +++ b/.local/bin/statusbar/sb-music @@ -0,0 +1,19 @@ +#!/bin/sh + +filter() { sed "/^volume:/d;s/\\[paused\\].*/⏸/g;/\\[playing\\].*/d;/^ERROR/Q" | paste -sd ' ' -;} + +pidof -x sb-mpdup >/dev/null 2>&1 || sb-mpdup >/dev/null 2>&1 & + +case $BLOCK_BUTTON in + 1) mpc status | filter ; setsid -f "$TERMINAL" -e ncmpcpp ;; # right click, pause/unpause + 2) mpc toggle | filter ;; # right click, pause/unpause + 3) mpc status | filter ; notify-send "🎵 Music module" "\- Shows mpd song playing. +- ⏸ when paused. +- Left click opens ncmpcpp. +- Middle click pauses. +- Scroll changes track.";; # right click, pause/unpause + 4) mpc prev | filter ;; # scroll up, previous + 5) mpc next | filter ;; # scroll down, next + 6) mpc status | filter ; setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;; + *) mpc status | filter ;; +esac |