Categories

Twitter

Support

Adium Boxee BBEdit Coda Alfred HandBrake ScreenFlow Caffeine Moom Evernote Pixelmator SecureFiles TextWrangler Transmit Shimo RapidWeaver VLC Dropbox Steam Spotify Acorn VMware Fusion Unison

Entries in GeekTool (1)

Friday
Jun192009

Setup GeekTool for Mac

Every true Mac geek should know about GeekTool. GeekTool is a Mac preference pane application that allows you to display information about your Mac on your desktop. Its possible to monitor shell script output, images, weather, iTunes library and even entire files all automatically (and in a way that any Mac/Linux geek will love).

GeekTool has three basic inputs - shell script, text files or images. Shell script is definitely the most powerful and probably where you will do most of the configuration. For those who are a little lost, shell script is code written for the shell, or command line interpreter, of a UNIX based operating system (like OS X).

First, download GeekTool and install. Once complete the GeekTool preference pane can be found in "System Preferences" under "Other".

To start, select "New Entry" and "Shell" from the drop down menu. You can also rename the new entry by clicking on it in the "Groups" section on the left of the GeekTool preference pane.

Now you can add a new script to run under "Command" (see below for example scripts). Once complete, specify the colors, fonts and text that best suit your desktop. Finally specify a location for the output using the x/y coordinates in the bottom right corner of the GeekTool preference pane.

To add additional features simply click "New Entry" and re-complete the above process.

 

Example GeekTool Shell Scripts

Monitor Processes (including individual CPU and memory usage):

top -ocpu -FR -l2 -n20 | grep '^....[1234567890] ' | grep -v ' 0.0% ..:' | cut -c 1-24,33-42,64-77

Mac Uptime and Overview CPU/Memory Usage:

uptime | awk '{print "UPTIME : " $3 " " $4 " " $5 " " }'; top -l 1 | awk '/PhysMem/ {print "RAM : " $8 " "}' ; top -l 2 | awk '/CPU usage/ && NR > 5 {print $6, $7=":", $8, $9="user ", $10, $11="sys ", $12, $13}'

External IP address:

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

Current Whether:

curl --silent "http://xml.weather.yahoo.com/forecastrss?p=YOURCITYCODE&u=c" | grep -E '(Current Conditions:|C<BR)' | sed -e 's/Current Conditions://' -e 's/<br \/>//' -e 's/<b>//' -e 's/<\/b>//' -e 's/<BR \/>//' -e 's/<description>//' -e 's/<\/description>//'

Replace the "YOURCITYCODE" with the code for your city found in the URL of Yahoo Whether.