<?phpxml version="1.0" encoding="utf-8"?>
<rss version="2.0" 
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
>
<channel>
<title>Geeklets / Khelmar / Recent Geeklets</title>
<link>http://www.macosxtips.co.uk/geeklets</link>
<description>Share and vote on Geeklets for GeekTool</description>
<pubDate>Wed, 23 Dec 2009 12:35:29 -0800</pubDate>
<language>en</language>
<item>
<title><![CDATA[Battery Status]]></title>
<link>http://www.macosxtips.co.uk/geeklets/system/battery-status/</link>
<comments>http://www.macosxtips.co.uk/geeklets/system/battery-status/</comments>
<pubDate>Wed, 23 Dec 2009 13:35:29 -0800</pubDate>
<dc:creator>Khelmar</dc:creator>
<category>System</category>
<guid>http://www.macosxtips.co.uk/geeklets/system/battery-status/</guid>
<description><![CDATA[This lists the battery status for MacBooks, and the current % if not attached to an AC adapter.<br /><br />The shell script is:<br /><br />my_ac_adapt=`ioreg -w0 -l | grep ExternalConnected | awk '{print $5}'`<br />if [ "$my_ac_adapt" == "Yes" ]<br />then<br />    echo "Power  : External"<br />else<br />    cur_power=`ioreg -w0 -l | grep CurrentCapacity | awk '{print $5}'`<br />    max_power=`ioreg -w0 -l | grep MaxCapacity | awk '{print $5}'`<br />    bat_percent=`echo "scale=2;$cur_power / $max_power" | bc`<br />    bat_percent=`echo "$bat_percent * 100" | bc | sed 's/.00//'`<br />    cyc_count=`ioreg -w0 -l | grep "Cycle Count" | awk 'BEGIN { FS = "=" } ; {print $8}' | awk 'BEGIN { FS = "}" } ; {print $1}'`<br />    echo "Power  : Battery ($bat_percent%)"<br />    echo "Cycles : $cyc_count"<br />fi<br /><br /><br />Just paste that into a file, set it executable, and run it as a shell command under GeekTool. Alternatively, just download the geeklet file linked below.<br /><br /><b>Screenshot 1:</b><br /><img src="http://www.macosxtips.co.uk/geeklets/screenshots/batterystatus1.png" /><br /><br /><b>Screenshot 2:</b><br /><img src="http://www.macosxtips.co.uk/geeklets/screenshots/batterystatus2.png" /><br/><br/>16 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[IP Information]]></title>
<link>http://www.macosxtips.co.uk/geeklets/system/ip-information/</link>
<comments>http://www.macosxtips.co.uk/geeklets/system/ip-information/</comments>
<pubDate>Tue, 22 Dec 2009 20:33:09 -0800</pubDate>
<dc:creator>Khelmar</dc:creator>
<category>System</category>
<guid>http://www.macosxtips.co.uk/geeklets/system/ip-information/</guid>
<description><![CDATA[This uses a shell script to list the IP addresses of en0 (ethernet) and en1 (AirPort). For AirPort, if the system is connected to a network, it will list the SSID and channel connected.<br /><br />The needed shell script (thanks to Appi for the suggestion about the PrivateFramework!) is here - the lines that start with myvar1 and myvar2 should each be on one line one below the next:<br /><br />#! /bin/bash<br /><br />myen0=`ifconfig en0 | grep "inet " | grep -v 127.0.0.1 | awk '{print $2}'`<br /><br />if [ "$myen0" != "" ]<br />then<br />    echo "Ethernet : IP - $myen0"<br />else<br />    echo "Ethernet : INACTIVE"<br />fi<br /><br />myen1=`ifconfig en1 | grep "inet " | grep -v 127.0.0.1 | awk '{print $2}'`<br /><br />if [ "$myen1" != "" ]<br />then<br />    myvar1=`/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -I | grep -e "SSID:" | tail -n 1 | awk '{print $2}'`<br />    myvar2=`/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -I | grep -e "channel:" | awk '{print $2}'`<br />    echo "AirPort   : IP - $myen1<br />               Network - $myvar1<br />               Channel - $myvar2"<br />else<br />    echo "Airport   : INACTIVE"<br />fi<br /><br/><br/>2 Vote(s) ]]></description>
</item>

</channel>
</rss>
