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.
took about 3 or 4 hrs...
20090411-rp8dbe6m51sm228fy82fa76t6n.jpg

that looks pretty awesome!
 
Apple Mail

Hi all,

I am new to Geektool (and terminal), but I am loving it. As of now, I am basically just cutting and pasting scripts without really understanding what I am doing. I have a script for an unread mail count courtesy of http://www.celsius1414.com/mini-monitor but it gives me a total unread mail count. I was wondering whether anyone would know how to retrieve unread mail counts for each mailbox? (I have to email accounts in Apple Mail and would like to know the unread counts for each account separately). I would greatly appreciate any help! Thank you!
 
Geektool todo list problem

I'm currently using a .txt to-do with geektool and it displays perfectly. However, it wont update. If i change the file, geektool will not change my todo on my desktop until i log out and log in again. Ideas?
 
Is there a way with the lynx pulling down the weather to make the color change depending on the temperature? Like if it's above 75, use red, and below blue?
 
Is there a way with the lynx pulling down the weather to make the color change depending on the temperature? Like if it's above 75, use red, and below blue?

Interesting! Here's one kinda complicated workaround that should do it, though there may be a simpler way:

Okay, so you can create two geektool items that display in the same place, but set the first one to display in blue and the second in red.

Now the first one can have this attached to the end:
| awk '{printf ("%.0f\n", $1/3.75)}' | sed -e 's/2[0-9]...//g' -e 's/3[0-9]...//g' | awk '{printf ("%.0f\n", $1*3.75)}' | sed 's/^0//g'

And the second one has this attached to the end:
| awk '{printf ("%.0f\n", $1/3.75)}' | sed -e 's/1[0-9]...//g' | awk '{printf ("%.0f\n", $1*3.75)}' | sed 's/^0//g'

In theory, what that should do is the first one won't display anything if the number is greater than 20 when divided by 3.75 (so, >75), and the second one won't display anything that is less than 20 when divided by 3.75 (<75). So, depending on the temp, they should only display the one in the colour that is appropriate.

Note, this works when tagged on to the end of my script, which is:
curl http://m.wund.com/global/stations/71892.html |sed -n '19p' | sed -e 's/<span class="nowrap"><b>//g' | sed -e 's/<\/b.*//g'
but I have no idea if it will work with yours.

Anyways, I get why they call it geektool now.

let me know if it works.
 
Now the first one can have this attached to the end:
| awk '{printf ("%.0f\n", $1/3.75)}' | sed -e 's/2[0-9]...//g' -e 's/3[0-9]...//g' | awk '{printf ("%.0f\n", $1*3.75)}' | sed 's/^0//g'

And the second one has this attached to the end:
| awk '{printf ("%.0f\n", $1/3.75)}' | sed -e 's/1[0-9]...//g' | awk '{printf ("%.0f\n", $1*3.75)}' | sed 's/^0//g'

These "[0-9]..." should actually be changed to these [0-9].*

Also, if you want to do it in celsius, changing the 3.75 to .85 makes the dividing temp 17C. But you can change it around to whatever you consider warm enough.

-Azim
 
Worked for me, thanks a lot, though it changed the temperature from what it was reporting of 62.1 to 64. Are you sure that it should be multiplied by 3.75? I don't mind it being a degree or two off, just curious if that's right. (And I'm using it in fahrenheit as you probably figured).
 
Worked for me, thanks a lot, though it changed the temperature from what it was reporting of 62.1 to 64. Are you sure that it should be multiplied by 3.75? I don't mind it being a degree or two off, just curious if that's right. (And I'm using it in fahrenheit as you probably figured).

I think it's a rounding problem. It rounds off twice. Try changing the 2 places that say "%.0f\n" to "%.1f\n" or even "%.2f\n"
 
I end up with a problem like you can see in the bottom right corner when I change the numbers. (I separated them just to show what's going on).
2qlbx3a.png
 
Actually, now it just doesn't work right apparently
I have it set up like this.

For the cold (I added the F so I can know it's fahrenheit).

Code:
curl http://m.wund.com/US/NY/11794.html |sed -n '19p' | sed -e 's/<span class="nowrap"><b>//g' | sed -e 's/<\/b.*//g' | awk '{printf ("%.1f", $1/3.75)}' | sed -e 's/2[0-9]//g' -e 's/3[0-9]//g' | awk '{printf ("%.1f F", $1*3.75)}' | sed 's/^0//g'

For the hot

Code:
curl http://m.wund.com/US/NY/11794.html |sed -n '19p' | sed -e 's/<span class="nowrap"><b>//g' | sed -e 's/<\/b.*//g' | awk '{printf ("%.1f", $1/3.75)}' | sed -e 's/1[0-9]//g' | awk '{printf ("%.1f F", $1*3.75)}' | sed 's/^0//g'

And they're still doing the same things.
For the first one I have a reading of 47.2 F and for the second I have a reading of 1.9 F.
 
Actually, now it just doesn't work right apparently
I have it set up like this.

For the cold (I added the F so I can know it's fahrenheit).

Code:
curl http://m.wund.com/US/NY/11794.html |sed -n '19p' | sed -e 's/<span class="nowrap"><b>//g' | sed -e 's/<\/b.*//g' | awk '{printf ("%.1f", $1/3.75)}' | sed -e 's/2[0-9]//g' -e 's/3[0-9]//g' | awk '{printf ("%.1f F", $1*3.75)}' | sed 's/^0//g'

For the hot

Code:
curl http://m.wund.com/US/NY/11794.html |sed -n '19p' | sed -e 's/<span class="nowrap"><b>//g' | sed -e 's/<\/b.*//g' | awk '{printf ("%.1f", $1/3.75)}' | sed -e 's/1[0-9]//g' | awk '{printf ("%.1f F", $1*3.75)}' | sed 's/^0//g'

And they're still doing the same things.
For the first one I have a reading of 47.2 F and for the second I have a reading of 1.9 F.

you gotta add ".*" after the [0-9]s, and after the ^0

that works on mine, at least.
 
Thanks a lot, that was it, so it wasn't just yours working. I'm very grateful now that I can look to my desktop for answers without expending too much ram.
 
Here are my GeekTool scripts, just set up. Unfortunately the calendar I had to do manually for now, which means I'll have to update it each month (the current date is being highlighted automatically, but I'll have to swap out the monthly calendar because the cal command doesn't let me do a single line calendar).

jW

In case someone has not replied to you, you can use this script to set monthly calendars on your screen:

Last Month
cal $( echo $(date +%m)-1 | bc ) $(date +%Y)

Current Month (today shown as **)
cal | sed "s/^/ /;s/$/ /;s/ $(date +%e) / $(date +%e | sed 's/./*/g') /"

Next Month
cal $( echo $(date +%m)+1 | bc ) $(date +%Y)

Month after next
cal $( echo $(date +%m)+2 | bc ) $(date +%Y)

Since the command refreshes every 10 minutes or so, you will have the most up to date calendars at 10 past midnight.
 
Exchange rate display

Substitute your own currencies:

echo -n '$=R' ; curl --silent 'http://www.google.com/finance/converter?a=1&from=USD&to=ZAR' | grep 'USD.*ZAR' | sed 's/1 USD = <span class=bld>//' | sed 's/ ZAR.*//'
 
Status
Not open for further replies.
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.