Home > bash, python > Alarm script

Alarm script


I managed to reach a state that I don’t hear my alarm clock any more in the morning. Somehow I’ve become immune against it. So the problem is: how to get up in the morning? Well, the best way would be to go to bed early but it’s not that easy… So I made a simple alarm script that starts playing a list of MP3s at a given time.


You can get the script (alarm.py) from here.


./alarm.py -p
    Play music. First do this to adjust volume! If the volume 
    is low, you won't hear it in the morning.

./alarm.py -t 7h15
    Set alarm time. The format is HhM, where H is the hour 
   (24-hour system), M is the minute, 'h' is the separator.

    Set alarm with the default time. In my case it's 6h55.

If you want to jump out of your bed as if you had been shot out of a cannon, use the song Green Hornet. For me this is one of the most annoying songs ever. This song could simply kill me :)

Update (20110601)

Here are some tips How to Get Up Right Away When Your Alarm Goes Off.

Update (20110701)
The script was updated a bit. Now it can collect songs recursively too. When the alarm is activated, only the first 60 seconds of a song is played. Collected songs are played in a random order. If you use the -p option, songs are played from beginning to end (not just the first 60 seconds).

Tip: if you use it with “./alarm.py -p“, it works like a media player. It collects recursively all your MP3s from the specified folder and plays them in a random order.

Categories: bash, python Tags: ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Get every new post delivered to your Inbox.

Join 82 other followers

%d bloggers like this: