This should get you started...
echo $peak |awk '{ printf "Peak: %.2f / 100GB used\n", $1/1000000000 }'
Thank you very much. Works perfectly.
This should get you started...
echo $peak |awk '{ printf "Peak: %.2f / 100GB used\n", $1/1000000000 }'
open the Applescript Editor (in Applications/Utilities)
copy paste the script and save it somewhere (~/Geektool/scriptVLC.scpt for example)
then in geektool, type "osascript ~/Geektool/scriptVLC.scpt" without the quotation marks. and it should work.
Here's my desktop. Using Geektool for the date, current weather, top labels, lines and in conjunction with icalBuddy for the calendar stuff. Bowtie is for itunes (Zukunft Condensed White theme) and WideScape weather for Yahoo Widgets for the forecast. Dateline for the date bar at the bottom.
Let me know what you think!
-- Paths and stuff
set ArtworkFromiTunes to ((path to home folder) as text) & ¬
"Pictures:iTunes Artwork:From iTunes:albumArt.pict" as alias
set iTunesArtwork to ((path to home folder) as text) & ¬
"Pictures:iTunes Artwork:From iTunes:albumArt.pict"
set DefaultArtwork to ((path to home folder) as text) & ¬
"Pictures:iTunes Artwork:Default:albumArt.pict"
set displayArtwork to ((path to home folder) as text) & ¬
"Pictures:iTunes Artwork:albumArt.pict"
-- Unix versions of the above path strings
set unixITunesArtwork to the quoted form of POSIX path of iTunesArtwork
set unixDefaultArtwork to the quoted form of POSIX path of DefaultArtwork
set unixDisplayArtwork to the quoted form of POSIX path of displayArtwork
set whichArt to "blank"
tell application "System Events"
if exists process "iTunes" then -- iTunes is running
tell application "iTunes"
if player state is playing then -- iTunes is playing
set aLibrary to name of current playlist -- Name of Current Playlist
set aTrack to current track
set aTrackArtwork to null
if (count of artwork of aTrack) ≥ 1 then -- there's an album cover
"Running and playing and art"
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
tell application "Finder" to ¬
set creator type of ArtworkFromiTunes to "????"
set whichArt to "iTunes"
end if
end if
end tell
end if
end tell
if whichArt is "iTunes" then
do shell script "ditto -rsrc " & unixITunesArtwork & space & unixDisplayArtwork
else
do shell script "ditto -rsrc " & unixDefaultArtwork & space & unixDisplayArtwork
end if
That would be really awesome if someone could write a script that would get the system temperature and display the following for different temperatures:
120F and below
130F
140F
150F :|
160F :\
170F
180F :'(
190F >:[
200F X[
#!/usr/bin/env python
# based off of matchtemp.py from R0SSAR00
# at http://www.r0ssar00.com/2009/03/geektool.html
# i really only used the re command
# module imports
import re, shlex, subprocess
# get our command line argument in a list for
# modify based on your system and where you put smc.custom
cmd = "/path/to/smc.custom -k TC0D -r"
cmd = shlex.split(cmd)
# get the data from the command we want to run
smcdata = subprocess.Popen(cmd, stdout=subprocess.PIPE).communicate()[0]
# regex to parse the smc.custom output
match = re.search(r".*:::(\d*):::", smcdata)
if match:
cputemp = match.group(1)
else:
cputemp = ""
# figure out smile based on cpu temp
if int(cputemp) <= 120:
smile = ":D"
elif int(cputemp) > 120 and cputemp <= 130:
smile = ":P"
elif int(cputemp) > 130 and cputemp <= 140:
smile = ":)"
elif int(cputemp) > 140 and cputemp <= 150:
smile = ":|"
elif int(cputemp) > 150 and cputemp <= 160:
smile = ":\\"
elif int(cputemp) > 160 and cputemp <= 170:
smile = ":("
elif int(cputemp) > 170 and cputemp <= 180:
smile = ":'("
elif int(cputemp) > 180 and cputemp <= 190:
smile = ">:["
elif int(cputemp) > 190 and cputemp <= 200:
smile = "X["
elif int(cputemp) > 200:
smile = "HOSED"
# print the data
# customizable!
print "CPU: "+cputemp+" "+smile
Just wanted to thank everyone for their help in using Geektool. Did my first desktop back in April but was feeling the need for change and I think I did an even better job. So, here's my current desktop.
...
Thanks again. I couldn't have done it without the gang on this forum.
Jim bagsh
As it is right now I have Terminal telling me "You have mail." everytime I open it. How can I get rid of this? All the mail is just old reminders about SuperDuper that's been delete for some time.
Thanks to everyone on here who posted their setups & scripts *here's what I've applied to my work machine:
Secondary on the left, primary display on the right.
Uses date, weather and sunset scripts, all in Myriad Pro lowercase.
![]()
my geek tool desktop
anone know the script for events? for whole month
and the calendar script
please
echo 'tell application "Mail" to return unread count of inbox as string & " UNREAD E-MAIL"' | osascript | grep -v '0'
Alright, I have a quick question about an E-mail Script. I currently use the script:
This is all well and works fine. My question is if I can get a notification to pop up when I have an unread email, but only displays the word E-MAIL, with NO number count. What I'm trying to do is emulate a popular icon set that I'm using so that the notification flows better with my dock and the icons. I've attached an image of my latest desktop customization. As you can see in the bottom right corner I am using Geektool to display the time and underneath that I have basic text saying CLOCK. I want to basically do the same thing on the opposite side with my unread email. Have it say 1 UNREAD then underneath have it say E-MAIL. The only problem is that I either need to have the E-MAIL sit there permanently like CLOCK as basic text, or have it say 1 UNREAD 1 E-MAIL.
Is there anyway I can get just the word E-MAIL to display once a new email is received.
tell application "System Events" to set iCalIsRunning to (name of processes) contains "Mail"
set finalText to ""
if iCalIsRunning then
tell application "Mail"
set unreadCount to unread count of inbox
if (unreadCount is greater than 0) then
return "E-MAIL"
else
set finalText to ""
end if
end tell
else
set finalText to "OFF"
end if
osascript [I}path/to/script/nameofscript.scpt[/I}
url --silent "http://weather.yahoo.com/forecast/UKXX0112.html" | grep "forecast-icon" | sed "s/.*background\:url(\'\(.*\)\')\;\ _background.*/\1/" | xargs curl --silent -o /tmp/weather.png
file:///tmp/weather.png
Your first problem is the code to get the webpage image, replace url with curl.I am trying to put a weather image onto my desktop (I have had this before, but it seems not to be working all of a sudden). The codes I am using are
1. to get the image
Code:url --silent "http://weather.yahoo.com/forecast/UKXX0112.html" | grep "forecast-icon" | sed "s/.*background\:url(\'\(.*\)\')\;\ _background.*/\1/" | xargs curl --silent -o /tmp/weather.png
2. To display the image, an image file with the location
Code:file:///tmp/weather.png
Both are set to 1s refreshes, but nothing seems to be happening, any ideas guys?
If this doesn't work it will provide a good start for you.
1) Create an AppleScript using the following code
*E-MAIL is displayed any time an unread email is present. If Mail is running and there are no unread emails, nothing will be displayed. If Mail is not running, OFF will be displayed.Code:tell application "System Events" to set iCalIsRunning to (name of processes) contains "Mail" set finalText to "" if iCalIsRunning then tell application "Mail" set unreadCount to unread count of inbox if (unreadCount is greater than 0) then return "E-MAIL" else set finalText to "" end if end tell else set finalText to "OFF" end if
2) save the script
3) create a new geeklet
Code:osascript [I}path/to/script/nameofscript.scpt[/I}
Your first problem is the code to get the webpage image, replace url with curl.
Your second problem is the 1s refresh on the code to pull the webpage down; the yahoo servers will block you eventually due to the number of requests you are asking for. I would set it so 10 minutes or so.
Thanks for the confidence but I'm not familiar with writing scripts at all. So I'm not quite sure how to change this one since it's not working. The applescript seems to work fine, (first time writing an applescript so I may be wrong.) I copy and pasted what you wrote and when I hit run the bottom displayed "EMAIL" which I assume meant it worked fine. Once I plugged the second part into geektools though nothing showed up when I had an email. I did replace the path with the path to the script. I'm not quite that new to all this. Not sure where the problem lies.
EDIT: Got it working the "Set Locale Environment" box was ticked. Turning it off solved the problem and the script works fine now.