diff options
Diffstat (limited to 'pw-music')
-rwxr-xr-x | pw-music | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/pw-music b/pw-music new file mode 100755 index 0000000..f0f9112 --- /dev/null +++ b/pw-music @@ -0,0 +1,30 @@ +#!/usr/bin/env bash + +STATUS=$(playerctl status) + +case $STATUS in + + "Playing") + TITLE=$(playerctl metadata title | sed s/_/\ /g) + META="${TITLE:-Title}" + curstatus=" π΅ $META β" + ;; + + "Paused") + TITLE=$(playerctl metadata title | sed s/.m4a//g) + META="${TITLE:-Title}" + curstatus=" βΈοΈ $META β" + ;; + + *) + curstatus=" Player Off β" + ;; +esac + +echo -e "$curstatus" + +case "$BLOCK_BUTTON" in + 1) + playerctl play-pause + ;; +esac |