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 fixed my first issue by re-reading a guide to geektool I found somewhere, it works just fine now - thanks for your help guys.

I have a second query, is it possible to write a script that changes position if an external display is connected? I have my cinema display as my main display at home, and when I use my laptop without it, I lose my time & battery info due to their position on the far right of my screen.

If possible, I think it would be easier to have a script that is triggered when the external monitor is plugged in/not plugged in that activates/deactivates a group within GeekTool.

i.e.
Monitor In - Group 1 = off / Group 2 = on
Monitor Out - Group 1 = on / Group 2 = off

The same scripts would be in both groups, just have different positions for the different screens.
 
If possible, I think it would be easier to have a script that is triggered when the external monitor is plugged in/not plugged in that activates/deactivates a group within GeekTool.

i.e.
Monitor In - Group 1 = off / Group 2 = on
Monitor Out - Group 1 = on / Group 2 = off

The same scripts would be in both groups, just have different positions for the different screens.

Awesome! I'm working on the applescript for that now - but I don't know how to do the monitor connection bit... Google time I think...
 
Alright here's my latest geektool question. I'm not sure if it's possible I assume it may be but I have no idea how.

As you can see in my screenshot a few posts above I use bowtie as my itunes display. Occasionally I'll listen to music through Pandora with the app PandoraJam. I already know that I can get my iTunes music to display through geektool, and since my bowtie theme is so simple I assume it could be duplicated perfectly. I was curious if I could somehow pull the same information out of PandoraJam, Song Title and Artist Name to display through Geektools.

I know it can't be done through bowtie and when I'm listening to music in Pandora I feel like it's missing something, and I dislike having to open the app to check the song name, especially when I've become accustomed to just looking at my desktop.
 
Here is my new desktop after scanning through all 104 pages of this thread. I put together a custom script I haven't seen anyone do yet so I thought it would be worth posting. So going down the left side we have:

1) The fancy clock everyone likes so much. There has already been a nice tutorial posted on how to do this a few pages back

2) This is the week's astronomical events that might interest amateur astronomy nerds with telescopes might enjoys seeings. It's scraped from http://www.skyandtelescope.com/observing/ataglance?1=1 although it could use some help if anyone cares to edit the script. A) some dates have multiple bullet points, and it looks like the images on the right side of the web page interfere with my script. B) it would be nice to be able to bold the dates, or change their colors, or something. here is the code I have so far

Code:
curl "http://www.skyandtelescope.com/observing/ataglance?1=1" | egrep -m 9 -A 2 '(Friday)|(Saturday)|(Sunday)|(Monday)|(Tuesday)|(Wednesday)|(Thursday)' | sed -e "s/<b>/¿/" -e "s_</b>__" -e "s_</p>__g" -e "s/<p>//g" -e "s/<li> /¿¿/g" -e "s/°/°/" -e "s/ &#151;/ -/g" -e "s_</a>__" -e "s_<a href=.*>__" -e "/begin.*>/d" -e "/<div.*>/d" -e "/<img.*>/d" -e '/-->/d' -e '/end Media/d' -e "/<\/div>/d" -e "s/<!--//g" -e '/--/d' | tr '¿' '\n'

3) The section on the bottom host a custom applescript app I made to add RSS subscriptions for TV shows to "Automatic" and the folder to process artwork for said TV shows. Below it the like of type you cane barely make out is the status of handbrake cli which has been set in motion by an automator action. It's much easier to make out at full 2560x1440 ;)
 

Attachments

  • DTP.jpg
    DTP.jpg
    781.8 KB · Views: 574
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 recieved.

Screenshot2010-11-20at120203AM.png


Hey ppl can you tell me plz how can i have custom background icon like that plz? (itunes email and all). tx
 
Last edited by a moderator:
Awesome! I'm working on the applescript for that now - but I don't know how to do the monitor connection bit... Google time I think...

I'm interested in what, if any, outcome this will have. Could open up some great possibilities for "content/hardware-aware" geeklets!

Ok.. So in theory I was thinking this should work.

A apple script that would find your location via ip:
http://www.ipaddresslocation.org/
My IP Location (Guessed City) shows your city

Then send that too yahoo or whoever:

http://www.wunderground.com/cgi-bin/findweather/getForecast?query=Location

Right?
Then throw that to Geektool somehow?

Ok as for how to do it, I have no idea, I'm not a coder :\

Sounds like it should work in theory.

To both, I would love to delve more into solving, but I'm in the last 10 days of my undergrad and a little strung out. Can't wait for December when I can spend hours on end learning more about how all this "computer-speak" really works.

