Page 1 of 2
 1  2  >
Reply
   
 Learning to love GeekTool - A primer (Part 1) 
 
 
  #1 (permalink)  
Old 20-09-2008, 01:34 AM
Member

Group: Regulars
Location: Neuchatel, Switzerland


Learning to love GeekTool - A primer (Part 1)

For a while now I have been enjoying the benefits that Geek Tool provides in terms of embedding little bits of information on your desktop. Along with displaying information it also gives you the ability to sex up your desk top a bit and make it look truly unique.

I wanted to share some of my experiences with fellow MacTalkers and spread the Geek Tool love. Questions and comments are welcome

What is Geek Tool?

GeekTool is a PrefPane (System Preferences module) for Panther, Tiger or Leopard to show system logs, unix commands output, or images (i.e. from the internet) on your desktop (or even in front of all windows).

It has three types of modes or types of information you can display. You can use File mode to monitor MacOS X activity with /var/tmp/console.log or /var/log/system.log, or Shell mode to launch custom scripts or commands like "df" to check space left on filesystems, "uptime" to monitor load of your machine. Finally, Image mode helps you monitor bandwith usage, CPU loads, memory availability of your server, via tools like MRTG or RRD.

Where can I get it?

Tynsoe projects

How does it install?
As mentioned above it installs as a preferance pane and is easily deleted by right clicking and removing.


OK....so what can I do with it?

The best way to show its usefulness is to show you my desktop and explain how some the items were made. With a basic knowledge of unix commands you can easily create great looking desktops in GeekTool.

Let's look at a screen:
Click the image to open in full size.

On the left hand side there is information about connectivity to the network, uptime, ram usage, cpu usage and disk info. In the lower left corner, 3 panels showing top 10 apps by RAM, CPU and Process time.

In the center is a dump of the system log.

The right hand side has a embedded image showing weather radar and a small ascii calendar.

Hmmm....my geekness has been stimulated....go on...

Let's break each element down. I assume by this stage you have eagerly downloaded GeekTool and want to explore some geek goodness.

Display Your Computer’s Uptime And Total CPU/Memory Usage

The Uptime, RAM and CPU usage were made by selecting the Shell type from the dropdown and using this code:
Code:
uptime | awk '{print "UPTIME : " $3 " " $4 " " $5 }' | sed -e 's/.$//g'; 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}'
The result should give you this:
Click the image to open in full size.

Display Drive Info

To display File system (drive) info, create another Shell type entry and use the following code:
Code:
df -H -l
You should have something like this displayed:
Click the image to open in full size.

Display IP Address and Network Info

The IP address and network display requires a bit of trickiness. There may be an easier way (suggestions always welcome) but in this method we create a script file and then refer to it in GeekTool.

We need to create a file named ipadd.bash
Create it anywhere convenient and then, in Terminal use chmod to make it executable by navigating in Terminal to the folder with the file and typing chmod 755 ipadd.bash
The file needs the following code pasted into it:
Code:
#! /bin/bash 
myvar1=`system_profiler SPAirPortDataType | grep -e "Current Wireless Network:" | awk '{print $4}'`
myvar2=`system_profiler SPAirPortDataType | grep -e "Wireless Channel:" | awk '{print $3}'`

echo "External :" `curl -s http://checkip.dyndns.org/ | awk '{print $6}' | cut -f 1 -d "<"`
myen0=`ifconfig en0 | grep "inet " | grep -v 127.0.0.1 | awk '{print $2}'| grep -v inet`

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}'| grep -v inet`

