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.
Can I have the script you used for the stocks quotes that change red and green? I think that's pretty awesome.

Hi antcuc,

It's actually just a simple workaround. You make two scripts laid on top of each other, one in green and one in red. Then you configure the red one not to print anything if the stock has gone up and green one not to print anything if the stock has gone down.

So, take a general stock quote script. Here's mine for the DOW:

curl http://www.google.ca/finance?q=INDEXDJX:.DJI | sed -n '/price-panel style/,/ Close/p' | sed -e :a -e 's/<[^>]*>//g;/</N;//ba'| sed '/^$/d' | sed -e '$!N;s/\n/ /' -e '$!N;s/\n/ /' | head -1 | sed 's/^/DOW: /g'

That outputs: DOW: 9,256.26 -24.71 (-0.27%)

Now copy it so you have two.

Then add this to the end of the one you make red:
| sed -n '/-/p'
That makes it so it will only print lines where a "-" appears, so it'll only give the output if things went south that day.

Then, add this one to the one that you make green:
| sed '/-/d'
That'll delete the output if a "-" appears, so it'll only print if the index went up or stayed put.

Since, you're just modifying the format of the two scripts, you can have any change occur depending on whether things went up or down. You could have the background change colour or tranparency. You could change the font, size, whatever.

Hope that helps, let me know if you have any other questions.

(Oh yeah, and to make this work for other stocks, you just have to change the link in the original curl script, and then change the label that you give it at the end of the script)
 
I'm new to using GeekTool (I downloaded it yesterday and have had lots of fun with it so far) and I was wondering about installing the Lynx web browser. I understand to get the cool looking weather items on your desktop, among other goodies, you need to download the Lynx browser.

So, after I download Lynx is that it? Just copy some cool Lynx codes and use them in/thru GeekTool? Do I just keep the browser on my system and do nothing with it? Or do I have to do something else with Lynx so I can use it with GeekTool?

Thanks for your help!
 
Hi antcuc,

It's actually just a simple workaround. You make two scripts laid on top of each other, one in green and one in red. Then you configure the red one not to print anything if the stock has gone up and green one not to print anything if the stock has gone down.

So, take a general stock quote script. Here's mine for the DOW:

curl http://www.google.ca/finance?q=INDEXDJX:.DJI | sed -n '/price-panel style/,/ Close/p' | sed -e :a -e 's/<[^>]*>//g;/</N;//ba'| sed '/^$/d' | sed -e '$!N;s/\n/ /' -e '$!N;s/\n/ /' | head -1 | sed 's/^/DOW: /g'

That outputs: DOW: 9,256.26 -24.71 (-0.27%)

Now copy it so you have two.

Then add this to the end of the one you make red:
| sed -n '/-/p'
That makes it so it will only print lines where a "-" appears, so it'll only give the output if things went south that day.

Then, add this one to the one that you make green:
| sed '/-/d'
That'll delete the output if a "-" appears, so it'll only print if the index went up or stayed put.

Since, you're just modifying the format of the two scripts, you can have any change occur depending on whether things went up or down. You could have the background change colour or tranparency. You could change the font, size, whatever.

Hope that helps, let me know if you have any other questions.

(Oh yeah, and to make this work for other stocks, you just have to change the link in the original curl script, and then change the label that you give it at the end of the script)

Hey zzzzzzzzz, your script is clever and works amazingly well! thanks for posting it dude you rock!
 
Where is a good site to find free fonts? I'm just starting to do this, and it's really a bunch of fun lol.
 
This code should put the memory info all on one line. Haven't tried to do it with line breaks yet.

Code:
top -ocpu -l1 | grep 'PhysMem' | sed 's/PhysMem:  *//'
You rock! That worked perfectly. I'll see if there's a way to break the lines at the commas and remove the period, but you know what, this looks much better as one line. Thanks again! What's a safe interval for retrieving the information that won't weigh down the processor, but will still be close enough to accurate? I notice it takes a few seconds to get the info in the Terminal. So I'd want it to be every few minutes. How is 2 minutes? Or should I try for like 5?
 
Here's mine:

3791882178_b3317e1393_o.jpg


I've tried having processes scripts and weather scripts, but I can never seem to get used to it so I always tend to go back to the simple scripts. I'm happy with this for now.
I really like that wallpaper can I get a link to where you got it?
 
