15

Playing With Fonts

Posted in Collections by jake001 190 days ago

I just use echo commands along with basic date and time codes for most of this, just played with the fonts a lot. I added the wearer on the left along with battery levels, current iTunes track with a time tracker underneath. Also, added an unread email shell down at the bottom left.

Weather

Go to http://weather.yahoo.com/ type in zip and then click the RSS feed in orange on the left, in the link replace the feed://weather.yahooapis.com part with http://xml.weather.yahoo.com DONT PUSH GO/REFRESH or else the link edited will change back. Now copy the whole link beginning with http://xml.weather.yahoo.com and paste in geek tool as a shell and you should be set :)

Unread email

Place the UnreadMessages.scpt in your Documents folder and then create a shell in geektool with the command

osascript ~/Documents/UnreadMessages.scpt 

iTunes

Place CurrentSong2.scpt in your Documents folder and then create a shell in geektool and add the following command

osascript ~/Documents/CurrentSong2.scpt

Time Tracker

Place SongMeter.scpt into your documents folder then create a new shell in Geektool and use the command

myDisk=`osascript ~/Documents/SongMeter.scpt`
if [ $myDisk != "" ]
then
myDisk =`expr 100 - $myDisk `
typeset -i a=5
while [ $a -lt $myDisk ]
do
    echo "⦁\c"
    a=`expr $a + 5`
done
echo "\033[1;32m⦁\033[0m\c"
while [ $a -lt 100 ]
do
    echo "\033[1;37m⦁\033[0m\c"
    a=`expr $a + 5`
done
echo "\n"
unset myDisk
unset a
fi

Now a cool little feature you can play with in this script; there are three ( ⦁ ) characters in the shell command, one in each echo line, replace those characters with whatever character you want :D

Battery levels

In geektool create a new shell with the command

KeyboardPercent=`ioreg -c AppleBluetoothHIDKeyboard | grep BatteryPercent | sed 's/[a-z,A-Z, ,|,",=]//g' | tail -1 | awk '{print $1}'`

typeset -i b=5
echo "\c"

if [ ${#KeyboardPercent} = 0 ]
then
    echo "Disconnected\c"
else
    if [ $KeyboardPercent -lt 11 ]
    then
        echo "\033[1;31m\c"
    else
        echo "\033[0m\c"
    fi
    while [ $b -le $KeyboardPercent ]
    do
        echo "|\c"
        b=`expr $b + 5`
    done

    while [ $b -le 100 ]
    do
        echo "\033[1;37m|\033[0m\c"
        b=`expr $b + 5`
    done

    echo "\033[0m $KeyboardPercent%\c"

    unset KeyboardPercent
    unset b

fi

echo "\033[0m\n\c"

MousePercent=`ioreg -c BNBMouseDevice | grep BatteryPercent | sed 's/[a-z,A-Z, ,|,",=]//g' | tail -1 | awk '{print $1}'`

if [ ${#MousePercent} = 0 ]
then
    echo "Disconnected\c"
else

    if [ $MousePercent -lt 11 ]
    then
        echo "\033[1;31m\c"
    else
        echo "\033[0m\c"
    fi

    typeset -i b=5
    while [ $b -le $MousePercent ]
    do
        echo "|\c"
        b=`expr $b + 5`
    done

    while [ $b -le 100 ]
    do
        echo "\033[1;37m|\033[0m\c"
        b=`expr $b + 5`
    done

    echo "\033[0m $MousePercent%\c"

    unset MousePercent
    unset b
fi

echo "\033[0m\n\c"

TrackpadPercent=`ioreg -c BNBTrackpadDevice | grep BatteryPercent | sed 's/[a-z,A-Z, ,|,",=]//g' | tail -1 | awk '{print $1}'`

if [ ${#TrackpadPercent} = 0 ]
then
    echo "Disconnected\c"
else
    if [ $TrackpadPercent -lt 11 ]
    then
        echo "\033[1;31m\c"
    else
        echo "\033[0m\c"
    fi

    typeset -i b=5
    while [ $b -le $TrackpadPercent ]
    do
        echo "|\c"
        b=`expr $b + 5`
    done

    while [ $b -le 100 ]
    do
        echo "\033[1;37m|\033[0m\c"
        b=`expr $b + 5`
    done

    echo "\033[0m $TrackpadPercent%\c"

    unset TrackpadPercent
    unset b
fi

the first percentage is your keyboard, second mouse, and last is your trackpad. Now there are three different command built into this one and in the script there are three lines that just have fi these are the ends of each script so if you just want one or two battery levels just delete the command above the fi and volia! now the first segment is your keyboard, second your mouse and lastly your trackpad so for instance if you just wanted the keyboard and trackpad your command would look like this

KeyboardPercent=`ioreg -c AppleBluetoothHIDKeyboard | grep BatteryPercent | sed 's/[a-z,A-Z, ,|,",=]//g' | tail -1 | awk '{print $1}'`

typeset -i b=5
echo "\c"

if [ ${#KeyboardPercent} = 0 ]
then
    echo "Disconnected\c"
else
    if [ $KeyboardPercent -lt 11 ]
    then
        echo "\033[1;31m\c"
    else
        echo "\033[0m\c"
    fi
    while [ $b -le $KeyboardPercent ]
    do
        echo "|\c"
        b=`expr $b + 5`
    done

    while [ $b -le 100 ]
    do
        echo "\033[1;37m|\033[0m\c"
        b=`expr $b + 5`
    done

    echo "\033[0m $KeyboardPercent%\c"

    unset KeyboardPercent
    unset b

fi


echo "\033[0m\n\c"

TrackpadPercent=`ioreg -c BNBTrackpadDevice | grep BatteryPercent | sed 's/[a-z,A-Z, ,|,",=]//g' | tail -1 | awk '{print $1}'`

if [ ${#TrackpadPercent} = 0 ]
then
    echo "Disconnected\c"
else
    if [ $TrackpadPercent -lt 11 ]
    then
        echo "\033[1;31m\c"
    else
        echo "\033[0m\c"
    fi

    typeset -i b=5
    while [ $b -le $TrackpadPercent ]
    do
        echo "|\c"
        b=`expr $b + 5`
    done

    while [ $b -le 100 ]
    do
        echo "\033[1;37m|\033[0m\c"
        b=`expr $b + 5`
    done

    echo "\033[0m $TrackpadPercent%\c"

    unset TrackpadPercent
    unset b
fi

Anymore questions just ask ~ have fun changing it up!


Comments

User Avatar
rprebel 189 days ago
I like the "time tracker". The font soup you've got going on...not so much.
User Avatar
always_a_newbie 189 days ago
Yeah, me too. Other than the font soup, It's really clever.
User Avatar
Geekism 189 days ago
Love it, except my Apple bluetooth keyboard is listed as disconnected, eventhough it is not. Any way around this?
User Avatar
always_a_newbie 189 days ago
can you have the geeklets too, not just the applescripts?
User Avatar
Geekism 187 days ago
Here's my take on the trackinfo/song meter: http://f.cl.ly/items/3e1X1M3l2Y342g3Q3J3T/itunestrackinfo-geek.png
User Avatar
vanberghe 183 days ago
hey i want exact the same as you did with your desktop but it just won't work... even step 1 with the weather doesn't work.. Is it possible to help me in any way ? :s

thx!
User Avatar
jake001 183 days ago
well being my first post I now realize I left out a lot of scripts and shell so sorry about that

now to correct the weather part ~ your geektool shell should be-

-curl -silent "*LINK*" | grep -E '(Current Conditions:|F
User Avatar
vanberghe 183 days ago
and btw where did you get the background ? i just love it

Log in to comment or register here.