config/.local/bin/dmenumusic
2025-06-02 14:20:52 +09:30

17 lines
477 B
Bash
Executable File

#!/usr/bin/env bash
# thanks bread
#---
# relative path to mpd's music directory *must* be used. absolute path will not be read by mpd.
# mpd also seems picky about special characters in filenames.
#file=$(find $HOME/music -type f -name "*.mp3" | sort | sed !s|^$HOME/music/||" | dmenu) || exit 0
file=$(fd .mp3 $HOME/music -p -t f | sort | sed "s|^$HOME/music/||" | dmenu) || exit 0
echo "$file"
notify-send "Playing $file" && mpc insert "$file" && mpc next >/dev/null