2017-07-30 19:03:09 -05:00
|
|
|
#!/bin/bash
|
2017-07-31 02:03:03 -05:00
|
|
|
MESSAGE='-mesg Append:'
|
|
|
|
if [ "$1" = "--clear" ]; then
|
|
|
|
MESSAGE='-mesg Replace:'
|
|
|
|
fi
|
|
|
|
PLAYLIST="$(mpc lsplaylists | rofi -lines 10 -dmenu -p 'Play MPD Playlist: ' $MESSAGE)"
|
2017-07-30 19:31:12 -05:00
|
|
|
if [ "$PLAYLIST" = "" ]; then
|
|
|
|
exit
|
|
|
|
fi
|
2017-07-31 02:03:03 -05:00
|
|
|
if [ "$1" = "--clear" ]; then
|
|
|
|
mpc clear
|
|
|
|
fi
|
2017-07-30 19:07:28 -05:00
|
|
|
mpc load $PLAYLIST
|
2017-08-01 00:54:55 -05:00
|
|
|
if [[ "$(mpc)" != *"playing"* ]]; then
|
|
|
|
mpc play
|
|
|
|
fi
|
2017-07-30 19:07:28 -05:00
|
|
|
notify-send -u low -t 5 -a 'Mopidy' "$PLAYLIST" "Beginning playback of playlist $PLAYLIST"
|