+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
This commit is contained in:
dx
2020-06-10 01:22:52 +01:00
parent a0b577ee22
commit a9f3741cd0
2 changed files with 13 additions and 0 deletions

View File

@@ -20,6 +20,9 @@ hyper + l
hyper + d hyper + d
$HOME/.local/scripts/background $HOME/.local/scripts/background
hyper + m
$HOME/.local/scripts/playlist_choice
# Music and volume # Music and volume
F{6,7,8} F{6,7,8}
mpc -q {prev,toggle,next}; \ mpc -q {prev,toggle,next}; \

View File

@@ -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