Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
Status
Not open for further replies.
I'm rather new in Geektool.
I can manage time, day, hour, itunes,...
but I still can't manage how I can get the weather on my desktop,
now I have the temperature and, at the time, Mostly Cloudy.
But the picture of the clouds and sun or moon don't work for me.

In a earlier post I found this

To get the image to show up on your desktop use this script:
Code:
file:///tmp/weather.png

But where do you have to write this script, in a separate shell or in the same?
And what URL do you need tot put in the script the same that I used (the citycode in yahoo)?
 
I'm rather new in Geektool.
I can manage time, day, hour, itunes,...
but I still can't manage how I can get the weather on my desktop,
now I have the temperature and, at the time, Mostly Cloudy.
But the picture of the clouds and sun or moon don't work for me.

In a earlier post I found this

To get the image to show up on your desktop use this script:
Code:
file:///tmp/weather.png

But where do you have to write this script, in a separate shell or in the same?
And what URL do you need tot put in the script the same that I used (the citycode in yahoo)?

Getting the weather image is a 2 step process
The first is a shell script that grabs the image (but you see no output, it puts the image on your drive)
The second step you use the image shell to get that image and display it

Step 1
Image grab
Got to Yahoo Weather and put in your zip code
When the page loads with your weather, copy that URL
Use this code in a shell script, but past your URL instead (keep the quotes around the URL)
You won't see any output from this

Code:
curl --silent "YOUR_YAHOO_URL_ADDRESS" | grep "forecast-icon" | sed "s/.*background\:url(\'\(.*\)\')\;\ _background.*/\1/" | xargs curl --silent -o /var/tmp/weather_image.png\

Step 2
Image display
In another geeklet, use this code to display the image
Code:
file://localhost/var/tmp/weather_image.png
 
The Unix Way...

Excellent!
Just the kind of information I was looking for :)
Thank you muchly

My favorite source for the WHY of the Unix philosophy is a book by Eric Raymond, The Art of Unix Programming (2003). The author has very kindly posted an online version here: http://catb.org/~esr/writings/taoup/.

For Newbies, probably best to search for things like "sed" and "awk" to find out what they are used for, and why they are as cryptic as they are. Then branch out and try out your new understanding in Terminal then bring it to Geektool or other areas.

It's what I use as my personal Rosetta stone.

Darryl
 
Using the same everything from post 1939, but added a new shell script for the track position in iTunes as I am thinking of replacing my Bowtie theme.

Using this AppleScript
Code:
# set this to the maximum number of dashes the progress meter will reach
set maxNumberOfDashes to 184
tell application "System Events" to set iTunesIsRunning to (name of processes) contains "iTunes"
if iTunesIsRunning is false then
	return ""
end if
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
if iTunesIsRunning is true then
	set trackPosition to 0
	set trackLength to 0
	set theStream to ""
	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 trackPosition to the player position
		set trackLength to the duration of trackID
		set theStream to the current stream title as text
	end tell
	
	if theStream is not "missing value" then
		set totalData to ""
		repeat maxNumberOfDashes times
			set totalData to "•" & totalData
		end repeat
		return totalData
	end if
	set numberOfDashes to (trackPosition / trackLength) * maxNumberOfDashes as integer
	set totalData to ""
	repeat numberOfDashes times
		set totalData to "•" & totalData
	end repeat
	return totalData
end if

With this shell
Code:
osascript /Path/To/The/File/position.scpt

The output is subtle, but I'm liking it so far. The black dots 'scroll' across the white bar.

Screenshot2010-03-27at14229AM.png
 
Sorry about the oversized image before :)

Here is my icalbuddy settings

/usr/local/bin/icalBuddy -nc -sd -b "" -ps "| - |" -ss "" -sed -eep location,notes,url eventsToday+2

No piping through sed required.

I also adjusted the locale file to capitalize the titles.

How do I adjust the local file to capitalize the titles?
 
Hi,

I wonder if anyone could help me with the free space script on my wireless hard drives.

for my macbook internal hard drive i use this one " df -h | grep disk0s2 | awk '{print "Macintosh HD:", $4, "remaining"}' " but i am unable to use it with my time machine hard drive as the drive ID of time machine is afp_0SIfZQ0SNssx00jkPL0Pyetl-1.2d000003 and the last digit (i.e 3 in our case) is changing after each restart. So is there any way to get the free space by using the path to the mounted volume (/Volumes/Time capsule) instead of using the diskid?

