18

This is a set of Geeklets I use to monitor my system with just an exposé swipe and simultaneously keep my desktop feeling apple-y.

screenshot

I tried to minimize the resources used in the shells, it ends up running 'top' in 2 and 5 second intervals, and 'ifconfig' every 10 seconds. The calendar was not written by me and can be found elsewhere on this site. All the other shells are pretty simple, even the CPU meter is just a while loop printing pipe "|" characters with some ANSI coloring. The IP addresses are LAN, not WAN, but will change to "INACTIVE" when that connection is, well... inactive. The backdrop for everything is actually put together from image files used in OSX's Dock.app package and you can get it by clicking on this thumbnail:

screenshot

And if you're like me and got tired of the 3D glass dock, open a terminal session and run:

defaults write com.apple.dock no-glass -boolean YES; killall Dock

Now the dock should look like it does when it's on the side of the screen. (This can be reversed by entering the same thing but replacing YES with NO). If the layering order of the geeklets gets mixed up, it'll look pretty dumb. To fix this, right-click on the geeklets and choose "Send to back" or "Move forward" etc.

I think this setup looks pretty good with most of Snow Leopard's built-in desktops, especially the nature ones. Use it, change it, enjoy it, let me know how you like it!

Comments

User Avatar
Vanglad 3291 days ago
Is it possible to create a RAM meter?

I have tried but with no luck :(
User Avatar
blair1618 3285 days ago
You'd think it would be just as easy as the CPU meter, but I've had trouble with it as well. It's something to do with the number formats I think, I'll keep tinkering.
User Avatar
blair1618 3284 days ago
Aha, got it. The trick was getting expr to do multiplication. You have to say `expr $a * $b` and not `expr $a * $b`. To get a RAM meter use:

myRAM=`top -l 1 -F -R | awk '/PhysMem/ {print "" $8+0}'`

totalRAM=4096

myPercentRAM=`expr $myRAM * 100 / $totalRAM`

declare -i a=5

while [ $a -lt $myPercentRAM ]

do

echo "|c"

a=`expr $a + 5`

done

echo "33[1;31m|33[0mc"

while [ $a -lt 100 ]

do

echo "33[1;30m|33[0mc"

a=`expr $a + 5`

done

echo "n"

unset myRAM

unset myPercentRAM

unset a

... substituting your own totalRAM value of course.
User Avatar
blair1618 3284 days ago
Well that doesn't make much sense. The comment box won't show it but there should be a backslash before the * in the script.
User Avatar
Vanglad 3271 days ago
I've tried it, but it pops up with this: 33[1;31m|33[0mc

I have changed the totalRAM and made some backslashes.

so what could I have done wrong??
User Avatar
Craterus 3265 days ago
@Vanglad

I had that too, but got it to work by comparing Blair's original CPU Meter to the the RAM Meter code posted above, there are quite a few places where 's (backslashes) failed to appear (I guess Blair forgot to escape them by putting another backslash in). If you put slashes in in the appropriate places, as indicated by the CPU Meter script, it should work (I also changed a "declare" to a "typeset", like the original, but I do not know if this made any difference). Also make sure to change the Geeklet's text color to white, so it shows up the same as the CPUMeter.glet

Thanks Blair, I've been looking for a way to put a meter like this into my Geektool setup, ingenious method. It seems to work, and look, great.
User Avatar
Vanglad 3262 days ago
Yeah thanks :)

Here is the script:

myRAM=`top -l 1 -F -R | awk '/PhysMem/ {print "" $8+0}'`

totalRAM=2048

myPercentRAM=`expr $myRAM * 100 / $totalRAM`

declare -i a=5

while [ $a -lt $myPercentRAM ]

do

echo "|c"

a=`expr $a + 5`

done

echo "33[1;31m|33[0mc"

while [ $a -lt 100 ]

do

echo "33[1;30m|33[0mc"

a=`expr $a + 5`

done

echo "n"

unset myRAM

unset myPercentRAM

unset a

Remember to change the totalRAM :)
User Avatar
LittleIndian 3190 days ago
could someone please upload the ram meter geeklet, i have spent hours trying to get it to work but with no luck.
User Avatar
matt 3190 days ago
Here's the script. I'll make a downloadable .glet file and upload it as a new submission too.myRAM=`top -l 1 -F -R | awk '/PhysMem/ {print "" $8+0}'`

totalRAM=2048

myPercentRAM=`expr $myRAM \* 100 / $totalRAM`

declare -i a=5

while [ $a -lt $myPercentRAM ]

do

echo "|\c"

a=`expr $a + 5`

done

echo "\033[1;31m|\033[0m\c"

while [ $a -lt 100 ]

do

echo "\033[1;30m|\033[0m\c"

a=`expr $a + 5`

done

echo "\n"

unset myRAM

unset myPercentRAM

unset a
User Avatar
chuckles911 3152 days ago
Does anyone know hwo i could change the size of this? I want it to be a bit smaller, (like on here)

If someone could tell me what i need to change it would be GREAT :D thanks!
User Avatar
thatguyagain 3005 days ago
ANyone tell me how to change colour?

Same as my itunes meter which was inspired by this.

]Thatguyagain

Log in to comment or register here.