Skip to content

Instantly share code, notes, and snippets.

@that4chanwolf
Created January 19, 2013 23:55
Show Gist options
  • Save that4chanwolf/4575879 to your computer and use it in GitHub Desktop.
Save that4chanwolf/4575879 to your computer and use it in GitHub Desktop.
MPD now playing with dzen2
#!/bin/zsh
DZEN_LOCATION=$(which dzen2)
MPC_LOCATION=$(which mpc)
if [[ -z ${DZEN_LOCATION} ]]; then
echo "dzen2 not found" && exit 1
else
DZEN_COMMAND=(dzen2 -ta c -p 5 -y 25 -x 1050 -tw 285 -bg \#2a2f30 -fg \#ffffff -fn Terminus)
fi
if [[ -z ${MPC_LOCATION} ]]; then
echo "mpc not found" | ${DZEN_COMMAND} & exit 1
else
if [[ "$(mpc current | grep -Eo '.{31}')" != "$(mpc current)" ]]; then
if [[ -n "$(mpc current | grep -Eo '.{31}')" ]]; then
NP=`echo $(mpc current | grep -Eo '.{28}')"..."`
else
NP=$(mpc current)
fi
else
NP=$(mpc current)
fi
echo ${NP} | ${DZEN_COMMAND} & exit
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment