Skip to content

Instantly share code, notes, and snippets.

@miawgogo
Last active March 9, 2017 23:45
Show Gist options
  • Save miawgogo/68e0ca7a58480ea3714acfa03b0cbde4 to your computer and use it in GitHub Desktop.
Save miawgogo/68e0ca7a58480ea3714acfa03b0cbde4 to your computer and use it in GitHub Desktop.
A script allow a fading in alarm for mpd
#!/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