Created
May 3, 2012 17:17
-
-
Save EightAndAHalfTails/2587347 to your computer and use it in GitHub Desktop.
a script that starts mpd during the Gnome3 login screen
This file contains 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 | |
case "$1" in | |
start) | |
until pgrep pulseaudio &>/dev/null; do | |
sleep 0.5 | |
done | |
sleep 1 | |
rc.d start mpd >>/home/jake/log.txt | |
mpc pause >>/home/jake/log.txt | |
mpc repeat on >>/home/jake/log.txt | |
mpc single on >>/home/jake/log.txt | |
mpc random off >>/home/jake/log.txt | |
mpc crossfade 5 >>/home/jake/log.txt | |
mpc volume 50 >>/home/jake/log.txt | |
mpc prev >>home/jake/log.txt | |
mpc insert login_music/prelude.mp3 >>/home/jake/log.txt | |
mpc next >>home/jake/log.txt | |
until users | grep -q jake; do | |
sleep 0.5 | |
done | |
mpc repeat off >>home/jake/log.txt | |
mpc single off >>home/jake/log.txt | |
mpc random on >>home/jake/log.txt | |
mpc crossfade 0 >>home/jake/log.txt | |
;; | |
stop) | |
rc.d stop mpd | |
;; | |
restart) | |
$0 stop | |
sleep 0.5 | |
$0 start | |
;; | |
*) | |
echo "usage: ${0##*/} {start|stop}" >&2 | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment