Do I have to say more?
Mal ehrlich was ist bzw. was bewirkt das GeekTool. Ein Bild sagt mehr als tausend Worte:
Wie ihr diese schönen Infos anzeigen könnt, werde ich im Weiteren erklären.
In dem Screenshot wird das iTunes Album Cover, iTunes Titelinfo, Uptime des Rechners, angemeldete Benutzer, Ramverbrauch, Datum und Uhrzeit in deutsch angezeigt. Alle Komponenten kann man einzeln aktivieren und es bleibt euch überlassen, was ihr benutzt und was nicht. Jedes Element werde ich im folgenden erklären.
Anzeige des Datums:
Diese Infos sind aus 3 Shell Einträgen zusammengesetzt worden. Einfach die folgenden Zeilen als einzelne Einträge ins GeekTool einfügen und nach belieben bearbeiten:
GeekTool Shell Uhrzeit:
date ‘+%H:%M’
GeekTool Shell Tag:
date “+%A” | sed -e ‘s/Monday/Montag/g’ -e ‘s/Tuesday/Dienstag/g’ -e ‘s/Wednesday/Mittwoch/g’ -e ‘s/Thursday/Donnerstag/g’ -e ‘s/Friday/Freitag/g’ -e ‘s/Saturday/Samstag/g’ -e ‘s/Sunday/Sonntag/g’
Geektool Shell Datum:
date “+%d %B” | sed -e ‘s/January/Jan/g’ -e ‘s/February/Feb/g’ -e ‘s/March/Marz/g’ -e ‘s/April/April/g’ -e ‘s/May/Mai/g’ -e ‘s/June/Juni/g’ -e ‘s/July/Juli/g’ -e ‘s/August/Aug/g’ -e ‘s/September/Sep/g’ -e ‘s/October/Oct/g’ -e ‘s/November/Nov/g’ -e ‘s/December/Dez/g’
Anzeige des Uptimes und der Verbauch von CPU / RAM:
Durch den angenehmen Ruhezustand ist es oft möglich, dass euer Mac mal mehrere Tage “online” ist und ein Neustart in weiter Ferne. Diese Anzeige zeigt euch wielange das schon der Fall ist
Außerdem werden CPU Last und Ram-Verbaucht angezeigt.
GeekTool Shell Entry
uptime | awk ‘{print “UPTIME : ” $3 ” ” $4 ” ” $5 ” ” }’; top -l 1 | awk ‘/PhysMem/ {print “RAM : ” $8 ” “}’ ; top -l 2 | awk ‘/CPU usage/ && NR > 5 {print $6, $7=”:”, $8, $9=”user “, $10, $11=”sys “, $12, $13}’
Spielender Track in iTunes – Track, Artist, Album
Natürlich gibt es auch Programme, die diese Informationen darstellen können. Aber hier hat man einfach mehr Freiheiten. Es wird der Titel mit Status (gestoppt, pausiert, …), der Interpret und das Album angezeigt.

Für diese Anzeige benötigt man zusätzlich ein Script. Dieses Script wird über das GeekTool aufgerufen:
Geek Tool Shell Entry:
osascript /Users/marius/Documents/Scripts/iTunesGeektool.scpt
Script:
tell application “System Events”
set powerCheck to ((application processes whose (name is equal to “iTunes”)) count)
if powerCheck = 0 then
return “”
end if
end tell
tell application “iTunes”
try
set playerstate to (get player state)
end try
if playerstate = paused then
set trackPaused to ” (paused)”
else
set trackPaused to “”
end if
if playerstate = stopped then
return “Stopped”
end if
set trackID to the current track
set trackName to the name of trackID
set artistName to the artist of trackID
set albumName to the album of trackID
set totalData to “Track : ” & trackName & trackPaused & ”
Artist : ” & artistName & ”
Album : ” & albumName
return totalData
end tell
AlbumCover anzeigen