Many thanks!
 
kysjS.png


Thanks to the guy who created that nerdtool package.

Slipped in some new images I found in a Rainmeter (Windows) release. I think it's a bit more smoother looking overall. Also I resized everything to make it a bit smaller. Try to maximize my screen space :)

Would anyways have the code to just show "41〫" instead of "41〬F" ?

Link to the release where I snagged those new images:

http://theumad.deviantart.com/art/Windows-Sense-Clock-modded-158810558
 
Thanks to the guy who created that nerdtool package.
you're wellcome ;)

Would anyways have the code to just show "41〫" instead of "41〬F" ?
this is for New York:
Code:
curl --silent "http://weather.yahooapis.com/forecastrss?p=USNY0996&u=f" | grep -E '(Current Conditions:|[A-Z]<BR)' | sed -e 's/Current Conditions://' -e 's/<br \/>//' -e 's/<b>//' -e 's/<\/b>//' -e 's/<BR \/>//' -e 's/[A-Z a-z]*, //' -e 's/\(.*\) F/\1°/' -e 's/\(.*\) C/\1°/' | tail -n1
 
Grep can be vague...

for my macbook internal hard drive i use this one " df -h | grep disk0s2 | awk '{print "Macintosh HD:", $4, "remaining"}' " but i am unable to use it with my time machine hard drive as the drive ID of time machine is afp_0SIfZQ0SNssx00jkPL0Pyetl-1.2d000003 and the last digit (i.e 3 in our case) is changing after each restart. So is there any way to get the free space by using the path to the mounted volume (/Volumes/Time capsule) instead of using the diskid?

You can give Grep a partial match, since it will return the entire line that contains whatever match it does find. So you can just use the unique part:
Code:
df -h | grep 0SIfZQ0SNssx | awk '{print "Time Machine HD:", $4, "remaining"}'

Or you can make it readable with the actual drive name:
Code:
df -h | grep 'TM drive here' | awk '{print "Time Machine HD:",$4,"remaining"}'
Note that you need to use quotes for the GREP argument if your HD has a space in its name.
 
Perfect tutorial but I am having one problem. How do I get rid of the odd character between the number and degree.

screen-capture.png
 
Strange character before degree symbol

I took the degree symbol off of mine because I couldn't get that strange character to go away. I think it has something to do with the font, but I haven't been able to figure it out.

Try changing the text encoding from ASCII to UTF-8.
 
Maybe this has been covered already, but I've been using this :

cal | sed "s/^/ /;s/$/ /;s/ $(date +%e) / $(date +%e | sed 's/./#/g') /"

to display a calendar on my desktop. Today its showing April 1st is a Tuesday. Does anyone know why this would be?
 
does anyone knw how to change the color of the event time like the one in the link? http://minimalmac.com/post/221196886/desktop-10-23-2009-via-patrickrhone-this-got-a

ive been having trouble looking for a code or script for this one. i only have this as a script: how can i change the time color to green?

/usr/local/bin/icalBuddy -nc -b " + " eventsToday | sed -e "s/*/+ /" | sed -e "s/!/!!/"


It has nothing to do with the code placed in geektool and everything to do with the icalBuddyConfig.plist. I remember looking at it and fooling around a bit when I did mine, but I can;t recall right now and I don't have the time to dig through it. If it is not answered by tomorrow afternoon I can look into it a little more.
 
I'm currently using NerdTool but I'm pretty sure you can change the encoding in Geektool also, I just don't remember where it is for sure.
I can't find that anywhere in Geektool 2. I don't think that's an option.

Also though, that may not be the solution anyway, cause there are others on here using Geektool 2 that have successfully used the degree symbol with no problems.

MacDawg uses Geektool 2 and his is working fine. :confused:

I am still using GT2

Dock-20100316-083525.jpg
 
It has nothing to do with the code placed in geektool and everything to do with the icalBuddyConfig.plist. I remember looking at it and fooling around a bit when I did mine, but I can;t recall right now and I don't have the time to dig through it. If it is not answered by tomorrow afternoon I can look into it a little more.

Thanks man! i'm looking forward for the solution!
 
Status
Not open for further replies.
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.