Knock Clock

This application is just a python script that starts playback with mplayer and stops as soon as you hit the keyboard. The goal is to have your computer behave like a real alarm clock that you can hit in the dark :) the time stuff is handled by gnome-schedule, whose job is to launch this script, "knock-clock".

knock-clock has the following dependencies: mplayer-nogui, gnome-schedule, gnome-terminal, and a working internet connection if you plan to leave the default "TARGET" setting. If your network connection is not available at the Moment of Awakening, knock-clock will instead play the terrible Ubuntu saxophone song in /usr/share/example-content/

To set it up:

  1. make sure the dependecies are satisfied: sudo apt-get install mplayer-nogui gnome-terminal gnome-schedule bzr
  2. dowload this software manually by saving this file, or by using bzr branch http://code.ecchi.ca/knock-clock (for geeks)
  3. open the file and edit the "TARGET" if you want to use a local audio file or playlist of your own. Also change NEED_NETWORK to False if your target is not an Internet radio.
  4. move the file (optional): sudo mv knock-clock /usr/bin/knock-clock
  5. make sure it has executable permissions: sudo chmod +x /usr/bin/knock-clock or chmod +x knock-clock
  6. set up gnome-schedule to launch "knock-clock" at any desired time. Make sure that the "No output" checkbox is deactivated (otherwise the terminal will not be visible). You must also add the display variable for all this to work. And, finally, you need to pass this on to gnome-terminal. Yeah, this is messy, but it's the only way I could make it work (should be easier in gnome-schedule >2.1). So, the command you should add in gnome-schedule is: export DISPLAY=:0 && gnome-terminal -x knock-clock

Knock Clock is Free and Open Source software by Jean-François Fortin Tam, distributed under the GNU GPL v3 license.