diff options
Diffstat (limited to 'scripts/mpc_picker')
-rwxr-xr-x | scripts/mpc_picker | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/scripts/mpc_picker b/scripts/mpc_picker index 0e6fddc..3758b0a 100755 --- a/scripts/mpc_picker +++ b/scripts/mpc_picker @@ -1,4 +1,6 @@ #!/bin/sh -chosen=$(mpc listall | dmenu -i -p mpd) -[ "$chosen" != "" ] || exit -mpc insert "$chosen" +selected=$(mpc -f "%title%[\t\t%artist%][\t\t%album%]\t\t%file%" listall | dmenu -i -p mpd) +[ "$selected" == "" ] && exit +file=$(printf "%s\n" "$selected" | rev | cut -f1 -d' ' | rev) +echo "$file" +mpc insert "$file" |