From 82df70eff06e7b44ee84283070d7f801f7fc1d92 Mon Sep 17 00:00:00 2001 From: Sam Chudnick Date: Sat, 6 Nov 2021 20:25:45 -0400 Subject: initial commit --- .local/bin/statusbar/bar-cmus | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 .local/bin/statusbar/bar-cmus (limited to '.local/bin/statusbar/bar-cmus') diff --git a/.local/bin/statusbar/bar-cmus b/.local/bin/statusbar/bar-cmus new file mode 100755 index 0000000..947f950 --- /dev/null +++ b/.local/bin/statusbar/bar-cmus @@ -0,0 +1,25 @@ +#!/bin/sh + +case $BUTTON in + 1)notify-send "$(cmus-remote -Q | grep position | awk '{ printf "%02i:%02i", $2/60, $2%60}')/$(cmus-remote -Q | grep duration | awk '{ printf "%02i:%02i\n", $2/60, $2%60} ') ($(cmus-remote -Q | grep status | cut -d ' ' -f 2-)) +Artist: $(cmus-remote -Q | grep "tag artist " | cut -d ' ' -f 3-) +Album: $(cmus-remote -Q | grep "tag album " | cut -d ' ' -f 3-) +Track: $(cmus-remote -Q | grep "tag title " | cut -d ' ' -f 3-) +Genre: $(cmus-remote -Q | grep "tag genre " | cut -d ' ' -f 3-) +Mode: $(cmus-remote -Q | grep "aaa_mode" | cut -d ' ' -f 3) +Format: $(cmus-remote -Q | grep file | rev | cut -d '.' -f 1 | rev) +Shuffle: $(cmus-remote -Q | grep "set shuffle " | cut -d ' ' -f 3-) +Repeat: $(cmus-remote -Q | grep "set repeat_current " | cut -d ' ' -f 3-)";; + + 3)urxvt -e vim ~/.local/bin/statusbar/cmus;; + 4)cmus-remote --next;; + 5)cmus-remote --prev;; +esac + +pgrep -x cmus >/dev/null || exit 0 + +status="$(cmus-remote -Q | grep status | cut -d ' ' -f 2)" +artist="$(cmus-remote -Q | grep "tag artist" | cut -d ' ' -f 3- | tr -d "\n")" +track="$(cmus-remote -Q | grep "tag title" | cut -d ' ' -f 3- | tr -d "\n")" +echo -n "$artist - $track" +[ "$status" = "playing" ] || echo -n " [P]" -- cgit v1.2.3