dotfiles/scripts/rofi/music.sh

25 lines
502 B
Bash
Raw Normal View History

2021-07-11 15:51:11 +02:00
#!/bin/bash
MUSIC="$HOME/music"
function get_music() {
IFS=$'\n'
for i in $(ls "$MUSIC" | grep -v 'thumbs'); do
name="${i%.*}"
echo -en "${i}\0icon\x1f${MUSIC}/thumbs/${name}.png\n"
done
}
if [ -z "$@" ]; then
echo -en "Shuffle\0icon\x1fmedia-playlist-shuffle\n"
get_music
else
if [ "$1" = "Shuffle" ]; then
$HOME/scripts/music/mpv-controller.sh start shuffle &
else
$HOME/scripts/music/mpv-controller.sh start "${MUSIC}/$1" &
fi
fi