aboutsummaryrefslogtreecommitdiff
path: root/scripts/scripts/playpause.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/scripts/playpause.sh')
-rwxr-xr-xscripts/scripts/playpause.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/scripts/scripts/playpause.sh b/scripts/scripts/playpause.sh
new file mode 100755
index 0000000..72ba0fb
--- /dev/null
+++ b/scripts/scripts/playpause.sh
@@ -0,0 +1,17 @@
1#!/usr/bin/env bash
2# Interactive polybar icon for music controls
3# Requires cmus
4
5if pgrep -x "cmus" > /dev/null
6then
7 status=$( cmus-remote -Q | grep status\ | sed 's/status //' )
8 if [[ "$status" == *playing* ]]; then
9 echo -ne " %{F$(get_xres color2)} "
10 elif [[ "$status" == *paused* ]]; then
11 echo -ne " %{F$(get_xres color2)} "
12 elif [[ "$status" == *stopped* ]]; then
13 echo -ne " %{F$(get_xres color2)} "
14 fi
15else
16 echo -ne "  "
17fi