Um das Cover anzeigen zu lassen, ist ein wenig mehr zu tun, aber nicht wirklich schwierig.
Zum einen benötigen wir wieder ein Script, welches das Geektool aufruft. Dieses erstellt eine Bilddatei aus dem Cover. Ein weiterer GeekTool-Eintrag liest das Bild ein und zeigt es auf eurem Desktop.
GeekTool Shell Eintrag:
osascript /Users/marius/Documents/Scripts/iTunesGeektoolCover.scpt
GeekTool Picture Eintrag:
file:///Users/marius/Pictures/iTunes%20Artwork/albumArt.tif
Script:
(* Set Defaults and Loctions *)
set iTunesArtworkFolder to ((path to home folder) as text) & “Pictures:iTunes Artwork:”
– Artwork Folderset DefaultArtwork to ((path to home folder) as text) & “Pictures:iTunes Artwork:albumArt.tif”
– When there’s no artwork or iTunes isn’t running. This is a transparent TIFF.set DefaultFolder to ((path to home folder) as text) & “Pictures:iTunes Artwork:”
– Default Folderset FromiTunesFolder to ((path to home folder) as text) & “Pictures:iTunes Artwork:”
– Where iTunes saves the Artworkset ArtworkFromiTunes to FromiTunesFolder & “albumArt.pict” as file specification
– The Artwork from iTunesset AlbumArtwork to (path to home folder) & “Pictures:iTunes Artwork:albumArt.tif” as string
– The Album Artworkset UnixAlbumArtwork to the quoted form of POSIX path of AlbumArtwork
– Unix path to the Album Artwork(* Check if iTunes is running. *)
tell application “System Events”
if exists process “iTunes” then
try(* Get Artwork From iTunes *)
tell application “iTunes”
set aLibrary to name of current playlist — Name of Current Playlist
set aTrack to current track
set aTrackArtwork to null(* Is there any Artwork? *)
if (count of artwork of aTrack) ≥ 1 then
set aTrackArtwork to data of artwork 1 of aTrack
set fileRef to (open for access ArtworkFromiTunes with write permission)
try
set eof fileRef to 512
write aTrackArtwork to fileRef starting at 513
close access fileRef
on error errorMsg
try
close access fileRef
end try
error errorMsg
end try(* Convert to Tiff *)
tell application “Finder” to set creator type of ArtworkFromiTunes to “????”tell application “Image Events”
set theImage to open ArtworkFromiTunes
save theImage as TIFF in iTunesArtworkFolder & “albumArt.tif” with replacing
end tellelse
(* If there’s no Artwork use the Blank Arwork. *)
tell application “iTunes”
if (count of artwork of aTrack) < 1 then
set aTrackArtwork to DefaultArtworkset unixDefaultFolder to the quoted form of POSIX path of DefaultFolder
set unixiTunesArtworkFolder to the quoted form of POSIX path of iTunesArtworkFolderdo shell script “ditto -rsrc ” & unixDefaultFolder & space & unixiTunesArtworkFolder
end if
end tell
end if
end tell
end tryelse
if (exists process “iTunes”) is false then(* If itunes isn’t running use the Blank Artwork *)
tell application “Finder”
set unixDefaultFolder to the quoted form of POSIX path of DefaultFolder
set unixiTunesArtworkFolder to the quoted form of POSIX path of iTunesArtworkFolderdo shell script “ditto -rsrc ” & unixDefaultFolder & space & unixiTunesArtworkFolder
end tellend if
end if
end tell



Hi, interest post. I’ll write you later about few questions!
How soon will you update your blog? I’m interested in reading some more information on this issue.
Ist eigentlich bekannt, wie man sich mit GeekTool V3 unter Snow Leopard die CPU Auslastung und den RAM anzeigen lassen kann? Keine Lösung will bei mir laufen.
Hmm müsste ich mal testen, hatte bisher noch keine Anzeige für die beiden Sachen in SL eingestellt.
Also die RAM Anzeige funktioniert bei mir mit folgendem Shell – Eintrag:
top -l 1 | awk ‘/PhysMem/ {print “RAM\t\t\t” $8 ” “}’
Getestet mit GeekTool V3
Gruss
Marius
Hey,
danke für die iTunes Scripte. Allerdings klappt das Cover-Script nicht. Ich erhalte den Error-Code -1700 für die “file specification”. Hast du ne Ahnung woran das liegen könnte? Ich nutze Geektool 3.0 auf OS X 10.6.2.
Danke und gruß
Daniel
Hi,
ersetze einfach die schrägen Anführungszeichen durch die geraden ” und die – durch — .
Dann klappt es auch…
Tom
Hi,
kann mir vielleicht jmd. helfen? Ich habe ein Script für die iTunes Tracks, dass im Spcripteditor einwandfrei funktioniert. Versuche ich es jedoch mit Geektools zu laden, zeigt er mir nichts an.
Ich habe 1000 mal gecheckt, dass die Dateinamen und Pfade übereinstimmen.
Jmd ne Ahnung?
Danke!
Daniel
Thank you for the information