Home > bash, python > Alarm script

Alarm script

Problem

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.

Download

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

Usage

./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.

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

Tip
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.

About these ads
Categories: bash, python Tags: ,
  1. No comments yet.
  1. No trackbacks yet.
You must be logged in to post a comment.
Follow

Get every new post delivered to your Inbox.

Join 61 other followers

%d bloggers like this: