jump to navigation

How to use your Linux Machine as an Alarm January 22, 2006

Posted by Carthik in commands, guides, snippets, ubuntu.
trackback

You probably leave your computer on all the time. (Linux users keep it up longer, right?)
So instead of wasting more electricity by using an alarm clock to wake you up, why not put your desktop to work as a personal alarm? Like the Task Scheduler in Windows computers, it is really, really simple to have your Linux system do things at specified times in the future. This article will guide you through the process of using your desktop as a musical alarm.

Note: If you prefer player X and I use player Y in the examples below, you can easily substitute X for Y.

Use Kalarm:

Kalarm is the KDE alarm tool, which can, besides paying sounds, display a text file, or execute commands at specific times in the future. Even if you are an Ubuntu user (Gnome) you still can install and use kalarm. The name of the package to install is, unsurprisingly, “kalarm”!

Use the Xmms-Alarm plugin:

Xmms is the famous winamp-lookalike minimal music player for Linux. Install the package “xmms-alarm” and then you can use Xmms as an alarm. Downside: you will have to keep xmms running all night. No biggie? Alright then, you are all set. Click on the image above to see how to get to the point where you can set the preferences. (Right click on the Xmms window and Choose Options->Preferences->General Plugins)

Using Xmms and “at”:

Start XMMS and start playing songs. Adjust the volume to what you want to wake up to.

Push the stop button, then type:
$echo xmms -p | at 7:00

The “at” command line utility will make sure xmms starts playing at 7 AM the next day to wake you up.

Read $man at to find out more about “at”, which can do just about anything “at” a particular time.

Use “sleep” and “at” :

$sleep 8h && xmms /path/to/mp3file.mp3

This will open the mp3file.mp3 file with xmms after exactly 8 hours.

Use cron, mplayer, and a few other usual suspects:

More details at The Cron-Mp3 alarm clock writeup.

So , pick your poison potion!!!

Finally, if music doesn’t wake you up, the following sure will:
$sleep 8h && cat /dev/urandom > /dev/dsp

Thanks to all the ubuntu-users subscribers for writing in great suggestion, a few months ago.

Comments»

1. towsonu2003 - January 23, 2006

another nice tip, again!

2. John - January 23, 2006

Umm, like your blog but this part struck me as funny: “Unlike windows computers, it is really, really simple to have your Linux system do things at specified times in the future.”

You do know about the “Task Scheduler” that has been part of windows since 1995, right?

3. ubuntonista - January 23, 2006

Thanks John, I updated the entry. I totally forgot about the task scheduler, I swear!

4. The Funky Tux - January 24, 2006

Hi!
Nice tip! 🙂 I was just wondering: WTH does the last command do? 😛

5. mahesh - January 24, 2006

Excellent tip once again

6. ubuntonista - January 24, 2006

The last command sends a random stream of data to the sound output, so to speak.

7. GooZ - January 24, 2006

Nice tip, but I can also recommend the script that’s standard in AmaroK. I’m one of those gnome/amarok users, and I must say: this alarm works great!

8. Mansoor Rana - January 26, 2006

Last one realy works…. 😉

9. AviDardik.com » How to use your Linux Machine as an Alarm - January 28, 2006

[…] Ubuntu Blog has a cool little post about how to use your Linux machine as an alarm. […]

10. ttt - January 29, 2006

kalarm doesn’t appear in the gnome systray does it? it’s a bug

11. DeVil DeMonde - January 31, 2006

That’s probably because kalarm was written for kde not gnome that’s kind of like trying to run windows media player on Linux, I’m sure it’s possible but do you really want to jump through those hopps to get there? It’s not a bug, I promise it’s just inherently compatable. Though you are running linux, grab the source code and make one for gnome. 😀

12. DeVil DeMonde - January 31, 2006

You know I just read the thing about K alarm also working on gnome desktops, that’s strange… normally it wouldn’t be so, now I feel stupid for not reading it all theway through, I saw the K and skipped like a dummy, still though… common practice says kde goodies and gnome stuff go together sloppily at best. 😉

13. Zzz... Zzz... Zzz... - January 31, 2006

Even the last one doesnt’t wake me up… I convince myself (in my sleep) that it’s just the rain outside… 🙂

14. john - May 9, 2006

MythTV? Maybe this is why no one has gotten around to writing MythAlarm for so many years. http://www.gossamer-threads.com/lists/mythtv/users/24235

I will try this simple solution on the myth box in my bedroom.

15. ghdfg - June 19, 2006

ugh! there are people that ain’t geek enought to sleep earing the computer fans.

16. Chris - June 21, 2006

I rather like the sound of computer fans when I go to sleep 🙂 Good post, I’m adding this to the TV that clicks on, an alarm clock above my bed backboard, and my cell phone that goes off at 5:30…. maybe I won’t be late to work anymore! …nah!

17. Aaron O'Brennan - September 15, 2006

