Skip to content

Instantly share code, notes, and snippets.

@trapd00r
Created May 18, 2011 07:13
Show Gist options
  • Save trapd00r/978122 to your computer and use it in GitHub Desktop.
Save trapd00r/978122 to your computer and use it in GitHub Desktop.
#!/bin/bash
if [[ -f $XDG_CONFIG_HOME/dmenurc ]]; then
# so we source it's rc, but we never give $DMENU any value :-)
. $XDG_CONFIG_HOME/dmenurc
else
# much easier to use the new vertical mode of dmenu (20 lines)
DMENU="dmenu -i -l 20"
fi
ARTIST=$( mpc ls | $DMENU )
if [[ $ARTIST == "" ]]; then
exit 1
else
ALBUM=$( echo -e "Play All\n$( mpc ls "$ARTIST" )" | $DMENU )
if [[ $ALBUM == "" ]]; then
exit 1
else
mpc clear
if [[ $ALBUM == "Play All" ]]; then
mpc add "$ARTIST"
else
mpc add "$ALBUM"
fi
mpc play
fi
fi
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment