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.
My first shot at geeklets

GeekTool is awesome. I used to use Conky back in the day on my Linux boxes, but GeekTool is much more powerful IMO. I only wish that scripts could be scheduled to run at a certain time of day rather than just every N seconds. Maybe in 4.0 ;)

Attached is my work in progress. The top bit is just the straight output of uptime. The calendar is generated using this user's suggestion, with an added escape sequence to colorize the current day.

The left side is more interesting: RSS feeds from FB and Twitter, pulled using a pair of perl scripts I wrote that utilize the XML::Feed module. The FB script just pulls my notifications feed, showing the top 8 stories, high-lighting important ones (i.e. from important people ;))

The Twitter script shows the top N stories (configurable) from each of the users specified (configurable). N is 2 for each of the users here. It's very easy to hit the anonymous rate limit with this script; we're only allowed 150 requests per hour which adds up fast. That geeklet only runs every 10 mins.

If you're interested in the RSS feed scripts I can certainly post them but they require the XML::Feed module (and its dependencies) which isn't installed in a stock 10.6.6 installation. The required modules would have to be installed via CPAN.

Cheers,
 

Attachments

  • geektool.jpg
    geektool.jpg
    394 KB · Views: 634
  • cal.zip
    494 bytes · Views: 191
You could try setting the locale in the shell script using the LANG environment variable. However I don't know what locale you'd specifically need. :(

I'm a noob considering this, eastern european 1250 encoding usually shows the letters. How do I setup this?
 
My first attempt (hopefully not the last!)

I just got GeekTool this morning and I have been tinkering all day. This is my first attempt ever. Contains: Unread Mail count (mail.app), time/date, weather, the iTunes readout is BowTie with the "Passed" theme.
 
I've been spending a lot of time reading the past few days, thanks guys for laying down the groundwork for those of us new to the game :).

I've done a search on this thread but I can't find an answer. I'm aware of xtacocorex's script for grabbing weather information, but it seems that it only grabs the current condition. I've looked at the xml feed and it also has forecast for the next 2 days which I would find valuable to have displayed. Is there any way to modify the script to scrape the xml feed for the forecast info too (not really well versed in python, let alone programming for that matter)? I've noticed quite a few people managed to get the forecasted conditions on their desktops and I was wondering how that's being done. Thanks!

This is what you are looking for, with regards to the forecasting.

http://www.thomasupton.com/blog/2008/04/yahoo-weather-feeds-with-python/

This is what I've based my code from. The link of mine you provided was a stripped down version of Thomas' code.
 
question

need help guys, how can i set geektool to show different pictures depend on te time?
like between 1am-6am show 1.png and between 6am-10am show 2.png.

thanks
 
need help guys, how can i set geektool to show different pictures depend on te time?
like between 1am-6am show 1.png and between 6am-10am show 2.png.

thanks

I would have a script redirect a picture to a file in /tmp that is then called up by geektool in a separate geeklet.
 
Hey folks, I'm trying to set up a quote generator, but I'm running into some issues. I'm trying to modify the following code to display only quotes from certain categories from quotedb.com.
Code:
quotesource=http://www.quotedb.com/quote/quote.php?action=random_quote

curl -s ${quotesource} |sed -e :a -e 's/<[^>]*>//g;/</N;//ba' | \
    sed -e s/document.write\(\'//g | \
    sed -e s/\'\)\;//g | \
    sed 's/More quotes from /  -- /g'| \
    sed '$!N;s/\n/ /'

On quotedb.com's quote generator page, you can change the categories in the javascript like this: http://www.quotedb.com/quote/quote.php?action=random_quote&c[126]=126&=&

That should only give you quotes from Computers. However, when I try to add the "&c[126]=126&=&" bit to the end of the quotesource variable, I don't get anything. Help?

Also, is there any way to get a drop shadow or something behind the text? My background changes every 15 min and some are very light and some are very dark, so I can't find a font that looks good on all, so if the font was, say black with a white outline, that would probably be perfect.

Just wanted to bump this...I still haven't been able to figure it out...
 
Just wanted to bump this...I still haven't been able to figure it out...

Put the URL in quotes. Like this:

Code:
quotesource='http://www.quotedb.com/quote/quote.php?action=random_quote&c[126]=126'

The ampersand (and question mark, for that matter) is a special character to the shell and needs to be quoted.

As for the drop shadow, you should be able to add shadows via the font selection dialog. For example, check the screenshot which is my weather feed pulled from wunderground. White font w/ shadows. Not sure if this is what you're looking for.
 

Attachments

  • Screen shot 2011-02-07 at 1.20.26 PM.png
    Screen shot 2011-02-07 at 1.20.26 PM.png
    416 KB · Views: 124
Put the URL in quotes. Like this:

Code:
quotesource='http://www.quotedb.com/quote/quote.php?action=random_quote&c[126]=126'

The ampersand (and question mark, for that matter) is a special character to the shell and needs to be quoted.

As for the drop shadow, you should be able to add shadows via the font selection dialog. For example, check the screenshot which is my weather feed pulled from wunderground. White font w/ shadows. Not sure if this is what you're looking for.
Tried that, but it still isn't working. Here's the original site: http://www.quotedb.com/random_quotes_generator

Don't see a place to add shadows...Color, font, etc, but no shadow...
 
Well on mine I've got:
1. Uptime total
2. Processor Usage power bar
3. Temperatures for all my HD's & processors
4. Ethernet i/o


What I really want is an indication of all the i/o traffic rates of all the data going to the clients on my network.....

Does anyone know how to do that? (im rubbish as scripting btw).
 
Tried that, but it still isn't working. Here's the original site: http://www.quotedb.com/random_quotes_generator

Ah... got it. The square brackets are also special characters to the curl program. You have to tell curl to turn off globbing with the -g switch. Try this script:

Code:
#!/bin/bash

quotesource='http://www.quotedb.com/quote/quote.php?action=random_quote&c[126]=126'

curl -s -g "${quotesource}" |sed -e :a -e 's/<[^>]*>//g;/</N;//ba' | \
    sed -e s/document.write\(\'//g | \
    sed -e s/\'\)\;//g | \
    sed 's/More quotes from /  -- /g'| \
    sed '$!N;s/\n/ /'
 
Ah... got it. The square brackets are also special characters to the curl program. You have to tell curl to turn off globbing with the -g switch. Try this script:

Code:
#!/bin/bash

quotesource='http://www.quotedb.com/quote/quote.php?action=random_quote&c[126]=126'

curl -s -g "${quotesource}" |sed -e :a -e 's/<[^>]*>//g;/</N;//ba' | \
    sed -e s/document.write\(\'//g | \
    sed -e s/\'\)\;//g | \
    sed 's/More quotes from /  -- /g'| \
    sed '$!N;s/\n/ /'
uhhhh...wut? Globbing? I really have to read up on my Unix....but thanks, that worked! :D

brenm666 said:
youre using geektool 3?
Yeah, latest version. I've tried it in different geeklets and with different fonts and nothing makes that drop shadow button appear. Also, the other buttons don't seem to do anything...for example, I can't get a strikethrough to appear.
 
I was hoping that someone could help me out. I get a DailyZen update everyday. Sometimes it's long, sometimes short. I was wondering if there's a way to have the background fill in slightly to make the text easier to read. The challenge would be to have it stretch or shrink according to the amount of text in the box. As it is right now I simply have an over-sized static box to allows for any amount of text, but with a bg it would look like kaka being as big as it is. Is this possible?

Thanks for any help.

I'm still doing a lot of tweaking, but here's my DT for now.

 
Last edited by a moderator:
Just add it to the end of each of those curl statements, outside of the parenthesis.

Code:
zip=14221 

temp_f=$(curl -s "http://xml.weather.yahoo.com/forecastrss?p=$zip&u=f" | egrep -o 'temp="[^"]*"' | sed -e 's/temp="//g' -e 's/"//g')°
temp_c=$(curl -s "http://xml.weather.yahoo.com/forecastrss?p=$zip&u=c" | egrep -o 'temp="[^"]*"' | sed -e 's/temp="//g' -e 's/"//g')°

echo "The temp in F is $temp_f, the temp in C is $temp_c"

Thanks a bunch for this. I've been faking the "o" for a while by overriding text and don't really like doing it that way, kinda cheesy.

Just for practice sake how would I change the "F" color or font or even size alone, yet in the same script that you wrote? For ex. 66°F and have the 'F' be a certain blue color or larger font size. Or would there have to be separate scripts?
 
I was hoping that someone could help me out. I get a DailyZen update everyday. Sometimes it's long, sometimes short. I was wondering if there's a way to have the background fill in slightly to make the text easier to read. The challenge would be to have it stretch or shrink according to the amount of text in the box. As it is right now I simply have an over-sized static box to allows for any amount of text, but with a bg it would look like kaka being as big as it is. Is this possible?

Thanks for any help.

I'm still doing a lot of tweaking, but here's my DT for now.


Pretty sure you can't have dynamically sized boxes. This would be an awesome feature of GeekTool if we could do it.

Would drop shadows help? If you enable shadows in the font dialog it may make it easier to read.

BTW awesome desktop! That's one of busiest menubars I've ever seen. :D What is the bar right below the menu bar (with Apps, Folders, etc)? Just curious.
 
Thanks a bunch for this. I've been faking the "o" for a while by overriding text and don't really like doing it that way, kinda cheesy.

Just for practice sake how would I change the "F" color or font or even size alone, yet in the same script that you wrote? For ex. 66°F and have the 'F' be a certain blue color or larger font size. Or would there have to be separate scripts?

Now way to change the font for different output of the same script. You can change the color using ANSI escape sequences, however the color selection is limited. If you want the 'F' to be larger font size and/or a different color, you're best off to use a separate geeklet. You don't need to run an actual script to get the 'F'; use a script geeklet w/ nothing in the "command" box, and below that check off the "override text" box and put the 'F' in there (no quotes), and choose the font/color that you desire.
 
Does anybody here that uses geektool notice that it causes any loss in performance/battery life?

I'm using GeekTool 3 on 10.6.6.

It uses a rather massive amount of memory. According to Activity Monitor, my GeekTool (which has been running a week or so straight) is consuming 1.43GB of "Real Mem". I have 5 script geeklets that run every few mins, 1 image geeklet that's updated every few mins (a weather map), and a couple of static geeklets that are just there to hold static texts or images. 8 geeklets total. 1.43GB.

Smells like a massive memory leak to me.
 

Attachments

  • Screen shot 2011-02-10 at 12.04.44 PM.png
    Screen shot 2011-02-10 at 12.04.44 PM.png
    95.7 KB · Views: 171
Last edited:
Thanks f00f,
As far as using "override text", that's what I've done for the blue "°", but was just wondering if there was an alternative way or "the right way" since I guess most of the time.

I tried using a shadow, but it didn't help at all.

The "Apps, Folders, etc" is a simply Dragthing menu. Same with the "Processes" one off to the center left. Since I posted the pic I've also eliminated the drives from the desktop and made another Dragthing menu in the upper right that contains them. I like the idea of drop downs and utilizing the menu bar. I like the desktop to look simple and uncluttered, yet functional.
 
...

The "Apps, Folders, etc" is a simply Dragthing menu. Same with the "Processes" one off to the center left. Since I posted the pic I've also eliminated the drives from the desktop and made another Dragthing menu in the upper right that contains them. I like the idea of drop downs and utilizing the menu bar. I like the desktop to look simple and uncluttered, yet functional.

Not to get too far off-topic but I totally agree about having an uncluttered desktop. Mine's pretty out of control at the moment & I've been hunting for clean solutions. DragThing looks awesome, bummer it's not in the App Store. I'll be checking it out for sure. Thanks for the tip!
 
I'm using GeekTool 3 on 10.6.6.

It uses a rather massive amount of memory. According to Activity Monitor, my GeekTool (which has been running a week or so straight) is consuming 1.43GB of "Real Mem". I have 5 script geeklets that run every few mins, 1 image geeklet that's updated every few mins (a weather map), and a couple of static geeklets that are just there to hold static texts or images. 8 geeklets total. 1.43GB.

Smells like a massive memory leak to me.

i have a good 18 shell geeklets running, plus 3 image geeklets (and almost 10 "sleeping"). geektool's been running for 3 days straight. even when i update them all at the same time, its doesnt go gigher than 125 MB of real memory... so on my side, 20+ geeklets : 125 MB.
all depends how you use them i guess...
 

Attachments

  • Screen shot 2011-02-10 at 2.34.30 PM.png
    Screen shot 2011-02-10 at 2.34.30 PM.png
    26.9 KB · Views: 199
  • Screen shot 2011-02-10 at 2.44.09 PM.jpg
    Screen shot 2011-02-10 at 2.44.09 PM.jpg
    138.1 KB · Views: 634
Status
Not open for further replies.
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.