GeekTools, desktop enhancing

A friend of mine, Micke, showed me the app "GeekTool" yesterday, and I stuck for it imediatly.

The app is really great. It lets you use terminal commands to show certain data on your desktop. I started using it right away, and this is my result:

Desktop Preview
Geektool 2.1.2 can be downloaded here: http://www.versiontracker.com/dyn/moreinfo/macosx/17621

Now, ofcourse not everybody is good in shell scripting and/or terminal commands to I show you the commands below:

For IP address (Internal):

For Uptime:

For HD free space:

For RAM usage:

For the clock: (set refresh to 1)

For the battery:

The battery is a litte bit more tricky one, I wrote a little sh script.

First off, I created a directory in my Documents folder called "geektools". In that directory I created a text-file called "battery.sh".

When you have created this file, add the folowing text to it:

Now, in geektools add the following command:

Remember to change the path to the correct path to your file.

This is the result (a little smaler image):

GeekTools

If you have to scripts/commands/tips of your own, please add them as an comment!

Cheers,

/Paul

Posted in Apple, Development, Mac Tagged with: , , , , , , ,
17 comments on “GeekTools, desktop enhancing
  1. Paul Peelen says:

    I made a little update to the battery script. There was a problem when the battery was fully loaded, it would say 10.00% instead of 100.0%.

    change:

    to:

    Regards,
    Paul

  2. Gedi says:

    Nice!

  3. Micke says:

    Trevligt! Ser skitbra ut. Om du lyckas få in Yahoo-väder så säg till, har trilskats med det ett tag nu och det vill inte lyda mig!

  4. Aky says:

    Thanks… this was helpful.

  5. Paul Peelen says:

    I updated the batteryscript once more… though it still had a bug.

    This is the new script (even updated in the main post):

  6. Andy says:

    Thanks! The battery works well! As a background to that stat I added this image:

    http://www.loganrockmore.com/StatusScreenSaver/images/modules/battery.png

    Thanks again!

  7. Matt says:

    I’m not sure if this is going to embed in the comment correctly, but this is what I came up with after tweaking yours a little. A few notes:
    * I’ve never seen, let alone written, shell scripting, so I’m sure this is really poor. I would love input.
    * Mine is calculating health based on a fixed number in the script. 5500, I think, is the original capacity of my MBP’s battery.
    * I created a cute little battery display. $starcount_size lets you customize how wide the display is.

    Thanks for your original!!!

    #!/bin/bash

    maxcap=ioreg -l | grep Capacity |awk '/MaxCapacity/{print $5}'
    curcap=ioreg -l | grep Capacity |awk '/CurrentCapacity/{print $5}'

    procint=echo scale=2\;$curcap / $maxcap*100|bc;
    procint_length=echo ${#procint}-3|bc;
    procint=${procint:0:$procint_length};

    procprc=echo $proc-$procint|bc;
    procprc_length=echo ${#procprc}-2|bc;
    if [ $procprc_length -lt 0 ]; then
    $procprc_length=0;
    fi
    procprc=${procprc:0:$procprc_length};

    maxhealth=5500;
    health=echo $maxcap/$maxhealth*100|bc -l;
    health=${health:0:2}

    starcount_size=3;
    starcount=echo $procint/$starcount_size|bc;
    starcount_totalsize=echo 100/$starcount_size|bc
    starcount_inv=echo $starcount_totalsize-$starcount|bc;

    echo “[\c”;
    COUNTER=0
    while [ $COUNTER -lt $starcount ]; do
    echo “o\c”;
    let COUNTER=COUNTER+1
    done
    COUNTER=0
    while [ $COUNTER -lt $starcount_inv ]; do
    echo “•\c”;
    let COUNTER=COUNTER+1
    done
    echo “]”;

    echo “Battery: “$procint$procprc%” (“$curcap/$maxcap”)\nHealth: “$health%;

  8. Matt says:

    The script I posted before was missing a line. Sorry!

    I’m not sure if this is going to embed in the comment correctly, but this is what I came up with after tweaking yours a little. A few notes:

    * I’ve never seen, let alone written, shell scripting, so I’m sure this is really poor. I would love input.
    * Mine is calculating health based on a fixed number in the script. 5500, I think, is the original capacity of my MBP’s battery.
    * I created a cute little battery display. $starcount_size lets you customize how wide the display is.

    Thanks for your original!!!

    #!/bin/bash

    maxcap=ioreg -l | grep Capacity |awk '/MaxCapacity/{print $5}'
    curcap=ioreg -l | grep Capacity |awk '/CurrentCapacity/{print $5}'

    proc=echo scale=3\;$curcap / $maxcap*100 |bc;

    procint=echo scale=2\;$curcap / $maxcap*100|bc;
    procint_length=echo ${#procint}-3|bc;
    procint=${procint:0:$procint_length};

    procprc=echo $proc-$procint|bc;
    procprc_length=echo ${#procprc}-2|bc;
    if [ $procprc_length -lt 0 ]; then
    $procprc_length=0;
    fi
    procprc=${procprc:0:$procprc_length};

    maxhealth=5500;
    health=echo $maxcap/$maxhealth*100|bc -l;
    health=${health:0:2}

    starcount_size=3;
    starcount=echo $procint/$starcount_size|bc;
    starcount_totalsize=echo 100/$starcount_size|bc
    starcount_inv=echo $starcount_totalsize-$starcount|bc;

    echo “[\c”;
    COUNTER=0
    while [ $COUNTER -lt $starcount ]; do
    echo “o\c”;
    let COUNTER=COUNTER+1
    done
    COUNTER=0
    while [ $COUNTER -lt $starcount_inv ]; do
    echo “•\c”;
    let COUNTER=COUNTER+1
    done
    echo “]”;

    echo “Battery: “$procint$procprc%” (“$curcap/$maxcap”)\nHealth: “$health%;

  9. Paul Peelen says:

    Great! Thanks alot! I will check it later today.

    Cheers
    /Paul

  10. Matt says:

    Paul, I’m really bad, but the line that says $procprc_length=0; should instead say procprc_length=0;

    I just thought to check the console for errors and noticed a few.. that’s why I noticed the first error and then this one. Sorry. Feel free to delete all of these comments and just put the final, working script online… or edit as you feel fit. 🙂

  11. Paul Peelen says:

    No worries… I will change the post later and remove the first comment.

    Third time is a charm, right? 😉

    Cheers,
    /Paul

  12. GrimlocK says:

    Hello,

    Matt or Paul one question please :

    I implemented the script of Matt but i not the percentage of the battery that appears ?

    Thanks for help

    Best regard

  13. Paul Peelen says:

    Allright… I’ll have a look at it next week…. need to reinstall my mac first.

  14. Niko says:

    Hi Paul!

    I’ve followed this to a tee and still I only get a display of:

    [battery]

    Nothing more. I’m not sure what I did wrong. I made the file correctly, copied the code correctly, and changed the path correctly. I’m stumped! Can you please email me as I do not check this post often. Thanks!

  15. abdul says:

    guys can you help me with windows XP

    sorryyyy !!

    thanks alot

  16. Paul Peelen says:

    Nope. This is OSX only.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

 

Categories