Every now and then, I need a change of scenery, and that includes what I see on my computer desktop. I spent this afternoon giving my desktop a long-overdue makeover. And thanks to the fact that my to-do list is based on text files, and that I use text files for many other things, it was fairly easy to include some real-time analytics embedded into my desktop via GeekTool. Here is what my new desktop looks like. Click on the image to see a larger version.
I have a 27″ iMac so my screen is pretty big. I use multiple “desktops” but all of them have the same basic look as above. I found a cool typing paper background and an old typewriter font to give it some flavor. You’ll note I’ve made 3 annotations on the image. I’ll discuss each of these below.
1. My to-do list rundown
I use todo.txt to manage my to-do list, and there is a little add on that takes your to-do list and produces a rundown. basically, it shows you what you completed yesterday (or the last day on which you completed a task) and what is still on your list. I embedded this into my desktop using GeekTool, and it updates automatically as my to-do list changes. This means that I never have to look further than my desktop to see what is on my to-do list.
GeekTool allows you to run shell commands and render the results as widgets that are embedded into your desktop. I used three different simple shell scripts to produce the date/time/weather section of my desktop:
For the date:
date +"%A, %b. %d"
For the time:
and for the weather:
curl --silent "http://weather.yahooapis.com/forecastrss?p=yourzipcode&u=f" | grep -E '(Current Conditions:|F<BR)' | sed -e 's/Current Conditions://' -e 's/<br \/>//' -e 's/<b>//' -e 's/<\/b>//' -e 's/<BR \/>//' -e 's/<description>//' -e 's/\(.*\) F/\1° F/' -e 's/<\/>//'
I got the latter from a repository of GeekTool scripts. It basically parses Yahoo’s weather for your zip code and produces a simple result.
Books read this year
I’ve explained how my main reading list is a plain text file that I keep in Dropbox. Because it is plain text, it can be easily manipulated. I can parse it to produce my formatted reading list page. And I can also use simple UNIX commands to extract additional information. To produce the number of books that I’ve read so far in the current year is as simple as running the following command:
grep `date '+%Y'` ~/Dropbox/Public/reading.txt | wc -l
For those who don’t speak UNIX, all this command does is searches for anything in my reading.txt file that contains the current year. It then filters the results through the “wc” command, which is the word count command. The -l says to count the number of lines int he results. Since I have one book per line, whatever that number of resulting lines is represents the number of books I’ve read so far this year.
What I’m currently reading
I wrote yesterday of how I keep a now.txt file that contains the title, author and Amazon product code of the book I’m currently reading. To produce this information on my desktop, I run a command that parses the contents of that file:
cat /Users/jamietr/Dropbox/Public/now.txt | sed 's/(.*)\(.*\)/\1/'
And this gives me the title and author of the book I’m currently reading.
Current writing stats
Over the summer I posted a set of Google App scripts to GitHub that I use to track my writing in Google Docs. The resulting stats are stored in a Google Spreadsheet. I spent this afternoon writing a Python command that I call “wstats” that works very similar to how “wc” works, except it reads data from my Google Spreadsheet. For example, if I want to see my writing stats for yesterday, all I have to do is type:
and what I get is:
945 700 528 208 353 2/14/2014
These numbers represent (in order):
- Word written
- 7-day moving average
- Number of consecutive days of writing
- Total number of days of writing
- Date of stats
I can run the command for any date by adding a -d. If I wanted to see the stats for my birthday last year, I can do:
wstats -d 3/27/2013
and the results I get are:
2259 500 1144 208 353 3/27/2013
The first three numbers are for that day. The last two numbers (consecutive and total days of writing) are current. So I can quickly see that I wrote 2,259 words on my birthday.
I can also specify any one element, as opposed to all elements. For instance, if I just want the word count from yesterday, I can do:
and all I get is
That latter is the command I use in GeekNote to produce the “Words written yesterday.” To produce my 7-day moving average, I use:
and to produce the number of consecutive days of writing, I use:
The rest is simply formatting the widgets and arranging them as I want them to appear on the screen.
This gives me a very useful, but clean looking desktop. Which is just how I like it.
And before anyone asks…
Yes, I will make my wstats.py Python script available on GitHub as part of my Google Writing Tracker project, once I have it cleaned up a bit (I only wrote it today!). Keep in mind, however, that the script expects the Writing stats spreadsheet to be in a very specific format. If you’re using my Google Writing Tracker scripts and want to use the wstats command, you’ll either have to modify your spreadsheet, or fork the wstats command on GitHub and modify it to your tastes.