Thanks for the tip. I’ve got a (probably simple) question for you. Every time I install something using the synaptic package manager on Ubuntu (I think its 6,06) I can’t find the program that I just installed. I checked all of the spots in the ‘Applications’ toolbar but don’t know where else to check. I’d be very grateful if you’d tell me where to look for the programs or a web page to help me learn more about Linux and Ubuntu more specifically.

18. ubuntonista - September 15, 2006

Aaron, after you have installed something, in Synaptic, right click on the package you installed, choose “Properties” and then select the Installed files tab. If it was a binary application, chances are it would have been installed in the /usr/bin/ directory. Games are installed in /usr/share/games or something… however, reading the list of installed files should give you an idea as to where to find the executable. Once you have found it, type in the name of the executable from the command line, and Voila!

For example the default text editor, gedit is at /usr/bin/gedit. Since /usr/bin happens to be one of the paths that the system looks for executables in, you can type $gedit on the command line and run the editor. Hope this helped a little.

19. TerraHearts - October 1, 2006

or use teatime instead… it’s available in the ubuntu repository, so go synaptic! 😀

20. MANWHOHATESKALARM! - January 1, 2007

KALARM is horrible. Why do i need to jump through fucking hoops to get an alarm clock on my computer. Why in gods name would i ever need to display a text file on my computer. “HEY REMEMBER ME? THE TEXT FILE YOU WROTE 3 HOURS AGO? HI ITS ME AGAIN!” NO!

21. Didi - June 1, 2007

I use Gnome and must say: LOVE KAlarm.
Just an useful piece of software.
If you hate it so much, maybe it just not for you, after all.

22. Stas Sushkov - June 26, 2007

Thanks dude… It helped!

23. Mair - August 22, 2007

what about at + xmms-alarm plugin?

24. dustman - November 15, 2007

the last one is really helpful !

thanks 😀

25. Susana - November 26, 2007

It works perfectly!
thnks a lot!

26. Hielke - January 10, 2008

With me, Xmms immediately starts playing?? Does anybody know why this is?

27. Neodudeman - January 28, 2008

I know why. You’re not typing the ‘echo’ before the xmms –play | at teatime

the full command is:

echo xmms –play | at teatime

teatime being the time whenever you want.

28. walker - June 10, 2008

hey 🙂
i have already installed xmms , but i don’t know how to install that xmms-alarm plugin.. i have it downloaded on my desktop, but can’t find it with synaptic.. what should i do?

29. cheap car insurance rates for teenage boys - October 7, 2008

cheap car insurance rates for teenage boys…

breathtaking subsumes:trek courtesies library …

30. OnlineClock.net - November 20, 2008

We respectably suggest using http://onlineclock.net/about/

OK, our site might not be for everyone, but for those of you who want it easy, perhaps it’s a good solution 😉

Seriously, we offer a whole bunch of different alarm clocks you can use for free in your browser – please check us out.

All you need is flash installed for the alarm function to work properly.

31. Foster - July 6, 2009

how about “alarm clock?” (sudo apt-get install alarm-clock)

http://packages.ubuntu.com/intrepid/utils/alarm-clock

screenshot here: http://2.bp.blogspot.com/_Xy2g3N79xiI/STWJO0Q7T8I/AAAAAAAAARs/_XbVMsTt4QQ/s1600-h/alarmclock.jpg

I tried it out and it’s simple to use and has all the options anyone could ever need.

Dimitris - April 30, 2010

Thank you Foster.

I think your suggestion is the best.
Alarm-clock is now my favourite!

“I tried it out and it’s simple to use and has all the options anyone could ever need.”
+1 😉

32. vineet - May 28, 2010

hey! do you know anything that will wake my Computer (not me) at specific time. it will probably use ACPI. windows is much cooler in this area. you can schedule a task and enable “wake computer to perform this task”

33. porno sikiş - September 27, 2010

Thanks John, I updated the entry. I totally forgot about the task scheduler, I swear!

34. sex sikiş - September 28, 2010

Nice tip, but I can also recommend the script that’s standard in AmaroK. I’m one of those gnome/amarok users, and I must say: this alarm works great!

35. Random! thoughts!! « Saurabh’s Blog - September 29, 2010

[…] then using your linux as alarm(or as a toDO list)https://embraceubuntu.com/2006/01/22/how-to-use-your-linux-machine-as-an-alarm/ […]

36. turk sikisi - October 25, 2010
37. Vlatko Šurlan - March 9, 2011

I’ve also made my BASH version using audacious with fade-in. You can check it out here: http://www.docplanet.org/linux/turn-your-linux-machine-into-wakeup-alarm/

38. human mathematics - February 1, 2012

Very useful. Thanks. I use zomg instead of xmms to play songs, keep everything at the command line and it scrobbles to last.fm.

39. wallclock - May 8, 2015

I am suree this article has touched all tthe internet users, its really really pleasant article oon building upp
new webpage.

40. decd - June 18, 2017

Cool!

41. Michaelhyday - August 29, 2017

wh0cd473504 retin a .1 cream


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

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

Facebook photo

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

Connecting to %s

%d bloggers like this: