My New “Analytics” Desktop

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.

Analytics Desktop
Click to enlarge

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.

2. Date/time/weather

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:

date +"%l:%M"

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.

Reading/writing metrics

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:

wstats

and what I get is:

945 700 528 208 353 2/14/2014

These numbers represent (in order):

  • Word written
  • Goal
  • 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:

wstats -w

and all I get is

945

That latter is the command I use in GeekNote to produce the “Words written yesterday.” To produce my 7-day moving average, I use:

wstats -a

and to produce the number of consecutive days of writing, I use:

wstats -c

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.

Enjoy these posts? – Tell a friend

Recommending readers is one of the highest compliments you can pay to a writer. If you enjoy what you read here, or you find the posts useful, tell a friend! Find me online here:

Twitter | Facebook | Google+ | Blog | RSS

Or use one of the share buttons below. Thanks for reading!

3 thoughts on “My New “Analytics” Desktop

  1. This is very cool, Jamie.

    My meager programming skills are far too inadequate to pull off something as complex as your personalized setup, but I still enjoy reading these posts.

    One of your earlier posts inspired me to try out Rainmeter again, which is a program for Windows similar to GeekTools. Fortunately for me, there are a number of third-party skin suites ready-made for Rainmeter and I was able to find a couple that fit my needs.

    One of the Rainmeter skin suites, Elementary, has a nice notepad skin that embeds text from a .txt file in the desktop.

    It took me a few hours to figure out how to set up Launchy (a Windows app like Quicksilver) to append text to the file and get the skin to autorefresh (default behavior is for the skin to only refresh when you type into the skin itself and hit enter or when you right-click on it and select Refresh from the context menu). I had to create a batch file for Launchy and modify one of the notepad skin’s settings files.

    Here’s a screenshot: https://dl.dropboxusercontent.com/u/38030/Screenshots/rainmeter-desktop-2-16-14.png. I have a dual-monitor setup. The two widgets on the left are old Windows 7 gadgets that I haven’t been able to find Rainmeter replacements for.

  2. When I have some time, I’m going to try to recreate my Mac desktop on my Windows machine with Rainmeter. I’ll let you know how it works out. (I also use Cygwin extensively on my Windows machine, so that may make it a little easier. I can basically use the same set of scripts I use on the Mac, since all of the scripts run in a bash shell and I have all of the various languages installed on both systems.)

Comments are closed.