A ridiculously complicated world time geeklet
v0.01 - April 13, 2014
Why does this exist?
This applescript was created to try and generate nice looking geeklets.
There is a limitation to the current geektools that only images, plain text or shell commands can be displayed.
A webkit geeklet would be amazing and would remove the need to create an image.
I've tried to use ANSI esccape style formatting, but while that kind of worked, I prefered the look of different fonts on my desktop.
My dirty hack was to generate a nicely styled HTML file. Since that can't be displayed natively, the webkit2png script is used to create a PNG file.
Points of interest
- Save this applescript with your other geeklets
- Modify the place names to the ones of your choice
- Lookup the WOEIDs of these places from [http://isithackday.com/geoplanet-explorer/]
- Lookup the timezones of these places from [http://www.timeanddate.com/library/abbreviations/timezones/] or [http://en.wikipedia.org/wiki/Listoftzdatabasetime_zones]
- Change units to 'f' for farenheiht or 'c' for celsius
Modify the system configuation items as required
- Unless your username is also dan, you will need to change the variable temp_path
Update / Script
- create a shell geeklet on your desktop
- the command is osascript /path/to/worldtime.scpt
- optional: add to a unique group
- update every 300 seconds (5 minutes)
- force refresh of all geeklets
- create an image geeklet on your desktop (800 x 600)
- link to your temppath/tempfile_png
- optional: add to the same unique group
- refresh every 60 s
- make the shell geeklet 1x1 in size to hide it
Styling and formating
Adjust as required. You will need to create ttf versions of your font and place them in stylefontpath. See the below section on Fondu for more information.
There are only two external required dependencies (other than geektools), curl and webkit2png. Fondu is also helpful. All can be acquired from homebrew.sh
To install Homebrew (a *nix package manager for OSX) run:
$ ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
To install curl:
$ sudo port install curl
To install webkit2png run:
$ sudo port install webkit2png
To install fondu run:
$ sudo port install fondu
To convert font, go to the Font directory
$ sudo fondu fontname.ext (HelveticaNeue.dfont in my case)
Then copy the new set of ttf files to your stylefontpath
That's it. I've tried to explain what I have done by commenting through out my code.