I’ve been playing with the new API, and decided to write couple of GeekTool scripts. Here’s the result:
For those not familiar with it, GeekTool is a mac application that allows users to display all kinds of information right on the Desktop. It is extremely versatile, though perhaps not terribly intuitive if you are unfamiliar with shell scripting. Luckily for you, I’ve already taken care of most of the work so you should be able to reproduce the above setup fairly easily.
Here are the steps to follow:
1. Install GeekTool: https://itunes.apple.com/ca/app/geektool/id456877552?mt=12 (If you aren’t running OS X 10.6 or later, you can download an older version here: http://projects.tynsoe.org/en/geektool/download.php)
2. Download my GeekTool scripts (version 2.0): http://cl.ly/1o1I1h0r1c2Q
3. Unzip the archive, and move the folder called “WKGeekToolResources” to /Users/Shared/ (If you can’t figure out how to get there, open a Finder window and hold down shift + command + G; then, paste “/Users/Shared/” and click Go)
4. Double Click every one of the ten *.glet files in the WaniKaniGeekTool folder you just downloaded and click YES each time you are asked if you would like to run the Geeklet.
5. Go to http://www.wanikani.com/account, scroll down, and copy your API key. Then, open the GeekTool application and select the “WaniKaniAPIRequest” Geeklet on your Desktop (it’s the big empty rectangle; you should see the name at the top of the Properties window).
6. In the Properties window, look for the field labelled “Command:”. To the right of the command field, click the “…” button (it’s black and hard to see) and paste your API key after “APIKey=”. Save (⌘ + s).
7. Check the “Automatically Launch at Login” checkbox and close the GeekTool app (but, select the option not to close the Geeklets after the app quits)
8. Log out and log in or restart your mac (there is a known bug in GeekTool which causes the Geeklets to appear in Mission Control if you don’t do this after having used the GeekTool app to make modifications to your Geeklets).
The icons I included are from the Iconic icon set and are licensed under a CC-BY-SA 3.0 licence. Here’s a link to the author’s website: http://somerandomdude.com/work/iconic/
I’m a neuroscience student and most of the programming I do involves one-off scripts that are never made public, so please forgive the hackish code. I’m sure there are more elegant ways to do this, but hey it works.
Hope you enjoy!
Oh, and because I know someone is going to ask here’s a link to the ダンボー wallpaper: https://www.google.ca/search?hl=en&q=danbo+rain&bav=on.2,or.r_gc.r_pw.r_qf.&bpcl=39650382&biw=1276&b…
Edit: Just found out that the 300 MB ram usage was caused by a memory leak in the GeekTool app. To avoid this problem, restart your system once you’re done adding the Geeklets (and after each time you open the GeekTool app to make changes to your Geeklets). The “GeekTool Helper” process that runs the actual Geeklets shouldn’t take anymore than ~20 MB of ram so long as you do this.
Edit 2: Posted a slightly updated version because I noticed the labels (“Next Review”, “Lessons”, and “Reviews”) sometimes disappear. If you have this problem, you can remove the old label Geeklets, download the new zip archive, and re-add the label Geeklets from there (all six other Geeklets are the same as before). Alternatively, you can go to the Properties window of each of the three label Geeklets, uncheck the “Override text:” checkbox, and paste “echo ‘Next Review’”, “echo ‘Lessons’”, and “echo ‘Reviews’” in the command field of each of the three label Geeklets, respectively.
Edit 3 (03/01/2013): Version 2.0. Nothing major, but I made a few improvements.
- Next Review Time now displays current time (updated every minute) instead of the time obtained from the API request (updated every five minutes) when the next review is available now.
- Now makes three times less API requests per hour while maintaining the same update frequency. Doesn’t really affect you, but the Crabigator will appreciate.
- Much cleaner code overall.
- Easier installation (you only have to paste your API key once).
- If you want to display a 24h clock, download and install this Geeklet: http://cl.ly/3T371O0p0B3u (and delete the 12h one)