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 ++++++++++++++ .local/bin/cmus/toggle-shuf | 7 +++++++ 2 files changed, 21 insertions(+) create mode 100755 .local/bin/cmus/toggle-mode create mode 100755 .local/bin/cmus/toggle-shuf (limited to '.local/bin/cmus') 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 diff --git a/.local/bin/cmus/toggle-shuf b/.local/bin/cmus/toggle-shuf new file mode 100755 index 0000000..57c2606 --- /dev/null +++ b/.local/bin/cmus/toggle-shuf @@ -0,0 +1,7 @@ +#!/bin/sh +# Toggle and report status of shuffle mode in cmus + +cmus-remote --shuffle +status=$(cmus-remote -Q | grep shuffle | cut -d ' ' -f 3) +dunstctl close-all +[ "$status" = "true" ] && notify-send "Shuffle on" || notify-send "Shuffle off" -- cgit v1.2.3