aboutsummaryrefslogtreecommitdiff
path: root/pw-music
diff options
context:
space:
mode:
authorPhilip Wittamore <philip@wittamore.com>2025-06-06 23:42:59 +0200
committerPhilip Wittamore <philip@wittamore.com>2025-06-06 23:42:59 +0200
commitc00b14c75468f7c91cb0e89de20d8433fba7c917 (patch)
treee2117c1037dd772734e81c956380f4023687799c /pw-music
parent669b6b86a128f7559b257e69f07e610e26d0cd23 (diff)
downloadscripts-c00b14c75468f7c91cb0e89de20d8433fba7c917.tar.gz
scripts-c00b14c75468f7c91cb0e89de20d8433fba7c917.tar.bz2
scripts-c00b14c75468f7c91cb0e89de20d8433fba7c917.zip
update
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