Ok so I have this code here for my calender, what to I have to change to make it all on one line? Right now the end of the month is on a nether line.

cal | sed -e '1d' -e '2p;2p;2p;2p' | sed -e '$!N;s/\n/ /' -e '$!N;s/\n/ /' -e '$!N;s/\n/ /' -e '$!N;s/\n/ /' | sed "s/^/ /;s/$/ /;s/ $(date +%e) /\|$(date +%e)\|/"

never mind I found what i needed to to on a nether page.
 
Here this is what I've whipped up. I just started using Geektool about 5 hours ago. So any hints/tips would be nice. (like how to straighten out the columns in the CPU/RAM displays.( I personally think its a Geektool 3 issue since i could get accurate columns in GT2 but it limited me in other areas. though i would like to dabble in a calendar and have it atleast look nice. =P Anyways here you are. =D

animateddesktop.png


PS. for anyone who doesn't recognize thats Adium on the left side and a growl in the bottom right.
 
with some experimenting i came up with this

Quote by itself:
Code:
curl http://encarta.msn.com/encnet/feeds/rssfeed.aspx?type=quote | grep description | sed 's/^[ \t]*//' | sed -e :a -e 's/<[^>]*>//g;/</N;//ba' | cut -d - -f 1

Author by itself:
Code:
curl http://encarta.msn.com/encnet/feeds/rssfeed.aspx?type=quote | grep description | sed 's/^[ \t]*//' | sed -e :a -e 's/<[^>]*>//g;/</N;//ba' | sed 's/.*\(-\)/-/'

If anyone can figure out how to keep the quote and author together that would be nice but this method has it's formatting advantages too.

quoteday.jpg


EDIT:
Here is the code for the quote all on one line but I can't figure out how to add a line break for the "-author's name"

Code:
curl http://encarta.msn.com/encnet/feeds/rssfeed.aspx?type=quote | grep description | sed 's/^[ \t]*//' | sed -e :a -e 's/<[^>]*>//g;/</N;//ba'

What font are you using for the quote? Your setup looks really nice!
 
Facebook notifications

I know there is already a way to get facebook notifications. Here is my version that skips the use of automator.

$ curl "http://your url here" -A "Mozilla/4.0" | grep 'title' | egrep '(commented|your Wall)' | sed -e 's/\<title\>//' -e 's/\<\/title\>//' -e "s/\&apos\;/'/" -e 's/ //' | head -n 4

The url you must have to use this can be obtained by clicking the notifications button on the lower right hand corner of any facebook page. From there click on show all. This should send you to a new page. Click the link for "Your notifications" on the right side of the screen. Now this should send you to a new page. Copy the url and paste that into your url here. To change the number of notifications shown change the last number in the code. It is currently set to show 4.

You must replace feed:// (from the facebook url) with http:// otherwise this will not work.

That should work to show facebook notifications if not write back and I'll try my best to help troubleshoot.
 
little update

Hi all so my desktop has dramatically changed over night. i took things from everywhere and i'd like to thank anyone whos script, background, ideas inspired me.

This is what i have so far.

remixeddesktop.png


Also, I have been having trouble with getting things like standard calendars and columns to work. they appear in unorganized. like they do not follow a straight line. I mentioned this before but i thought it was a Geektool 3 issue. since then i've downgraded to Geektool 2 but continue to have this problem. Any help would be much appreciated.

EDIT: I'll also be adding a text document with all the codes i have managed to get working for me. they will include the code and also the fonts i used to display them for those curious.
 
Also, I have been having trouble with getting things like standard calendars and columns to work. they appear in unorganized. like they do not follow a straight line. I mentioned this before but i thought it was a Geektool 3 issue. since then i've downgraded to Geektool 2 but continue to have this problem. Any help would be much appreciated.
A screen shot of what you are talking about would help in regards to your misaligned columns.
 
Also, I have been having trouble with getting things like standard calendars and columns to work. they appear in unorganized. like they do not follow a straight line. I mentioned this before but i thought it was a Geektool 3 issue. since then i've downgraded to Geektool 2 but continue to have this problem. Any help would be much appreciated.

EDIT: I'll also be adding a text document with all the codes i have managed to get working for me. they will include the code and also the fonts i used to display them for those curious.

While I can't offer a whole lot of help without a screenshot, it sounds like the problem of the columns is due to not using fixed width fonts (like monaco). Mt suggestion is to try this and if teh columns align properly go to DaFont's fixed width section here for some much more aesthetically pleasing fixed width fonts

