For a while, I’d been using the
at command to schedule alarms when I needed to wake up in the morning, but I found that it was a fragile solution because of how MPlayer and its descendants interacted with PulseAudio’s session-centric setup and the presence or absence of a video output.
…and you really don’t want a fragile solution for your alarm clock, so I decided to write a little helper script that could run inside my quake-style terminal in my user session so it would Just Work™.
You’ll want to edit the hard-coded media player command it uses to actually play the alarm, but, otherwise, it should be pretty polished for something I just hacked together for my own use.
It’ll accept arguments in two forms:
wakeme at 6am
wakeme in 3 hours
Either one will cause it to echo back its interpretation of what you asked for (so you can double-check that it understood properly) and then sleep until it’s time to wake you.
Installation is as simple as:
- Make sure Python 2.x is installed (I haven’t tested 3.x)
- Install python-dateutil
- Install pytimeparse
- Put wakeme in your