summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2023-12-22 00:10:59 +0000
committerdavidovski <david@davidovski.xyz>2023-12-22 00:10:59 +0000
commitab3309062e7c53623e0c4ad22ef0645d844ab18c (patch)
treea9ac6ef2eaa7fab27fb9c96d8951fc50947ee873 /scripts
parent7b3aa701e2de13cea1ea2e05c70cca2ced74971f (diff)
change mpc picker to list titles and albums
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/mpc_picker8
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"