GeekTool: What Is It, How Do I Get It, What Do I Do With It?

Joined
Oct 3, 2009
Messages
2,641
Reaction score
26
Points
48
Location
Albuquerque, New Mexico
GeekTool: What Is It, How Do I Get It, What Do I Do With It?


A very good question (or three).

GeekTool is a simple overlay using command line to create overlays. It's real simple if you know command line, and can be difficult if you don't know much. But, here's a few tidbits.


GeekTool can be found at Tynsoe projects

GeekTool, which appears like so on the left side:

cleaner.png



..uses Terminal commands. Like cal- which displays the calendar.

There are tons of sites on the web (a Google search will turn up a good selection) which will offer tips and actual code lines for you to use. GeekTool, once you have downloaded and installed it, can be found as a System Preference pane, at the bottom.

Just one more thing- don't forget to post your screenshots! ;D



[Note to Admin: Please Sticky this as an FAQ for beginners. Feel free to re-word this as necessary.]
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
If you're going to use cal with GeekTool, try using the Courier font with that shell script as it appears to be the only one that aligns the dates with the names of the date. I'll post a picture of my desktop when I get home to demonstrate what I mean. You can see what I mean in the example above though.

EDIT: Here is what I mean - look at this cal (using the Courier font) and look at the one in the sample you provided. Courier is the only font I've found so far that aligns the headers (days) and dates properly.

cal_geektool.png
 
OP
C
Joined
Oct 3, 2009
Messages
2,641
Reaction score
26
Points
48
Location
Albuquerque, New Mexico
If you're going to use cal with GeekTool, try using the Courier font with that shell script as it appears to be the only one that aligns the dates with the names of the date. I'll post a picture of my desktop when I get home to demonstrate what I mean. You can see what I mean in the example above though.

EDIT: Here is what I mean - look at this cal (using the Courier font) and look at the one in the sample you provided. Courier is the only font I've found so far that aligns the headers (days) and dates properly.

cal_geektool.png

I see. I have a hard time seeing the courier font in GeekTool, but I guess it can be bolded.
 
Joined
May 19, 2009
Messages
8,428
Reaction score
295
Points
83
Location
Waiting for a mate . . .
Your Mac's Specs
21" iMac 2.9Ghz 16GB RAM - 10.11.3, iPhone6s & iPad Air 2 - iOS 9.2.1, ATV 4Th Gen tvOS, ATV3
Just to add a couple to to start a list ....


Memory : top -l 1 | awk '/PhysMem/ {print "Used: " $8 " Free: " $10}'
CPU Usage : CPU -
echo CPU usage
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}'
Uptime : uptime | awk '{sub(":", "h ", $3); sub(",", "min", $3); print "Time since last system boot: " $3}'
(results in 14h 23min)
Time : "date +"%I:%M %p"
(which results in 11:30 pm)
Date : "date +"%A %d %b"
(which results in Monday 12 June)

This is a good idea Chris.H +1 rep. I always go over to MacRumors as they have a whole thread pertaining to setting up GeekTool ....
Lets see where it goes :)

Cheers
 
Joined
May 14, 2009
Messages
2,052
Reaction score
136
Points
63
Location
Near Whitehorse, Yukon
Your Mac's Specs
2012 MBP i7 2.7 GHz 15" Matte - 16 GB RAM - 120 GB Intel SSD - 500 GB DataDoubler Mac OS 10.9
All Mono-spaced fonts will display correctly in GeekTool.
Mono-spaced are all fonts that take up the same amount of space in a horizontal space.
Samples of monospaced typefaces - Wikipedia, the free encyclopedia

Internal and external IP addresses.

Code:
#External IP:

echo "External IP: " `curl --silent http://checkip.dyndns.org | awk '{print $6}' | sed "s/\(.*\)\<\/body\>\<\/html\>/\1/"`



#Internal IP (AirPort Only):

echo "Internal IP: " `ifconfig en1 | grep inet | grep -v inet6 | awk '{print $2}'`
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
That internal one is only going to work if you're using the en1 device. On my MB (and I imagine all other notebooks), en1 is Airport. If you're using wired, that won't work.
 
Joined
Sep 4, 2009
Messages
137
Reaction score
1
Points
18
Not much of a programer here not sure where to enter the script for something to work or show up on the desktop.
 
Joined
May 14, 2009
Messages
2,052
Reaction score
136
Points
63
Location
Near Whitehorse, Yukon
Your Mac's Specs
2012 MBP i7 2.7 GHz 15" Matte - 16 GB RAM - 120 GB Intel SSD - 500 GB DataDoubler Mac OS 10.9
What code are you trying to use?
Would you mind posting it here?
 
