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/cmus/toggle-mode | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 .local/bin/cmus/toggle-mode (limited to '.local/bin/cmus/toggle-mode') diff --git a/.local/bin/cmus/toggle-mode b/.local/bin/cmus/toggle-mode new file mode 100755 index 0000000..e73edc6 --- /dev/null +++ b/.local/bin/cmus/toggle-mode @@ -0,0 +1,14 @@ +#!/bin/sh +# Toggles the cmus aaa mode (all,album,artist) + +cmus-remote -C "toggle aaa_mode" +mode=$(cmus-remote -Q | grep "aaa_mode" | cut -d ' ' -f 3) +artist=$(cmus-remote -Q | grep "tag artist" | cut -d ' ' -f 3-) +album=$(cmus-remote -Q | grep "tag album" | cut -d ' ' -f 3-) + +[ "$mode" = "all" ] && dunstctl close-all && notify-send "Playing from full library" \ + && exit +[ "$mode" = "artist" ] && dunstctl close-all && notify-send "Playing by artist: $artist" \ + && exit +[ "$mode" = "album" ] && dunstctl close-all && notify-send "Playing from album: $album" \ + && exit -- cgit v1.2.3