linux alarm clock
April 14th, 2007 mysurface Posted in bc, Misc, xmms | Hits: 40339 | 9 Comments »
I have too used to alarm clock, to wake me up every early morning. I set my alarm on my cellphone every night before I going to sleep. But recently, a simple stupid idea of creating an alarm clock in Linux comes to my mind.
I usually turns on my laptop overnight for some downloads, system updates. It is a basic requirement for a linux alarm clock. This example is a bit creepy, i know. But somehow it works.
First you need to calculate what time you wanna wake up? Let say if you wanna wake up after 5 hour and 30 minutes. You need to calculate the time in seconds using bc and parse the result to sleep, and later play a song to wakes you up after the sleep:
sleep `echo "60*60*5+60*30" | bc`; xmms -p
You can preloaded with any song and set your preferred volume.
The better and easy way should be using at or crontab. I have tried but it doesn’t seems to be working.
Such as ….
at 2:10 <<< "xmms -p"
or crontab
crontab -e
and write a line in
45 7 * * * /usr/bin/xmms -p
I have no idea why it fails :(







April 14th, 2007 at 7:20 pm
FYI, Xmms have an alarm-plugin .. try it out :D
http://freshmeat.net/projects/xmmsalarm/
btw .. the crontab hack worked for me .. (you’ll need xmms running first of course)
April 14th, 2007 at 10:41 pm
cool, the xmms-alarm is at my apt repo. Nice with complete function. Did I need to make XMMS running too?
I try at terminal, execute xmms -p will open the xmms + play, donno why it doesn’t happen to at and crontab.
April 15th, 2007 at 1:29 am
surface, the crontab hack is working for me too
April 15th, 2007 at 1:55 am
[...] So I saw surface’s post on a Linux Alarm Clock using xmms. [...]
April 21st, 2007 at 4:57 am
You don’t need xmms runing, only an X server.
xmms needs an X server to work.
May 4th, 2007 at 9:20 am
i need to learn handle server by linux
December 8th, 2008 at 8:09 am
at 1:09 <<< “DISPLAY=:0 amarok -p”
December 9th, 2008 at 3:32 pm
This worked for me:
> echo “DISPLAY=:0 xmms -p” | at 09:33
July 16th, 2012 at 11:29 am
Been trying the crontab alarm clock idea for a while for a while; it might be it doesn’t work because it runs it in the background? Dunno…