Hey ppl can you tell me plz how can i have custom background icon like that plz? (itunes email and all). tx

Most people use CandyBar for changing icons, but there are alternatives. Just google "OS X custom icons".
 
I'm interested in what, if any, outcome this will have. Could open up some great possibilities for "content/hardware-aware" geeklets!

To both, I would love to delve more into solving, but I'm in the last 10 days of my undergrad and a little strung out. Can't wait for December when I can spend hours on end learning more about how all this "computer-speak" really works..

So far the outcome has been a headache and a (rather one sided) shouting match between me and the MacBook. However I am going back to my cinema display today so I should be able to find the actual "event" of plugging in the display that I can link to an applescript, that can then be linked to switching on and off different geeklets. (In theory.)
 
Hey ppl can you tell me plz how can i have custom background icon like that plz? (itunes email and all). tx

The icon set is called Gill Sans. I used Candybar to apply them. The Mail count and clock as well as the black bar standing in as a "dock" were all from GeekTools. I used Mirage to make the old dock invisible. And I use Bowtie to display my itunes songs on the desktop.
 
Hi,

I'm pretty much new to geektool, and that's just awesome, thx brenm666.

I was wondering if one of you know how to have skype contact list with geektool.

Thanks,
 
The icon set is called Gill Sans. I used Candybar to apply them. The Mail count and clock as well as the black bar standing in as a "dock" were all from GeekTools. I used Mirage to make the old dock invisible. And I use Bowtie to display my itunes songs on the desktop.


Tx a lot that's what i'm looking for ^^
 
No problem ;-)

Underneath you'll find the written forecast. I've been looking for the multiple warnings but for some reason there is only 1 warning today. =D
So waiting for more warnings and then I can poke around to get it right.

enjoy.

This scripts shows you the first warning (for now) and the written forecast (today's evening, tomorrow and tomorrows evening)
Code:
tell application "Finder"
	
	
	set web_content to do shell script "curl \"http://forecast.weather.gov/MapClick.php?map.x=225&map.y=66&site=oun&zmx=1&zmy=1\""
	-- this is the warning!!
	set AppleScript's text item delimiters to "<span class=\"warn\">"
	set warn to text item 2 of (web_content as string)
	set AppleScript's text item delimiters to "</span>"
	set warn to text item 1 of warn
	set AppleScript's text item delimiters to ""
	
	-- forecast for the oncomming days.
	set AppleScript's text item delimiters to "</span></a><br></div><br> "
	set forecast to paragraphs 2 thru end of (text item 2 of (web_content as string))
	set AppleScript's text item delimiters to "<br><br></td>"
	set forecast to text item 1 of (forecast as string)
	set AppleScript's text item delimiters to "<br><br><b>"
	set forecast to (text item 1 of forecast) & return & (text item 2 of forecast) & return & (text item 3 of forecast)
	set AppleScript's text item delimiters to "</b>"
	set forecast to every text item of forecast
	set AppleScript's text item delimiters to "<b>"
	set forecast to every text item of (forecast as string)
	set AppleScript's text item delimiters to ""
	
	return (warn & return & return & forecast as string)
end tell

Hi, need help on this. It seems to work when theres a "warning" but fails when there is no warning for the area.
 
Ok.. So in theory I was thinking this should work.

A apple script that would find your location via ip:
http://www.ipaddresslocation.org/
My IP Location (Guessed City) shows your city

Then send that too yahoo or whoever:

http://www.wunderground.com/cgi-bin/findweather/getForecast?query=Location

Right?
Then throw that to Geektool somehow?

Ok as for how to do it, I have no idea, I'm not a coder :\

Just ran a quick test without scripting this. ipaddresslocation.org responded with "Marion" for my location, so when I put Marion in place of Location in your url for wunderground, I get a list of everywhere that has Marion as a city.

There was an advanced find on the ipaddresslocation.org website: http://www.ipaddresslocation.org/ip-address-locator.php, but this is unable to be downloaded with curl properly as I tried.

If an ip address grabber returned City and State, that could be fed into the wunderground url and get it to work, otherwise you'd have to hardcode the state in the url (which would work in a desktop setting).
 
Anyone know if it's possible to write an applescript that displays text in capital letters. I'm looking to make my itunes display in geektools all capitals.

Thanks.
 
hi i'm new to geektool and i've been tryign to set up an RSS feed on my desktop using reuters (URL="http://feeds.reuters.com/reuters/topNews.rss") but my feed keeps showing up with HTML, can anyone tell me what i'm doing wrong? i used the standard scrpt


#!/bin/sh

URL="http://feeds.reuters.com/reuters/topNews.rss"

if [ $# -eq 1 ] ; then
headarg=$(( $1 * 2 ))
else
headarg="-8"
fi

curl --silent "$URL" | grep -E '(title>|description>)' | \
sed -n '4,$p' | \
sed -e 's/<title>//' -e 's/<\/title>//' -e 's/<description>/ /' \
-e 's/<\/description>//' | \
sed -e 's/<!\[CDATA\[//g' |
sed -e 's/\]\]>//g' |
sed -e 's/<[^>]*>//g' |
head $headarg | sed G | fmt

thanks! :)

edit: attached pic

http://i.imgur.com/UKLTH.png
 
hi i'm new to geektool and i've been tryign to set up an RSS feed on my desktop using reuters (URL="http://feeds.reuters.com/reuters/topNews.rss") but my feed keeps showing up with HTML, can anyone tell me what i'm doing wrong? i used the standard scrpt


#!/bin/sh

URL="http://feeds.reuters.com/reuters/topNews.rss"

if [ $# -eq 1 ] ; then
headarg=$(( $1 * 2 ))
else
headarg="-8"
fi

curl --silent "$URL" | grep -E '(title>|description>)' | \
sed -n '4,$p' | \
sed -e 's/<title>//' -e 's/<\/title>//' -e 's/<description>/ /' \
-e 's/<\/description>//' | \
sed -e 's/<!\[CDATA\[//g' |
sed -e 's/\]\]>//g' |
sed -e 's/<[^>]*>//g' |
head $headarg | sed G | fmt

thanks! :)

edit: attached pic

http://i.imgur.com/UKLTH.png

Decided to modify the Digg News grabber that I wrote for someone to do a general news grabber.

Save the following as gen_news_grabber.py and chmod +x the file to make it executable.
Code:
#!/usr/bin/env python

# MODULE IMPORTS
import xml.dom.minidom
import re

# CLASS TO HOLD THE DATA FOR A TO DO GROUP
class NewlistItem():
    def __init__(self):
        self.title = ""
        self.link = ""
        self.desc = ""
        self.pubdate = ""

# GET THE FEED - UPDATE TO CMD LINE ARGUMENT
# BE SURE TO HAVE THE URL REDIRECT THE URL FROM THE COMMAND LINE WITH 
# THE FOLLOWING COMMAND
# curl --silent "url goes here in quotations or else it won't work" > /tmp/news_feed.xml
dom = xml.dom.minidom.parse("/tmp/news_feed.xml")

# LIST TO HOLD ALL THE TASKS (toDo CLASS)
Newslist = []

# INLINE FUNCTIONS - DON'T FEEL LIKE CLASSING THIS UP
def getText(nodelist):
    rc = []
    for node in nodelist:
        if node.nodeType == node.TEXT_NODE:
            rc.append(node.data)
    return ''.join(rc)

def handleFeed(feed,Newslist):
    items = feed.getElementsByTagName("item")
    handleNewsItem(items,Newslist)

def handleNewsItem(items,Newslist):
    for item in items:
        # CREATE TEMPORARY TODO
        tmpCls = NewlistItem()
        # GET THE DATA FROM THE CURRENT ITEM
        title = item.getElementsByTagName("title")[0]
        link = item.getElementsByTagName("link")[0]
        pubdate = item.getElementsByTagName("pubDate")[0]
        desc = item.getElementsByTagName("description")[0]
        # GET THE VALUES FROM THE TAGS
        tmpCls.title = getText(title.childNodes).strip()
        tmpCls.link = getText(link.childNodes).strip()
        tmpCls.desc = getText(desc.childNodes).strip()
        tmpCls.pubdate = getText(pubdate.childNodes).strip()
        # APPEND TEMP NEWS CLASS TO NEWS LIST
        Newslist.append(tmpCls)
        
# HANDLE THE XML
handleFeed(dom,Newslist)

# PRINT OUT THE TASKS
# THIS IS CUSTOMIZABLE
for i in range(len(Newslist)):
    # PRINT OUT THE DATA HOWEVER YOU WANT
    # DATA STORED IN EACH Newlist SEGMENT
    # Newlist[i].title   = TITLE OF THE NEWS ITEM
    # Newlist[i].desc    = DESCRIPTION OF THE NEWS ITEM
    # Newlist[i].link    = NEWS ITEM LINK
    # Newlist[i].pubdate = DATE THE NEWS ITEM WAS PUBLISHED
    # CURRENTLY SET TO PRINT THE TITLE
    print "- "+Newslist[i].title

For the geektool command window, use the following code:
Code:
curl --silent http://feeds.reuters.com/reuters/topNews.rss > /tmp/news_feed.xml;
python /path/to/script/gen_news_grabber.py

Here is some sample output:
Code:
- U.S. aircraft carrier heads for Korean waters
- Airlines low key in U.S. security controversy
- Teetering Irish government to set out 4-year plan
- Obama: eager to extend middle-class tax cuts
- All 29 trapped miners in New Zealand dead: police
- Oracle ruling tarnishes SAP's U.S. reputation
- Protests in Kabul as Afghan poll results released
- FBI raids send warning to hedge funds
- China turns up heat on Taiwan to talk politics
- Appeal trial for Briton sex murder starts in Italy
 
Decided to modify the Digg News grabber that I wrote for someone to do a general news grabber.

Save the following as gen_news_grabber.py and chmod +x the file to make it executable.
Code:
...

For the geektool command window, use the following code:
Code:
...

Here is some sample output:
Code:
...

ok, first. wow... you're a god.
but theres a few things id like to understand. first, I cant add another Newlist to the print part of your python script. when I put +Newlist.pubdate at the end for example, it doesnt work. also, how are the feeds ordered? it doesnt seem to be chronologically, anyway to show it this way? last but not least, i'd like to put a facebook notifications on my desktop. since FB is giving an rss feed, i thought it might of worked, but it doesnt. heres what the feed looks like:
Code:
feed://www.facebook.com/feeds/notifications.php?id=111111111&viewer=111111111&key=1a2b3c4d5e&format=rss20
if it could work, you would be even more of a god... hehe

thanks again! you rock!


edit: and what about showing only a few feeds? like 5 instead of 10 for example...
 
ok, first. wow... you're a god.
but theres a few things id like to understand. first, I cant add another Newlist to the print part of your python script. when I put +Newlist.pubdate at the end for example, it doesnt work. also, how are the feeds ordered? it doesnt seem to be chronologically, anyway to show it this way? last but not least, i'd like to put a facebook notifications on my desktop. since FB is giving an rss feed, i thought it might of worked, but it doesnt. heres what the feed looks like:
Code:
feed://www.facebook.com/feeds/notifications.php?id=111111111&viewer=111111111&key=1a2b3c4d5e&format=rss20
if it could work, you would be even more of a god... hehe

thanks again! you rock!


edit: and what about showing only a few feeds? like 5 instead of 10 for example...


First: Display only 5 Feeds
Replace
Code:
for i in range(len(Newslist)):
With
Code:
for i in range(0,5):

Second: Display Pub Date
Replace
Code:
    print "- "+Newslist[i].title
With
Code:
    print "- "+Newslist[i].pubdate+": "+Newslist[i].title
The pubdate will display all the date information, ie "Wed, 24 Nov 2010 07:14:28 -0500"

Third: Chronological Order
I'm parsing the xml from the top down, so it's in order of how it came out of the feed generator. I wrote some code to sort on the pubdate.

In fact, here is the entire updated code. Replace what you have with this new code:
Code:
#!/usr/bin/env python

# MODULE IMPORTS
import xml.dom.minidom
import re

# CLASS TO HOLD THE DATA FOR A TO DO GROUP
class NewlistItem():
    def __init__(self):
        self.title = ""
        self.link = ""
        self.desc = ""
        self.pubdate = ""
    def __repr__(self):
        return repr((self.title, self.link, self.pubdate))

# GET THE FEED - UPDATE TO CMD LINE ARGUMENT
# BE SURE TO HAVE THE URL REDIRECT THE URL FROM THE COMMAND LINE WITH 
# THE FOLLOWING COMMAND
# curl --silent "url goes here in quotations or else it won't work" > /tmp/news_feed.xml
dom = xml.dom.minidom.parse("/tmp/news_feed.xml")

# LIST TO HOLD ALL THE NEWS
Newslist = []

# INLINE FUNCTIONS - DON'T FEEL LIKE CLASSING THIS UP
def getText(nodelist):
    rc = []
    for node in nodelist:
        if node.nodeType == node.TEXT_NODE:
            rc.append(node.data)
    return ''.join(rc)

def handleFeed(feed,Newslist):
    items = feed.getElementsByTagName("item")
    handleNewsItem(items,Newslist)

def handleNewsItem(items,Newslist):
    for item in items:
        # CREATE TEMPORARY TODO
        tmpCls = NewlistItem()
        # GET THE DATA FROM THE CURRENT ITEM
        title = item.getElementsByTagName("title")[0]
        link = item.getElementsByTagName("link")[0]
        pubdate = item.getElementsByTagName("pubDate")[0]
        desc = item.getElementsByTagName("description")[0]
        # GET THE VALUES FROM THE TAGS
        tmpCls.title = getText(title.childNodes).strip()
        tmpCls.link = getText(link.childNodes).strip()
        tmpCls.desc = getText(desc.childNodes).strip()
        tpubdate = getText(pubdate.childNodes).strip()
        
        # REMOVE GMT OFFSET FROM PUBDATE
        tmpCls.pubdate = tpubdate.split(" -")[0]
        
        # APPEND TEMP NEWS CLASS TO NEWS LIST
        Newslist.append(tmpCls)
        
# HANDLE THE XML
handleFeed(dom,Newslist)

# SORT BY PUBDATE
Newslist = sorted(Newslist, key=lambda newlist: newlist.pubdate)

# PRINT OUT THE TASKS
# THIS IS CUSTOMIZABLE
#for i in range(len(Newslist)):
for i in range(0,5):
    # PRINT OUT THE DATA HOWEVER YOU WANT
    # DATA STORED IN EACH Newlist SEGMENT
    # Newlist[i].title   = TITLE OF THE NEWS ITEM
    # Newlist[i].desc    = DESCRIPTION OF THE NEWS ITEM (NOT PARSED CORRECTLY, WOULDN'T PRINT TO SCREEN
    # Newlist[i].link    = NEWS ITEM LINK
    # Newlist[i].pubdate = DATE THE NEWS ITEM WAS PUBLISHED
    # CURRENTLY SET TO PRINT THE TITLE
    print "- "+Newslist[i].pubdate+": "+Newslist[i].title

Fourth: Facebook
Don't think Facebook feed will work. When I tried to curl the feed, it returned nothing in the file I had redirected from the command line.
 
First: Display only 5 Feeds
Replace
Code:
...
With
Code:
...

Second: Display Pub Date
Replace
Code:
...
With
Code:
...
The pubdate will display all the date information, ie "Wed, 24 Nov 2010 07:14:28 -0500"

Third: Chronological Order
I'm parsing the xml from the top down, so it's in order of how it came out of the feed generator. I wrote some code to sort on the pubdate.

In fact, here is the entire updated code. Replace what you have with this new code:
Code:
...

Fourth: Facebook
Don't think Facebook feed will work. When I tried to curl the feed, it returned nothing in the file I had redirected from the command line.
works like a charm, thanks again.
and for the facebook, well ill continue searching for a way to do it! :D

heres my brand new desktop btw. pretty much the same scripts than before, but a new image.
 

Attachments

  • Screen shot 2010-11-24 at 4.15.58 PM.jpg
    Screen shot 2010-11-24 at 4.15.58 PM.jpg
    304.3 KB · Views: 607
Hey, just in case someone would like to see it :p

It has, from the top-left:

1) The weather (icon, weather description, temperature) and time (through Yahoo weather).

