Instructables

Musical Computer-based Alarm Clock

Picture of Musical Computer-based Alarm Clock
As a college student I don't get enough sleep, my bed is warm and comfy, and I don't like getting out of it in the mornings.

I typically - as I'm sure many of you do as well - set an alarm (or two) on my phone and on a regular, plugs-into-the-wall alarm clock to get up in the morning. I don't like having to do that. The sounds are annoying, and can be easily silenced which lets me go back to sleep and be late for classes.

This instructable is a documentation of how I set up my computer to wake me, on a very programmable schedule, by playing music and ensures that I am awake. All 3 scripts are included as text files in the last step.

Note: I'm not going to explain anything more than the bare basics of the commands I used. I am assuming you have a basic familiarity with linux, and/or know how to use google.
 
Remove these adsRemove these ads by Signing Up

Step 1: Background and Planning

Background
I have a netbook and a large (17" behemoth) laptop. Both dual boot Ubuntu 12.04 LTS and Windows 7 Home Premium. As my netbook travels with me everyday the laptop is essentially a desktop, complete with second monitor, and external mouse and keyboard. My laptop primarily runs Ubuntu while my netbook typically runs Windows.

Planning
I looked through many forums trying to figure a way to schedule a musical alarm and learned about cron, "the time-based job scheduler in Unix-like computer operating systems" (Wikipedia). What I also saw was that many people were scheduling a media player to begin a playlist of files on their computer. I didn't think I'd be able to pick just a handful of songs that I'd want to wake up to every day, and I didn't want to install any new programs or fiddle with settings of pre-existing ones. There had to be another way. An easier way. Since I mostly use Pandora for music listening, and remembered the "gnome-open" command, I decided on Pandora.

Note: If anyone finds a very similar forum posting on ubuntuforums.com by kwrogers, that's me. I didn't copy this from kwrogers, I am kwrogers.

OK, now on to the part you actually wanted to read.
cool, I like the way you incorporated pandora into this, do you think you could make something similar for spotify?