Mac itunes fade in alarm clock!!
Ok so you like to wake up to your tunes, but you want to do this the geeked out way.
ok then.. this script will slowly raise the volume to gently wake you up in the morning from itunes...
open up the terminal on your mac
create a file called wake.sh
jcp$ nano wake.sh
paste this into the screen but change the song name MY_FAVSONG_IN_ITUNES to something you like **IT MUST MATCH THE NAME OF A SONG EXACTLY THAT IS IN YOUR iTUNES LIBRARY** IMPORTANT
#!/bin/bash osascript -e "set Volume 9" # set the MAC speaker volume to max osascript -e 'tell application "iTunes" to set sound volume to 0' ; osascript -e 'tell application "iTunes" to play track "MY_FAVSONG_IN_ITUNES"' ; i=1; while [ $i -le 100 ] ; do osascript<<EOT tell application "iTunes" to set sound volume to "$i" # raise the volume every 2 seconds EOT sleep 2 ; (( i++ )); done ; sleep 480 ; osascript -e 'tell application "iTunes" to stop' ; osascript -e 'tell application "iTunes" to quit' ;
save by pressing ctrl-x then y
Save modified buffer (ANSWERING "No" WILL DESTROY CHANGES) ?
Y Yes
N No ^C Cancel
Ok once you have created your wake up file, the next part is to set your mac to wake up in the morning and then kick off this script :)
then make the file executable
jcoop$ chmod +x wake.sh
edit your crontab file
jcoop$ crontab -e
press "i" to enter into the insert mode
type the following - this is assuming you like to wake up at 8:30 am M-F
30 8 * * 1-5 ~/wake.sh
when you are done press ESCape, then colon:'w' and 'q' ( :wq)
this will save and quit the crontab
next go to System Preferences > Energy Saver > (bottom of pane) Schedule...
Choose a time to wake up the PC from power down a few minutes before your alarm is set to go off .. so in the example above the alarm is set for 8:30 am... set the start up at 8:28am this will wake the mac up and start the music shortly after..
There you go!
Comments