/home/administrator/scripts/radio-alarm.sh
Code: Select all
#!/bin/sh
# Turn your computer into a digital radio alarm clock.
# Use cron to schedule the script to trigger at the designated
# date and time of your choosing.
# Change the following URL to your choice of online stream
STREAMING_ADDRESS=http://eradioportal.com/monsterRx.asx
# Mute the speakers. You don't want to be rudely awakened
# by a sudden rush of sound from the speakers now, do you?
amixer -q set Master 0
# Let's use VLC to stream content.
DISPLAY=:0 vlc $STREAMING_ADDRESS &
sleep 10 # A 10-second wait should be enough time to fill up the buffer.
# Gradually turn the volume up in 5% increments every 2 seconds
for STEP in `seq 5 5 100`
do
amixer -q set Master $STEP%
sleep 2
done
# EOF
Code: Select all
crontab -e
Code: Select all
# m h dom mon dow command
# Wake me up every 6:30 am, Monday through Saturday, all year round
30 6 * * 1-6 /home/administrator/scripts/radio-alarm.sh
Here's an online cron job generator you can use: http://www.generateit.net/cron-job/