home/.bin/mpc/mpc-i3-playlists

18 lines
428 B
Plaintext
Raw Normal View History

2017-07-30 19:03:09 -05:00
#!/bin/bash
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
if [ "$1" = "--clear" ]; then
mpc clear
fi
2017-07-30 19:07:28 -05:00
mpc load $PLAYLIST
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"