if [ "myen1" != "" ]
then
echo "AirPort  : $myen1 [$myvar1 : CH.$myvar2]"
else
echo "Airport  : INACTIVE"
fi
Now in GeekTool create a new Shell entry and type the following (replace the path with your path info to the file.
Code:
bash /Users/jvl_iMac/bin/ipadd.bash
Your result should like this:
Click the image to open in full size.


Part 2 coming soon.....please let me know if this sparked anybody's interest.
TigersharkBAS is online now
Profile CardPM
Go to the top of the page
Reply With Quote
  #2 (permalink)  
Old 20-09-2008, 07:11 AM
Beware the Robot Mafia

Group: Administrators
Location: St. Albans, Melbourne
Blog Entries: 9


Pretty snazzy
__________________
Support MacTalk by shopping the Apple Online store via this link!
HEY INTERNET! - My Internet scrapbook.
TechieTalk - My 2c on Australian Tech News.
DMG Control Mac Apps - One More Thing Hardware Reviews - Can Touch This iPhone Apps
decryption is offline
Profile CardPM
Go to the top of the page
Reply With Quote
  #3 (permalink)  
Old 20-09-2008, 07:15 AM
Regular

Group: Regulars
Location: Brisbane


What is that weather thing on the bottom right and how to create one ?
scokim is offline
Profile CardPM
Go to the top of the page
Reply With Quote
  #4 (permalink)  
Old 20-09-2008, 07:50 AM
Regular

Group: Regulars
Location: Rosebud. Victoria, Australia


Interest officially sparked... geek me!
__________________
Suffering another bout of Apple Anticipation Anxiety syndrome... but doesn't everyone?

Just a three figure post count punk.
meinrosebud is offline
Profile CardPM
Go to the top of the page
Reply With Quote
  #5 (permalink)  
Old 20-09-2008, 07:58 AM
Regular

Group: Regulars
Location: Sydney


insanely awesome, what about one for running process's?
__________________
My Blog | My .Mac

I own: PBG4 1.67 Ghz, Mac Mini 2.0 Ghz Intel Core 2 Duo, XBOX360 (Gamer Tag: LANPup), iPhone 3G,Wii.
landog is offline
Profile CardPM
Go to the top of the page
Reply With Quote
  #6 (permalink)  
Old 20-09-2008, 08:16 AM
Regular

Group: Regulars
Location: Berkeley, California USA


I've been using Geektool for a few years and find it incredibly useful, perhaps even indispensable. Though I've grown bored with all sorts of process / CPU / uptime / temperature / network info widgets on my desktop, I still find a bandwidth monitor for my colocated Xserve essential. Basically, I use bmon on the Xserve and have a shell script using lynx, a CLI text brower to dump the bmon bandwidth graphs and Geektool updates those graphs every few seconds making them, in effect, live.

There are tons of Geektool ideas here:

macosxhints.com - GeekTool - Useful and fun info on the desktop

Dave
macdave is offline
Profile CardPM
Go to the top of the page
Reply With Quote
  #7 (permalink)  
Old 20-09-2008, 11:14 AM
Regular

Group: Regulars
Location: Melbourne


Dave, does it still die in a hole on machines with dual displays? last time i used it under 10.5 on a dual display machine it was horrific.
blakat is offline
Profile CardPM
Go to the top of the page
Reply With Quote
  #8 (permalink)  
Old 20-09-2008, 12:19 PM
Regular

Group: Regulars
Location: Berkeley, California USA


Quote:
Originally Posted by blakat View Post
Dave, does it still die in a hole on machines with dual displays? last time i used it under 10.5 on a dual display machine it was horrific.
blakat -

I haven't used Geektool for ages on dual monitors, but just set it up quickly on my second Mac Pro driving dual Apple 20" Cinema Displays with a 7300 GT. It seems fine. Sophie Marceau seems to agree. =)

Dave
macdave is offline
Profile CardPM
Go to the top of the page
Reply With Quote
  #9 (permalink)  
Old 20-09-2008, 12:31 PM
Member

Group: Member
Location: Melbourne


I use GeekTool to run a few Applescripts.

One is to show me what's playing in iTunes:
Click the image to open in full size.

And the other two show me my current 3 usage [need to fix up the applescript because I coded it badly, hence the (2MB rem.) instead of the actual amount]:

Click the image to open in full size.

And my current Bigpond usage:

Click the image to open in full size.
harrisonx is offline
Profile CardPM
Go to the top of the page
Reply With Quote
  #10 (permalink)  
Old 20-09-2008, 12:48 PM
Member

Group: Regulars
Location: Perth, Western Australia


This is great!
I am interested!
gregh is offline
Profile CardPM
Go to the top of the page
Reply With Quote
  #11 (permalink)  
Old 20-09-2008, 12:58 PM
Regular

Group: Regulars
Location: Through the Looking Glass


Have a look at networksetup as a way of getting network information.

NAME
networksetup -- configuration tool for network settings in System Preferences.
vecsty is offline
Profile CardPM
Go to the top of the page
Reply With Quote
  #12 (permalink)  
Old 20-09-2008, 01:03 PM
Regular

Group: Regulars
Location: Melbourne


Quote:
Originally Posted by macdave View Post
blakat -

I haven't used Geektool for ages on dual monitors, but just set it up quickly on my second Mac Pro driving dual Apple 20" Cinema Displays with a 7300 GT. It seems fine. Sophie Marceau seems to agree. =)

Dave
Cool, previously after initial setup on dual displays if you went back in to edit stuff all the preferences were b0rked. time to play again
blakat is offline
Profile CardPM
Go to the top of the page
Reply With Quote
  #13 (permalink)  
Old 20-09-2008, 05:23 PM
Member

Group: Regulars
Location: Neuchatel, Switzerland


I'll get part 2 up today guys.....which will explain the process monitor, calendar and weather image....which is not as fancy as yu might think.

Thanks for the interest.
TigersharkBAS is online now
Profile CardPM
Go to the top of the page
Reply With Quote
  #14 (permalink)  
Old 20-09-2008, 05:24 PM
Member

Group: Regulars
Location: Neuchatel, Switzerland


Quote:
Originally Posted by harrisonx View Post
I use GeekTool to run a few Applescripts.

One is to show me what's playing in iTunes:
Click the image to open in full size.

And the other two show me my current 3 usage [need to fix up the applescript because I coded it badly, hence the (2MB rem.) instead of the actual amount]:

Click the image to open in full size.

And my current Bigpond usage:

Click the image to open in full size.
Hey Harrison,
Do you think you post the Applescript or upload the files somewhere for other folks. I could reference them in Part 2 (with full cred of course :-)
TigersharkBAS is online now
Profile CardPM
Go to the top of the page
Reply With Quote
  #15 (permalink)  
Old 20-09-2008, 07:04 PM
Regular

Group: Regulars
Location: Melbourne


Awesome, have been using GT for a while now displaying iTunes and Cal. Am going to broaden this now though.
Quick Q - I like to keep my desktop framed - http://img.skitch.com/20080920-khh7c...1kf8xrg4u8.jpg - but problem is, when i use the up shell, it doesn't look the greatest for the CPU usage: is there anyway I can make it so it just shows me how much CPU is used and that is it? No system, idle, user?

Also, is there any other way I can prevent the text from wrapping mid word? And, can I make a script that will just tell me the date: Saturday, September 20, 2008 - instead of Cal?
__________________
 MacBook 2.16/2gb/120gb/White •  iPhone White 16gb (Optus Cap) •  iPod U2 SE Colour 20gb •  iPod Shuffle 2g • twitter
successful trades - huy x2, harryb2448, ken.

Support MacTalk by shopping the Apple Online store via this link!

Last edited by dinoo; 20-09-2008 at 07:32 PM.
dinoo is offline
Profile CardPM
Go to the top of the page
Reply With Quote
 
Page 1 of 2
 1  2  >
Reply

Thread Tools

 
Similar Threads
 
Thread Thread Starter Forum Replies Last Post
Why do we love mac? 4 reasons? iaakuza Apple General 26 03-10-2007 08:03 AM
Do you love editing too? cosmichobo Projects: Audio, Graphics, Video, HTPC and Programming 15 21-07-2007 08:58 AM
I Love Lamp 2.1, groovier than ever marc iSlayer.com and Bjango Support & Discussion 26 13-07-2007 11:15 AM