Last active
March 9, 2017 23:45
-
-
Save miawgogo/68e0ca7a58480ea3714acfa03b0cbde4 to your computer and use it in GitHub Desktop.
A script allow a fading in alarm for mpd
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 | |
server="192.168.1.66" | |
vol=30 | |
targetvol=100 | |
dovol(){ | |
until [ $vol = $targetvol ]; do | |
mpc -q -h $server volume $x | |
sleep 0.5 | |
((x++)) | |
done | |
} | |
mpc -q -h $server stop | |
mpc -q -h $server clear | |
# You will need to make a MPD playlist called Alarm for this to work | |
mpc -q -h $server load Alarm | |
mpc -q -h $server play | |
dovol & | |
mpc -q -h $server current --wait | |
kill $! | |
mpc -q -h $server volume 60 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment