Cron Alarm Clock
January 19, 2008
Unhappily, I’m sorry to say the there are a lack of alarm clocks in Linux. I’ve tried a few but really was impressed with none. So I decided to go with what the Linux uses for some of it’s timed events: Cron. Cron can be a good alarm and its easy to use.
The application “crontab” is used to create and edit cron jobs and the cron daemon checks for cronjobs a the top of every minute. A command line mp3 player can be used here but I like use Audacious. Cron will need to be told what X display to play Audacious on to discover the current display:
env | grep DISPLAY
Then as regular user edit crontab.
crontab -e
Here’s a simple comment to represent the cronjob layout:
# minute (0-59), # | hour (0-23), # | | day of the month (1-31), # | | | month of the year (1-12), # | | | | day of the week (0-6 with 0=Sunday). # | | | | | commands
Enter the time (multiple times, days need to be separated with commas) and script to execute for the alarm. The asterik can be used (*) to satisfy all variables. Here’s mine for audacious:
07 21 * * 1,2,3,4,5 env DISPLAY=:0.0 audacious /home/user/My\ Music/Other/Alarms/301gq.mp3
I found some good alarm tracks at this site the were perfect for the task.
I like vim as my system editor but any can be used. In Gentoo edit the /etc/rc.conf to change it. To list the crontab.
crontab -l
Additional Information:
- Gentoo Cron Guide
- Ubuntu Wiki on Cron
- gnome-schedule is a GUI utility for Gnome - in sunrise overlay.
- A Gnome/python alarm clock
- Timer Applet - is a Gnome applet that shows a timer on the panel. [ebuild]
Other Options
Wmtimer
Wmtimer works well for Gnome users (KDE has kalarm) it leaves a small window on the screen which can’t be hidden but it is able use the system beep or execute a command on an alarm/timer event. Starting it from the command line is pretty easy:
wmtimer -a -t 18:39:00 -e "mpg321 ~/Music/Other/Alarms/301gq.wav"
Timer-applet is a python application that adds a the ability to put a timer on the Gnome panel. Bugzilla has an ebuild for it, but I couldn’t get it to add to the gnome panel.
USE="libnotify sounds" emerge timer-applet
Audacious
Audacious also has alarm ability but it’s buried DeeeEEep in it’s preferences ( Preferences > Plugins > General ).
Alarm Clock
Thats actually its name. Despite the grey name, Alarm Clock is a very nice addition. Its a python script for the Gnome desktop that has the ability to run an application, display a message and to use as a tray icon. Its a good application and easy to install.
Alarm Clock requires python, pygtk, pynotif (notify-python in portage)
pygst (gst-python in portage).
Zenity Alert
Zenity is Gnome’s notification program. This won’t get a person out of bed but it can be good for reminders. In crontab enter:
Note: I wasn’t able to get this to work. If anyone can figure it out please let me know.
23 15 * * * env DISPLAY=:0:0 notify-send -i gtk-info "libnotify example" "An example of libnotify notification thingy."
- Thanks 2 keyboard cowboy.
Entry Filed under: Gentoo. .





Leave a Comment
Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
Trackback this post | Subscribe to the comments via RSS Feed