diff options
author | Sam Chudnick <sam@chudnick.com> | 2021-11-06 20:25:45 -0400 |
---|---|---|
committer | Sam Chudnick <sam@chudnick.com> | 2021-11-06 20:25:45 -0400 |
commit | 82df70eff06e7b44ee84283070d7f801f7fc1d92 (patch) | |
tree | d17ea9cc6e012b16ff0cdeffcf4a97b5e5cd2d11 /.local/bin/statusbar/bar-cmus |
initial commit
Diffstat (limited to '.local/bin/statusbar/bar-cmus')
-rwxr-xr-x | .local/bin/statusbar/bar-cmus | 25 |
1 files changed, 25 insertions, 0 deletions
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 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | case $BUTTON in | ||
4 | 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-)) | ||
5 | Artist: $(cmus-remote -Q | grep "tag artist " | cut -d ' ' -f 3-) | ||
6 | Album: $(cmus-remote -Q | grep "tag album " | cut -d ' ' -f 3-) | ||
7 | Track: $(cmus-remote -Q | grep "tag title " | cut -d ' ' -f 3-) | ||
8 | Genre: $(cmus-remote -Q | grep "tag genre " | cut -d ' ' -f 3-) | ||
9 | Mode: $(cmus-remote -Q | grep "aaa_mode" | cut -d ' ' -f 3) | ||
10 | Format: $(cmus-remote -Q | grep file | rev | cut -d '.' -f 1 | rev) | ||
11 | Shuffle: $(cmus-remote -Q | grep "set shuffle " | cut -d ' ' -f 3-) | ||
12 | Repeat: $(cmus-remote -Q | grep "set repeat_current " | cut -d ' ' -f 3-)";; | ||
13 | |||
14 | 3)urxvt -e vim ~/.local/bin/statusbar/cmus;; | ||
15 | 4)cmus-remote --next;; | ||
16 | 5)cmus-remote --prev;; | ||
17 | esac | ||
18 | |||
19 | pgrep -x cmus >/dev/null || exit 0 | ||
20 | |||
21 | status="$(cmus-remote -Q | grep status | cut -d ' ' -f 2)" | ||
22 | artist="$(cmus-remote -Q | grep "tag artist" | cut -d ' ' -f 3- | tr -d "\n")" | ||
23 | track="$(cmus-remote -Q | grep "tag title" | cut -d ' ' -f 3- | tr -d "\n")" | ||
24 | echo -n "$artist - $track" | ||
25 | [ "$status" = "playing" ] || echo -n " [P]" | ||