rtcwake and the ghetto alarm clock: Wake up on time

This one comes from Alfredo Palhares, and I don’t have much to add to his description: It’s essentially a one-liner using rtcwake to power up a machine from suspend, and immediately begin playing music. Setting the exact time makes it into an alarm clock, of sorts.

I’m shamelessly copy-and-pasting here:

sudo rtcwake -m disk $(date +%s -d 'tomorrow 08:30') && amixer -c 0 set Master 100% && mpv /home/masterkorp/Music//Mozart\ Discography\ \(5\ CDs\)\ 320kbps//

I see that it uses mpv for playback, but I suppose almost any music player would work, so long as it takes a music file or folder as a target. And I suppose it’s worth saying it will require some ALSA support. 😉

I have to be honest on two points. First, I haven’t actually tried this personally, mostly because I almost never use suspend on any machine, despite the fact that I only work with laptops. Suspend has never been of much interest to me; I prefer to zip from cold boot to command prompt. :mrgreen:

The second issue is geographical: I keep my arsenal of junky laptops in a completely different part of the house, and even while belching out their best tinny volume, I doubt the sound would carry. So I’ll probably stick with the old-fashioned beeping clock alarm. 🙄

For those reasons and reasons of protocol, if you have questions or suggestions, you should probably direct them to Alfredo. 😉

rtcwake, by the way, is in util-linux, which is probably, maybe, possibly … on your system already. 🙂

2 thoughts on “rtcwake and the ghetto alarm clock: Wake up on time

  1. Pingback: Links 21/8/2014: Conferences of Linux Foundation, Elephone Emerges | Techrights

Comments are closed.