diff options
author | dx <aryadevchavali1@gmail.com> | 2020-06-10 01:22:52 +0100 |
---|---|---|
committer | dx <aryadevchavali1@gmail.com> | 2020-06-10 01:22:52 +0100 |
commit | a9f3741cd0f1c01bf8f38676ae510a748eaeefba (patch) | |
tree | 525e3ff742c1b728d57cc820d7ca08cb4b7aa470 | |
parent | a0b577ee2245598faefbf95d94c7032ace1c2f39 (diff) | |
download | dotfiles-a9f3741cd0f1c01bf8f38676ae510a748eaeefba.tar.gz dotfiles-a9f3741cd0f1c01bf8f38676ae510a748eaeefba.tar.bz2 dotfiles-a9f3741cd0f1c01bf8f38676ae510a748eaeefba.zip |
+simple dmenu script to change music in mpd playlist
Searches playlist via dmenu for a music track then plays it. Bound to
hyper + m in sxhkd
-rw-r--r-- | SXHkD/.config/sxhkd/sxhkdrc | 3 | ||||
-rwxr-xr-x | Scripts/.local/scripts/playlist_choice | 10 |
2 files changed, 13 insertions, 0 deletions
diff --git a/SXHkD/.config/sxhkd/sxhkdrc b/SXHkD/.config/sxhkd/sxhkdrc index 382cb7e..1609463 100644 --- a/SXHkD/.config/sxhkd/sxhkdrc +++ b/SXHkD/.config/sxhkd/sxhkdrc @@ -20,6 +20,9 @@ hyper + l hyper + d $HOME/.local/scripts/background +hyper + m + $HOME/.local/scripts/playlist_choice + # Music and volume F{6,7,8} mpc -q {prev,toggle,next}; \ diff --git a/Scripts/.local/scripts/playlist_choice b/Scripts/.local/scripts/playlist_choice new file mode 100755 index 0000000..af69765 --- /dev/null +++ b/Scripts/.local/scripts/playlist_choice @@ -0,0 +1,10 @@ +#!/bin/bash +choice=$(mpc playlist | dmenu -i) +if [[ -n "$choice" ]] +then + item=$(echo $choice | awk '{split($0, a, "-");print a[2]}' | cut -c2-) + mpc searchplay title "$item" +else + echo "No choice given" +fi + |