2) Adium contact list (this isn't Geektool, just Adium set up to be clear). It would go all the way down to the next section if more people were currently on facebook.

3) My top processes, IP, RAM and CPU stats.

4) Itunes info (including album cover).

5) My to-do list from Things.

6) My event list from BusyCal.

7) Lyrics from iTunes (I use songgenie to get them).

I think it's the most attractive thing I've ever made. I'm not a designer :p. But I just found Geektool last night, so I think I did okay for one day. Haha. Great software :).

- Submerged06

P.S. The original background is from http://cozmicboy.deviantart.com/art/smokey-colors-71400763.

P.P.S. Let me know if you want any of the code I used, I can post it up here if someone wants it.
 

Attachments

  • screenshot_01 23-29-49.jpg
    screenshot_01 23-29-49.jpg
    177.5 KB · Views: 427
Hey, just in case someone would like to see it :p
snip
I think it's the most attractive thing I've ever made. I'm not a designer :p. But I just found Geektool last night, so I think I did okay for one day. Haha. Great software :).

- Submerged06

P.S. The original background is from http://cozmicboy.deviantart.com/art/smokey-colors-71400763.

P.P.S. Let me know if you want any of the code I used, I can post it up here if someone wants it.

Pretty good work in such a short time, but way too busy for my tastes.
 
Pretty good work in such a short time, but way too busy for my tastes.

Fair enough :). I rarely ever have my desktop showing, so I figured I might as well fill it up with "quick glance" material for use with expose. Especially the to-do list, saves from having to load that program except to edit it. But to all their own :D.
 
Status
Not open for further replies.
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.