Geektool Setup

After reading a Lifehacker article this last week, I discovered and dived into a Mac app called GeekTool. Similar to Rainmeter for the PC, "GeekTool is a PrefPane (System Preferences module) for Panther or Tiger to show system logs, unix commands output, or images (i.e. from the internet) on your desktop (or even in front of all windows)."

I got a few scripts from Nicinabox, a few from IamAwesome, and the rest were either grabbed from other sites or I wrote them myself.

NOTE: A few of these scripts require Lynx - a text-only web browser.

Here's the current setup:

And here are the details:

Background by tonyxprice

Font: Century Gothic

Scripts:

FullTime
date "+%l:%M:%S %p"

Day
date "+%d"

Month
date +%B

Day of Week
date +%A

CPU
top -l 1| awk '/CPU usage/ {print $8, $9}'
top -l 1| awk '/CPU usage/ {print $10, $11}'
top -l 1| awk '/CPU usage/ {print $12, $13}'

Memory
top -l 1 | awk '/PhysMem/ {print "Used: " $8 " \nFree: " $10}'

Network
myen0=`ifconfig en0 | grep "inet " | grep -v 127.0.0.1 | awk '{print $2}'`

if [ "$myen0" != "" ]
then
echo "Ethernet: $myen0"
else
echo "Ethernet: INACTIVE"
fi


myen1=`ifconfig en1 | grep "inet " | grep -v 127.0.0.1 | awk '{print $2}'`


if [ "$myen1" != "" ]
then
echo "Airport: $myen1"
else
echo "Airport: INACTIVE"
fi


wip=`curl --silent http://checkip.dyndns.org | awk '{print $6}' | cut -f 1 -d "<"`
echo "External: $wip"

Weather Temp
lynx -dump http://printer.wunderground.com/auto/printer/CA/YOURCITY.html |awk '/Temp/{printf $2, ": "; for (i=3; i<=3; i++) printf $i " " }'

Weather Conditions
lynx -dump http://printer.wunderground.com/auto/printer/CA/YOURCITY.html|awk '/Cond/ && !/Fore/ {for (i=2; i<=10; i++) printf $i " " }'

Weather Sunrise
curl http://m.wund.com/US/CA/YOURCITY.html | grep 'Sunrise' | sed -e :a -e 's/<[^>]*>//g;/</N;//ba' | sed -e 's/Sunrise/Sunrise: /g' | sed -e 's/PST//g'

Weather Sunset
curl http://m.wund.com/US/CA/YOURCITY.html | grep 'Sunset' | sed -e :a -e 's/<[^>]*>//g;/</N;//ba' | sed -e 's/Sunset/Sunset: /g' | sed -e 's/PST//g'

Weather Forecast
curl --silent "http://xml.weather.yahoo.com/forecastrss?p=YOURZIP&u=f" | grep -e "Forecast:" -A 2 | tail -n 2 | sed -e 's/<br \/>//' -e 's/<BR \/>//' | sed "s/\(.*\)\.\ \(.*\)/\1\?\2/" | tr "?" "\n" | sed "s/High\:\ \(.*\)\ Low\:\ \(.*\)/\?H\: \1\ L\:\ \2/" | sed "s/\?\(.*\)/\\1/"

PHP Scripts
(placed in ~/Sites/)

Weather Image:
(Be Sure to replace CITYDATA in $url with your own city from Yahoo)

<?php
$url="http://weather.yahoo.com/forecast/YOURCITYCODE.html";


$ch = curl_init();
$timeout = 0; // set to zero for no timeout
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$file_contents = curl_exec($ch);
curl_close($ch);

$divStart = "<div class=\"forecast-icon\"";
$strEnd = "'); _background-image/* */: none;";
$start = strpos($file_contents, $divStart) + 50;
$end = strpos($file_contents, $strEnd);
$length = $end-$start;

$imagepath=substr($file_contents, $start , $length);
$image=imagecreatefrompng($imagepath);

imagealphablending($image, true);
imagesavealpha($image, true);
header('Content-Type: image/png');
imagepng($image);
?>


Gmail

(Be Sure to replace USERNAME and PASSWORD with yours from gmail)
<?php
$url = 'https://USERNAME:PASSWORD@mail.google.com/mail/feed/atom';
$buffer = file_get_contents($url);
$xml = new SimpleXMLElement($buffer);
echo $xml->fullcount . " unread\n";

foreach($xml->entry as $entry){
echo $entry->title . " (from: " . $entry->author->name . ")\n";
}
?>

Loading mentions Retweet
Filed under  //  desktop   geektool   image   mac   tech   weather  
Comments (0)
Posted 8 months ago

I'm a PC. And I'm miserable.

i'm a PC - and i do boring, ordinary, every day things.  please make me an operating system that works like I do.  make it boring, ordinary, and lacking in innovation. oh, and let is SHRED my hard drive on startup, too...i LOVE that. oh, i almost forgot! could you make it somewhat stable until about 3 months of heavy usage -- then let all the applications start colliding in registry hell. oh and let it take 5-10 minutes to boot up then, too. that'll give me time to drink the crappy office coffee before i can actually do any work

Loading mentions Retweet
Filed under  //  computers   mac   pc   ramblings   tech  
Comments (0)
Posted 1 year ago

San Francisco Wifi

while cruising from the SFO airport to our SF office in the financial district, my EVDO card had a freak out. i was right in the middle of sending an important email, so i decided to see what my wifi card would bring me.

i remember some article back in the day about possible city-wide wifi in San Fran -- I guess that never happened. However, what was incredible was the amount of wireless networks filling up my list as I drove through the city. I'm sure there are places in downtown with a higher concentration, but this was by far the most i'd ever seen in my list:

Loading mentions Retweet
Filed under  //  evdo   mac   ramblings   san francisco   wifi  
Comments (0)