WaniKani API + GeekTool = ♥

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)

Works for me. Thanks for this great script! :slight_smile:

Great stuff, but too bad I’m almost never on my desktop. So it wouldn’t help me so much. The other problem is - i don’t have a mac :smiley:

EDIT: Works great. Thank you for the tool

Sounds cool! Getting it now, and I hope that recent RAM upgrade my friend gave me is going to help.

Lovely! Thanks for sharing :smiley:

Very nice. It’s been awhile since I messed with Geektool. Might have to fire it up again.

bk-210 said... Note that GeekTool takes about 300 MB of ram, so it might not be the best idea if you're on short on ressources.

Oh my god, what is it, trying to find the last digit of pi in the background? Seriously.
But anyway, good job.
Gera said...
bk-210 said... Note that GeekTool takes about 300 MB of ram, so it might not be the best idea if you're on short on ressources.

Oh my god, what is it, trying to find the last digit of pi in the background? Seriously.
But anyway, good job.
 I know, I thought it was a little ridiculous (but didn't really care since I have tons of ram to spare). Nonetheless, I just did a bit of googling and found out that the GeekTool app has a pretty serious memory leak problem. The good news is that it's only the geek tool app (which is only necessary to add and modify Geeklets) which has a memory leak problem. Once you quit the app and restart your system, the memory usage of the "GeekTool Helper" process goes down to a much more reasonable ~20 MB.

Very, very nice, I love it!

Could I suggest if you plan on further improving it a way to change font colours? Though I’m sorry if that’s some really basic setting or something I need to change.

Very, very nice, I love it!
Could I suggest if you plan on further improving it a way to change font colours? Though I'm sorry if that's some really basic setting or something I need to change.

You can change the typeface, font size, colour, and opacity in the Properties menu:



As for the icons, here’s a a zip archive with each of the icons I used in fourteen different colours: http://cl.ly/1b0x1Z0B0g0V
You need to put the icons in /Users/Shared/WaniKaniGeekToolIcons/ and make sure to change the name so that it’s exactly the same as that of the icon you are replacing (either that or use “Set local path” in the GeekTool Properties to select the new icon). If you want the icon in different sizes or other colours, go to the icons’ author’s website to get vector copies.

GeekTool is great for customisation. Except for the “Command” part which requires some knowledge of shell scripting, you can pretty much change everything else with the graphical interface and some Photoshop skills (to create matching wallpapers). Check out this page to see all kinds of things people have done with it: http://www.flickr.com/photos/tags/geektool/

You might also like this website which has a large collection of Geeklets other people have made.

Thank You!

I’ve been using it for a while and it works great, but today I reached 0 reviews and lessons and this happened

http://i.imgur.com/7uTuZ.png

Just wanted to say “thanks” to the original poster! I was always interested in GeekTool but also always overwhelmed. :stuck_out_tongue: Using this and it’s great!

MjTheHunter said... I've been using it for a while and it works 大した, but 今日 I reached 0 reviews and lessons and this happened

http://i.imgur.com/7uTuZ.png
 That's strange. I'm pretty obsessive with keeping my reviews at 0, and never had that problem. My guess is that it's GeekTool being buggy (it is very buggy after all). Do you still have this problem? I would think that after restarting your system the problem would be gone. I've just posted an updated version of the scripts, but I haven't made any fixes in regards to this since I can't reproduce the bug (and I'm guessing that it's a problem with GeekTool).

Also, if anyone notices a problem with the new version (2.0) please tell me. I just made this today, and didn't really have a chance to test it extensively. Thanks!
 \(^O^)/
bk-210 said...
MjTheHunter said... I've been using it for a while and it works 大した, but 今日 I reached 0 reviews and lessons and this happened

http://i.imgur.com/7uTuZ.png
 That's strange. I'm pretty obsessive with keeping my reviews at 0, and never had that problem. My guess is that it's GeekTool being buggy (it is very buggy after all). Do you still have this problem? I would think that after restarting your system the problem would be gone. I've just posted an updated version of the scripts, but I haven't made any fixes in regards to this since I can't reproduce the bug (and I'm guessing that it's a problem with GeekTool).

Also, if anyone notices a problem with the new version (2.0) please tell me. I just made this today, and didn't really have a chance to test it extensively. Thanks!
 \(^O^)/
 How does one upgrade? Or does it happen automatically? 
Rylock said...
bk-210 said...
MjTheHunter said... I've been using it for a while and it works 大した, but 今日 I reached 0 reviews and lessons and this happened

http://i.imgur.com/7uTuZ.png
 That's strange. I'm pretty obsessive with keeping my reviews at 0, and never had that problem. My guess is that it's GeekTool being buggy (it is 中々 buggy after all). Do you still have this problem? I would think that after restarting your system the problem would be gone. I've just posted an updated version of the scripts, but I haven't made any fixes in regards to this since I can't reproduce the 虫 (and I'm guessing that it's a problem with GeekTool).

Also, if anyone notices a problem with the new version (2.0) 下さい tell me. I just made this 今日, and didn't really have a chance to test it extensively. お礼!
 \(^O^)/
 How does 一 upgrade? Or does it happen automatically? 
Unfortunately no. You have to delete all the current Geeklets, download the new zip archive (I changed the link in the original post), and follow the new installation process (I also changed the steps in the original post). I wish I could make it simpler, but there isnt't really a way of doing that with GeekTool.
bk-210 said...
Gera said...
bk-210 said... Note that GeekTool takes about 300 MB of ram, so it might not be the best idea if you're on short on ressources.

Oh my god, what is it, trying to find the last digit of pi in the background? Seriously.
But anyway, good job.
 I know, I thought it was a little ridiculous (but didn't really care since I have tons of ram to spare). Nonetheless, I just did a bit of googling and found out that the GeekTool app has a pretty serious memory leak problem. The good news is that it's only the geek tool app (which is only necessary to add and modify Geeklets) which has a memory leak problem. Once you quit the app and restart your system, the memory usage of the "GeekTool Helper" process goes down to a much more reasonable ~20 MB.
 couldn't you just kill the process instead? much easier than a restart :)

also... any linux or windows version of this?

I excited to use this app.  Unfortunately, I seem to have a problem installing it, namely at step 4.  My machine claims that I don’t have anything (including GeekTool) that can run the Geeklets.  I’m obviously doing something wrong.  Do I need to restart after installing GeekTool?  Any thoughts?

I can develop one for Windows Gadget in a few hours…  if people are interested just tell me =]

EDIT:
ok i made it =P
/t/WaniKani-Gadget-Windows-Gadget/1292/1