diff options
author | davidovski <david@davidovski.xyz> | 2023-12-22 00:10:59 +0000 |
---|---|---|
committer | davidovski <david@davidovski.xyz> | 2023-12-22 00:10:59 +0000 |
commit | ab3309062e7c53623e0c4ad22ef0645d844ab18c (patch) | |
tree | a9ac6ef2eaa7fab27fb9c96d8951fc50947ee873 /scripts/mpc_picker | |
parent | 7b3aa701e2de13cea1ea2e05c70cca2ced74971f (diff) |
change mpc picker to list titles and albums
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" |