aboutsummaryrefslogtreecommitdiff
path: root/pw-music
diff options
context:
space:
mode:
Diffstat (limited to 'pw-music')
-rwxr-xr-xpw-music30
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