Hope this helps.
 
weather...grrr

Code:
lynx -dump http://printer.wunderground.com/cgi-bin/findweather/getForecast?query=40241|awk '/Temp/{printf $2, ": "; for (i=3; i<=3; i++) printf $i " " }' |awk '{print $1}'

this is the code for the weather that i'm trying to use that seems to be working for everyone, however, nothing shows up at all. and i've tried the one with out the little bit of text added at the end.

the script for the current conditions works fine, which affirms my belief that lynx command has nothing to do with it.

i have no idea how to fix this, or what's wrong, and would love some help.

here's a screenshot of it. http://ianapoc.deviantart.com/art/Need-Help-with-Geektool-132903428
 
I've been having a lot of trouble with getting an RSS feed to work.
I've been using this script, which is the one I've been seeing most referenced in FAQs around the web.

Code:
#!/bin/sh

URL="http://www.gp.se/rss/index.jsp?d=102"

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

Which I launch using "sh /pathtoscript -4"

Now, if you check out the actual RSS feed, you'll notice that it features nordic characters: åäö.

These are omitted from the output. So I tried with "sh /pathtoscript -4 | \iconv -f utf-8 -t ucs-2-internal", which many had recommended. Still no luck.

I'm thinking the problem lies with curl rather than Geektool, but I can't find any way to solve it since most people just reference the iconv command as a solution.

Has anyone got an RSS-script that can return international characters properly? Or a way to fix mine?
 
Here are the GeekTool scripts I'm using on my desktop. I want to take a screen shot and post that here but I'm running 2560 x 1600 resolution and the file is too big to upload to the forum. Can anyone tell me how to lower my screen capture picture file resolution to fit under the file upload requirements to post here? Thanks.

Time (i.e. 07:30):
date +"%I:%M"

AM/PM:
date +"%p"

Month:
date +%B

Date Number:
date +%d

Day of the Week:
date +%A

Memory/RAM Usage:
top -l 1 | awk '/PhysMem/ {print "Memory: " "Used: " $8 " \n Free: " $10}'

Top Processes:
top -ocpu -FR -l2 -n20 | grep '^....[1234567890] ' | grep -v ' 0.0% ..:' | cut -c 1-24,33-42,64-77

Trivia/What Happened on this date:
curl http://www.infoplease.com/rss/dayinhistory.rss | grep CDATA | sed -e 's/\(.*\[\)//' -e 's/\].*//'

Weather for specific location:
Vertically listed as: City, State; Current Conditions and Temp; Forecast in one whole section:
echo "Kailua-Kona, HI"
curl --silent "http://xml.weather.yahoo.com/forecastrss?p=96734&u=f" | grep -e "Current Conditions" -A 1 | tail -n 1 | sed -e 's/<BR \/>//'
curl --silent "http://xml.weather.yahoo.com/forecastrss?p=96734&u=f" | grep -e "Forecast:" -A 2 | tail -n 2 | sed -e 's/<br \/>//' -e 's/<BR \/>//' | sed "s/\(.*\)\.\ \(.*\)/\1\?\2/" | tr "?" "\n" | sed "s/High\:\ \(.*\)\ Low\:\ \(.*\)/\?H\: \1\ L\:\ \2/" | sed "s/\?\(.*\)/\\1/"

Horizontal Calendar:
cal | sed -e '1d' -e '2p;2p;2p;2p;2p' | sed -e '$!N;s/\n/ /' -e '$!N;s/\n/ /' -e '$!N;s/\n/ /' -e '$!N;s/\n/ /' -e '$!N;s/\n/ /' | sed "s/^/ /;s/$/ /;s/ $(date +%e) / $(date +%e | sed 's/././g') /"
 
Here are the GeekTool scripts I'm using on my desktop. I want to take a screen shot and post that here but I'm running 2560 x 1600 resolution and the file is too big to upload to the forum. Can anyone tell me how to lower my screen capture picture file resolution to fit under the file upload requirements to post here? Thanks.

Open the image in "Preview" and go the the menu item "Tools" then select "Adjust Size" and set as needed
 
need inspiration

right, this is my first attempt:
Picture2.png


then i had a complete change of heart. i'm looking for some inspiration to fill the obvious gap on the left hand side. anyone got any ideas?
Picture1.png
 
Status
Not open for further replies.
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.