I'm just going to write up a little guide for any beginners to Geektool who may want to have this on their desktop
Image
Watch this
video first, if your completely new to geektool
The First thing you'll need is the background which you can download
here
Save the background image in a folder where you'll remember it is
Then to place the image onto your desktop just drag the image icon from Geektools preference pane on to your desktop
Image
and then specify the location of the image inside the box above [set local path].
Image
(or you could just click the button and find the image when the pop up box appears)
Now you should have the HTC background on your desktop
Image
Place this anywhere on your desktop where you want the Geeklet to sit.
All the next commands are Shell commands.
Next thing to add would be the Hour and Minute.
Hour
Image
Minute
Image
Quick Tip: Make sure you use the center alignment on these two to make sure they stay in the middle of the white boxes
The City name is just a simple echo which just displays any text you want it to. So in this case...
Image
Code:
[B]echo [I]YOURCITYNAME[/I][/B]
On the other side we have the day, month and date.
Image Use this Script:
Code:
[B][I]date +'%A, %b %d'[/I][/B]
Image The script for this is:
Lay these little geeklets over your background in whichever way you want. It doesnt have to be the way I have it here
To get the weather for your city you need to first head over to
Yahoo Weather and do a search for your city. Copy and save the URL for your city as you'll need it later.
Then, whilst on the page for your city's weather, hit the RSS button and the page will change to a feed page. In the URL for this page you'll see a code thats all in uppercase. Thats your city code. Copy and save this next to your city URL as you will need this later aswell.
To get the current weather for your location
Current Weather Conditions
Image You'll need this script:
Code:
[B][I]curl --silent "http://weather.yahooapis.com/forecastrss?p=YOURCITYCODE&u=c" | grep -E '(Current Conditions:|[A-Z]<BR)' | sed -e 's/Current Conditions://' -e 's/<br \/>//' -e 's/<b>//' -e 's/<\/b>//' -e 's/<BR \/>//' -e 's/<description>//' -e 's/<\/description>//' -e 's/, [0-9]* [A-Z]//' | tail -n1[/I][/B]
Where it says YOURCITYCODE enter the uppercase code you found for your city previously.
To get the Temperature,
Image Use this script:
Code:
[B][I]curl --silent "http://xml.weather.yahoo.com/forecastrss?p=UKXX0085&u=c" | grep -E '(Current Conditions:|[A-Z]<BR)' | sed -e 's/Current Conditions://' -e 's/<br \/>//' -e 's/<b>//' -e 's/<\/b>//' -e 's/<BR \/>//' -e 's/[A-Z a-z]*, //' -e 's/\(.*\) F/\1 °F/' -e 's/\(.*\) C/\1 °C/' | sed 's/ //' | tail -n1[/I][/B]
The Next day Forecast,
Image Use this script:
Code:
[B][I]curl "http://xml.weather.yahoo.com/forecastrss?p=YOURCITYCODE&u=c" | grep -e "Forecast:" -A 2 | tail -n 2 | sed -e 's/<br \/>//' -e 's/<BR \/>//' | sed "s/\(.*\)\.\ \(.*\)/\1\?\2/" | tr "?" "\n" | sed "s/Hi\:\ \(.*\)\ Lo\:\ \(.*\)/\?Hi\: \1\ Lo\:\ \2/" | sed "s/\?\(.*\)/\\1/"[/I][/B]
Again use the city code in place of YOURCITYCODE within each of the above scripts
To get the image for the weather for your city,
Image Use this script:
Code:
[B][I]curl --silent "WEATHER URL FROM YAHOO/" | grep "forecast-icon" | sed "s/.*background\:url(\'\(.*\)\')\;\ _background.*/\1/" | xargs curl --silent -o /tmp/weather.png\[/I][/B]
Paste the URL you saved of your city's weather in place of " WEATHER URL FROM YAHOO" The geeklet will be blank after youve done, but don't worry thats normal.
To get the image to show up on your desktop use this script:
Code:
[B][I]file:///tmp/weather.png[/I][/B]
Now it's just a matter of placing everything the way you like it. Don't forget you can change the font style and sizes to whatever you prefer.
Once you've done that you just need to overlay the numbers with a set of separators to really finish it off.
Image
You can download it from
here
All you need to do with this is place it on your desktop as an image command in the same way you did with the background image. Only, for THIS image you have to do it twice using the same Separator image and place it over both the Hour and minute numbers. This gives the numbers a bit of shine and depth to really top it of.
Just wanted to say a big thank you to everyone in this thread. I couldnt have done any of it without the scripts you clever people have so generously shared.
I hope you find this guide useful
Jai.