-
-
Save trapd00r/978122 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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