Joined
May 14, 2009
Messages
2,052
Reaction score
136
Points
63
Location
Near Whitehorse, Yukon
Your Mac's Specs
2012 MBP i7 2.7 GHz 15" Matte - 16 GB RAM - 120 GB Intel SSD - 500 GB DataDoubler Mac OS 10.9
Strange it just works here. Are you using an Ethernet connection?
And can you post a screenshot of the red light, I have never seen it so I don't know what that could mean.
 
Joined
Sep 4, 2009
Messages
137
Reaction score
1
Points
18
Strange it just works here. Are you using an Ethernet connection?
And can you post a screenshot of the red light, I have never seen it so I don't know what that could mean.

no ethernet

are you pasting the whole content of the script?
 
Joined
May 14, 2009
Messages
2,052
Reaction score
136
Points
63
Location
Near Whitehorse, Yukon
Your Mac's Specs
2012 MBP i7 2.7 GHz 15" Matte - 16 GB RAM - 120 GB Intel SSD - 500 GB DataDoubler Mac OS 10.9
Oh! I see what your problem is! When you try to download a geeklet you have to right click on the download link and do "Save linked File As…".
Then you have to remove the .txt and when I prompts you if you are sure click Yes.
Then you can double click the file and it should work.
This is what comes out when you do it right.

Code:
# Change this to en0 for an ethernet connection instead of airport
INTF=en1

# get the current number of bytes in and bytes out
sample1=(`/usr/sbin/netstat -ib | awk "/$INTF/"'{print $7" "$10; exit}'`)

# wait one second
sleep 1

# get the number of bytes in and out one second later
sample2=(`/usr/sbin/netstat -ib | awk "/$INTF/"'{print $7" "$10; exit}'`)

# find the difference between bytes in and out during that one second
# and convert bytes to kilobytes
results=(`echo "2k ${sample2[0]} ${sample1[0]} - 1024 / p" "${sample2[1]} ${sample1[1]} - 1024 / p" | dc`)

# print the results
printf "In: %.2f Kb/sec\nOut: %.2f Kb/sec\n" ${results[0]} ${results[1]}
 
Joined
Sep 4, 2009
Messages
137
Reaction score
1
Points
18
Oh! I see what your problem is! When you try to download a geeklet you have to right click on the download link and do "Save linked File As…".
Then you have to remove the .txt and when I prompts you if you are sure click Yes.
Then you can double click the file and it should work.
This is what comes out when you do it right.

Code:
# Change this to en0 for an ethernet connection instead of airport
INTF=en1

# get the current number of bytes in and bytes out
sample1=(`/usr/sbin/netstat -ib | awk "/$INTF/"'{print $7" "$10; exit}'`)

# wait one second
sleep 1

# get the number of bytes in and out one second later
sample2=(`/usr/sbin/netstat -ib | awk "/$INTF/"'{print $7" "$10; exit}'`)

# find the difference between bytes in and out during that one second
# and convert bytes to kilobytes
results=(`echo "2k ${sample2[0]} ${sample1[0]} - 1024 / p" "${sample2[1]} ${sample1[1]} - 1024 / p" | dc`)

# print the results
printf "In: %.2f Kb/sec\nOut: %.2f Kb/sec\n" ${results[0]} ${results[1]}


Interesting I did what you said but I still get the same texted showing.

I copied what you put on the thread and it did work. So I guess I need to figure out what I am still doing wrong.
 
Joined
May 14, 2009
Messages
2,052
Reaction score
136
Points
63
Location
Near Whitehorse, Yukon
Your Mac's Specs
2012 MBP i7 2.7 GHz 15" Matte - 16 GB RAM - 120 GB Intel SSD - 500 GB DataDoubler Mac OS 10.9
Ok, lets assume we want this script. Time | Geeklets

Scroll down to where it says "Geeklet File(s) to download", then instead of clicking on the link like you would with other downloads, but instead hold down the option key or right click on the link and choose "Save Linked File As...".
This will then save the .glet wherever you have your downloads download to.
Safari then presumably for safety reasons puts .txt behind the file. It then has this name in the downloads folder, "Time1.glet.txt"
You have to remove the .txt from the end of the file so it looks like this, "Time1.glet"
Finder will then ask you if you really want to remove the .txt, click the button that says "Use .glet"
Then you can simply double click and it will open in geektool, all setup ready for you customize the font/color.
 
Joined
Sep 4, 2009
Messages
137
Reaction score
1
Points
18
I have been able to get some to work. I will get it figured out, thanks for your help!

cheers
 
Joined
May 14, 2009
Messages
2,052
Reaction score
136
Points
63
Location
Near Whitehorse, Yukon
Your Mac's Specs
2012 MBP i7 2.7 GHz 15" Matte - 16 GB RAM - 120 GB Intel SSD - 500 GB DataDoubler Mac OS 10.9
OP
C
Joined
Oct 3, 2009
Messages
2,641
Reaction score
26
Points
48
Location
Albuquerque, New Mexico
Anybody remember the input/output IP address command?
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top