Pimp My Desktop using GeekTool

Share on facebook
Share on twitter
Share on linkedin

Because there are so many sites out there that try and teach Bash scripting and how to do all the stuff inside it, I’m only going to continue from here by showing what each of my scripts looks like.  The processes, network traffic and uptime scripts were borrowed in their original form from the Geeklets list on Mac OS X tips.  Credit for those must go to the original authors.  Here are the scripts:

date ‘+%H:%M’

CPU Usage:

top -l 1 | awk '/CPU usage/ {print "u:", $3, "s:", $5, "i:", $7}’

Day, date, temperature & humidity:

# day
_day=`date +%a | tr '[:lower:]' '[:upper:]'`

# degrees symbol: ˚

# get the temperature and humidity and write them to a temporary file
~/_Applications/lynx/lynx -dump http://www.bom.gov.au/vic/observations/melbourne.shtml | awk '/[36]Melbourne/ { print $3 }; /[36]Melbourne/ { print $6, "%"; };' > /tmp/weather-temp

_temp=`sed -n 1p /tmp/weather-temp`
_humidity=`sed -n 2p /tmp/weather-temp`

# month
_month=`date +%b`
_date=`date +%d`

# do some checks to make sure data returned for the checks that require an internet connection
if [[ -z $_temp ]]; then
	_temp="-"
fi
if [[ -z $_humidity ]]; then
	_humidity="-"
fi

echo "$_dayttt`echo $_temp | tr -d " "` C"
echo "$_month $_datet`echo $_humidity | tr -d " "` HUMIDITY" | tr '[:lower:]' ‘[:upper:]’

Disk space:

df -hl | grep 'disk0s2' | awk '{print "t:", $2, "f:", $4, "p:", $5; }'

Memory usage:

top -l 1 | awk '/PhysMem/ {print "u:", $8, "f:", $10}'

The "Start Teh Music …" widget you see next to the dock is created by Bowtie, definitely the best iTunes notification/info widget app out there.  It will change to show the title and artist of the track that’s currently playing, once one starts.  I’ve got the Aussie V8 Supercars on the T.V. right now … no music needed.  🙂

Here’s the same desktop again, this time labelled so that you know where each script is (click for larger version).

My GeekTool Desktop - Labelled
My GeekTool Desktop – Labelled

Granted, my choice of system info, fonts, colours etc is fairly boring and minimal compared to some but they give me what I need without destroying what I reckon is one of the best desktop background images I’ve ever found.