CUCBC Lighting down times on your desktop
A bit of geekery for this post - many rowers and coaches in Cambridge organise their lives around the CUCBC lighting up and lighting down times. These change every day and dictate when college rowing boats are allowed on the river.
The CUCBC provide a handy URL with a very simple output of the lighting up and lighting down times for webmasters to use on their websites. With a little bit of geekery anyone can use this URL to display this information on their desktop for quick reference.
If you’re using OS X, you can use an excellent program called GeekTool which allows you to display all kinds of dynamic content on your desktop. It’s very flexible and allows you to display the output of any terminal command. I’m sure that you can achieve something similar on linux and windows, but I’m not sure exactly how (Rainmeter for windows perhaps?)
Anyway, once GeekTool is installed, drag a new Shell object onto your desktop and paste the following into the Command box:
echo "Lighting down today:"; echo "Lighting up today:"; echo "Lighting down tomorrow:"; echo "Lighting up tomorrow:";
Create a second Shell object and place it alongside (using two makes it easy to align the results). Paste the following into the second:
curl http://www.cucbc.org/darkness.txt | tail +2
You can hack these around to make it work as you’d like. Here’s an explanation of what each bit is doing:
echo "Lighting down today:";
echo
prints whatever you put in the quotation marks. Optional extra - any commands you put within a $() will be executed and printed.
curl http://www.cucbc.org/darkness.txt
curl
gets the contents of the URL with the lighting up and down times.
tail +2
tail
returns the end of the results. +2 means start from the second line, so this trims off the first line.
Optional extra - if you want to print out one specific line you can use tail +<em>n</em>
and pipe that into:
head -n 1
head
returns the start of the results. -n 1 means return only one line.
All of these commands are connected to each other with pipes (the |
character), which passes their results from one to the next.
Hopefully, your desktop should now be looking something like this: