I want to switch from Windows XP to Ubuntu and there is one thing that I'm heavily using in XP—an MP3 alarm clock. In the evening I turn the PC to hibernated mode. In the morning it wakes up (based on Windows' scheduler) and runs a special program that then runs media player with a defined playlist, starts music and then slowly volumes up the sound.
So, my question is, are all these features present in Ubuntu?
- Hibernate PC with ease
- Wake up from hibernate in a scheduled moment of time
- Media player that can start playing music automatically (seems that's the problem on Windows, that's why i need a special program for that)
I don't have my laptop with me to try this right now, but I think this should work, or at least get you close:
That's "8 hours from now" -- 8 hours * 60 minutes per hour * 60 seconds per minute. Adjust the timing as you see fit. (Yes, you can put 6.5*6*6 if you want 6 and a half hours--that's why I put in
bc -l
)What it does is set an alarm for a specific second of time, which it's calculating based off of the numbers you enter, for when it should wake up. Then it calls the command that does suspending. When it resumes from suspend, it should move on to the third command in the line, which is the command to ogg123 to play all the .ogg's in your ~/Music (feel free to replace with mpg123 and *.mp3 or what-have-you).
You can also try with
pm-hibernate
instead ofpm-suspend
, but I'm not sure how well it'll work with the wakealarm. Even with suspend, how well various hardware supports wakealarm is uncertain until you try it.Source of wakealarm info: http://people.canonical.com/~apw/suspend-resume/test-suspend
Here is a post on the forums that might get you started in the right direction. But it looks like the answer is yes.
It says:
You can use sleep together with rhythmbox (which is installed by default), assuming you've got some .wavs or .oggs (or mp3s, and installed support for them).
Open rhythmbox from the sound & video menu, and import whatever sound file you want to wake up to. Then open a terminal, and run the command 'sleep nh && rhythmbox --play-pause' (replace n with the number of hours you want it to wait before playing, it doesn't have to be an integer.)
For the hibernate part try loooking on this article about ACPI Wakeup