I use GT and AppleScript to only display some work-related stuff when I'm at work. You can watch a video and check out the AppleScript I use here, on my website!
Weather:
Uses two scripts: Weather Icon Curl, and Weather Icon Display.
The "Weather Icon Curl" script curls a page from yahoo weather (I'm in Baltimore, but you just have to replace one URL in the script with the appropriate URL for your area to make it work)
I use this URL http://weather.yahoo.com/united-states/maryland/baltimore-2358820/, then the script will download the page, parse it for the icon used, and download that.
The "Weather Icon Display" script then displays the previously curl'd icon.
Weather Icon Curl: curl -o /tmp/weather.html http://weather.yahoo.com/united-states/maryland/baltimore-2358820/; curl -o /tmp/currenttemp.png `grep "div class="forecast-icon" style="background:url" /tmp/weather.html | awk -F"'" '{ printf $2 }'`
Weather Icon Display: Displays /tmp/currenttemp.png
Remote Office Ping
Uses a total of 6 scripts. One to display all of the office locations, and one script for each location's pings response time.
This is a bit more complex. I used one script ("Remote Office Labels") to display each remote office location. Then I used a separate script for each location's ping ("Remote Office Ping"). It pings a router in each office 10 times ever 5 minutes, averages the pings, and displays the average. The tricky part is that I only display this script when I'm on my work network.
Remote Office Labels: echo "Toronto:rDenver:rLos Angeles:rAmsterdam:rHong Kong:"
Remote Office Ping: HOST=*Remote IP*
ping -q -c 10 $HOST | grep "round-trip" |sed 's/// /g' | awk '{print $8}' | awk '{printf("%dn",$1 + 0.5);}'
Screenshots
Example:
Setup:


Comments