Geektool and Geeklets on OSX :: System info

GeekTool is an application for Mac OS. It lets you display various kinds of information on your desktop via 3 default plug-ins:

  • File plugin to monitor MacOS X activity with /var/log/system.log, or any file that you want to follow.
  • Shell mode to launch custom scripts or commands like “df” to check space left on filesystems or “uptime” to monitor load on your machine. Finally,
  • Image mode helps you monitor bandwith usage, CPU load, memory availability on your server with tools like MRTG

How to install geektool?

It’s simple. Download the file (is located below the article) and install it 🙂

 

 

How to do this?

  • Open geektool
  • Click on the shell icon

  • And drag to your you desktop
  • Now you should see this:

  • In command line paste this code:
echo "Workstation:t"`scutil --get ComputerName`;
echo "Total memory:t "`sysctl -n hw.memsize | awk '{print $0/1073741824" GB of RAM"}'`;
export memTotal=`sysctl -n hw.memsize | awk '{print $0/1048576}'`;
export memUsed=`(top -l 1 | awk '/PhysMem/' | awk '{print $2}';) | cut -d 'M' -f 1  | cut -d 'G' -f 1`;
export memFree=`echo $memTotal - $memUsed | bc`;
export memShortFree=`echo "scale=2;$memFree / 1024" | bc -l`;
export memShortUsed=`echo "scale=2;$memUsed / 1024" | bc -l`;
 
echo "Free memory:t $memShortFree GB of RAM" "- "$(( 100* $memFree / $memTotal ))" %";
echo "Used memory: $memShortUsed GB of RAM" "- "$(( 100* $memUsed / $memTotal ))" %";
 
uptime | awk '{sub(/[0-9]|user,|users,|load/, "", $6);
sub(/mins,|min,/, "min", $6);
sub(/user,|users,/, "", $5); sub(",", "min", $5);
sub(":", "h ", $5); sub(/[0-9]/, "", $4);
sub(/day,/, " day ", $4); sub(/days,/, " days ", $4);
sub(/mins,|min,/, "min", $4); sub("hrs,", "h", $4);
sub(":", "h ", $3);
sub(",", "min", $3);
print "System Uptime: "$3$4$5$6}'
## Disk section
df -hl | grep 'disk0s2' | awk '{print "OSX: " $4"/"$2" free ("$5" used)"}'
df -hl | grep 'disk1s2' | awk '{print "Dane: " $4"/"$2" free ("$5" used)"}'
df -hl | grep 'disk2s2' | awk '{print "Cloud: " $4"/"$2" free ("$5" used)"}'

How to take your disk id?

  • Open terminal
  • type: diskutil list

 

Refresh mode, remember to add refresh for about 5-10s schedule in command section / refresh

How to add ethernet information?

  • Add a new shell geeklets
  • Paste this code:

 

#!/usr/bin/perl 
 
$en0_info = `ifconfig en0 | grep "inet" | grep -v 127.0.0.1`; 
$en1_info = `ifconfig en1 | grep "inet" | grep -v 127.0.0.1`; 
$ext_info = `curl --silent http://checkip.dyndns.org | grep -Eo '([0-9]{1,3}.){3}[0-9]{1,3}'`;
$airport_network = `/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -I | awk -F: '/ SSID: / {print $2}' | sed -e 's/.*SSID: //'`; 
if($ext_info) { 
    $output .= "External: $ext_info"; 
} else {
    $output .= "External: OFFLINE n";
} 
if($en0_info) { 
    $en0_info =~ /inet (.*) netmask/s; 
    $output .= "Ethernet: $1 n"; 
} else {
    $output .= "Ethernet: INACTIVE n";
} 
if($en1_info) { 
    $en1_info =~ /inet (.*) netmask/s; 
    $en1_info = $1; 
    $output .= "Airport: $en1_info n";
    $output .= "SSID: $airport_network"; 
} else {
    $output .= "Airport: INACTIVE";
} 
print "$output";

 

Download

Comments

comments

Tags

Check our

store

top