#!/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 && mpc play >/dev/null