June 27, 2009 at 9:52 PM by Dr. Drang
Jan 25, 2017 Collections Free geektool geektool scripts mac scripts. 25 great free resources for. Ways to Make Your Mac's Desktop Better with Geek. Tool is an amazing free app that is a bit like Dashboard for the super nerdy. The desktop is very simple and doesn't take a lot of resources—consisting of nothing more than a number of GeekTool scripts to put system information on the desktop. The full list includes: Airport. This is the little brother in the Geeklet family, but very powerfull. If you are not happy with the Script Geeklet, Web will unleash your creativity. It works the same way, but instead of just text, you display a full web page, or generate your own HTML code using your own script. GeekTool by Tynsoe.org is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. Mega Roundup of GeekTool Scripts on Francesco Mugnai's blog (which contains links to many other sites). In the video, I show one GeekTool entry that displays my external IP address, which can be. Mega Roundup of Geektool scripts + inspiration gallery. « Blog of Francesco Mugnai. November 3, 2010 Hey.
Update 7/29/09
The current pywapi.py
, version 0.2.1, has the bug fix described in this post, so there’s no need to edit it. Just install it as is using setup.py
, and the weathertext
script will work fine.
I like having GeekTool display the current weather on my desktop, and I’ve written a script that gets the information from a NOAA website and formats it for GeekTool. Now there’s a new Python weather library, called pywapi
, that simplifies the process of getting the data and extends it beyond just NOAA’s weather stations. I’ve rewritten my GeekTool script to use this new library.
The pywapi
library is the creation of Eugene Kaznacheev. It provides a simple Pythonic interface to weather data supplied by
Google doesn’t have a weather page, per se, but it does provide weather info through an API. The Gismeteo service is in Russian, so I can’t give any advice on using it.
The current version of pywapi
, version 0.2.0, has a bug that causes it to fail when accessing NOAA data. Fortunately, this bug is easy to fix before installation. I’ve described the bug and provided my fix on the pywapi
Issues page—perhaps the fix will be rolled into the official pywapi
distribution soon. Until then, follow these instructions to get a working version of pywapi
:
Download the tarball to a convenient location and extract the code. Open the pywapi.py
file and scroll to the bottom of the get_weather_from_noaa
function. Change this code
to this
The original code only works if NOAA is returning every bit of information in the data_structure
tuple. As it turns out, sometimes NOAA stations don’t report wind gust, wind chill, or heat index values. In those situations, the original code fails when the get_weather_from_noaa
function is called. The revised code succeeds regardless of whether the data are reported or not.
After saving the edited file, execute
from the command line, give your administrator password at the prompt, and the pywapi
library will be installed in /Library/Python/2.5/site-packages
directory.
To see what kind of data are available from the different services, open the examples
directory in the pywapi
distribution and try them out. Here’s pywapi-google-example.py
, modified to return values for my town rather than New York:
The modification is on Line 5, where I’ve changed the argument to my zip code. The output looks like this
It’s a multi-level dictionary, from which you can pluck the current conditions and the forecast for the next few days.
Tool Geek
Similarly, if I modify pywapi-yahoo-example.py
to
in which the arguments in Line 5 have been changed to my zip code and an empty string to give the Naperville results in US customary units. Running this example script yields
which is another multi-level dictionary with similar information. Yahoo! gives sunrise and sunset times, which Google doesn’t, but Yahoo’s forecasts only include today and tomorrow.
Here’s pywapi-noaa-example.py
after my modification:
Geektool Scripts
The argument in Line 5 is the code for the NOAA station at the Aurora airport west of Naperville. Finding the best NOAA station isn’t as easy as just entering your zip code, but if you go to this NOAA page, you can find it pretty quickly.
The output from pywapi-noaa-example.py
is
which is a simple dictionary with only current conditions, no forecasts. Still, I like the NOAA data set because it includes, when appropriate, the wind gust speed and heat index, items that neither Google nor Yahoo! provide.
So here’s my new GeekTool weather script, called weathertext
:
At the moment, it’s basically a rewrite of my previous GeekTool weather script, using the clean pywapi
calls instead of a kludgy series of regular expressions to pull the desired information out of the NOAA results. I’ll probably add to it, gathering bits from the Google or Yahoo! results and mixing them into the output. I have GeekTool set up to display the output of weathertext
—which I’ve made executable and keep in a “bin” directory in my home folder—in the lower left corner of my screen.
Geektool Scripts Tutorial
I have the temperature at the bottom because it’s the most important item and putting it at the bottom makes it the most likely to be visible.
Rawr Hub Script
Geektool Geeklets
Update 7/2/09
I’ve made some minor changes to weathertext
since writing this post. Rather than updating the post every time I make a change, I’ve set up a GitHub repository where you can always download my latest version.