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.
well I would just use an extra shell geeklet...

ok thanks, i thought about that. but is there a way in only one script? i guess we can't because its geektool that puts the color? :confused:

and why does my calendar is showing up really weirdly? i've tried many ways, but this is what i get when i only put cal.

and while im at it, could someone put there code for the temperature (in celsius)? i know i could go back in the thread, ive read a good part of it, but im feeling lazy! :D
 

Attachments

  • Screen shot 2010-05-31 at 6.44.57 PM.png
    Screen shot 2010-05-31 at 6.44.57 PM.png
    14.2 KB · Views: 2,033
ok thanks, i thought about that. but is there a way in only one script? i guess we can't because its geektool that puts the color? :confused:

and why does my calendar is showing up really weirdly? i've tried many ways, but this is what i get when i only put cal.

Right, since color is determined per command piece, you have to split up items that you want formatted differently. It's a pain, but the only way currently.

Your calendar shows up that way because of the font you're using. You need to use a monospace font (aka, fixed-width font) where each character takes up equal width so everything will line up correctly. Examples are Courier and Andale Mono.
 
Screen%20shot%202010-05-31%20at%207.42.23%20PM.png


Mine. =)

Wallpaper was from InterfaceLift.com. PM me if you want it/can't find it.
 
Right, since color is determined per command piece, you have to split up items that you want formatted differently. It's a pain, but the only way currently.

Your calendar shows up that way because of the font you're using. You need to use a monospace font (aka, fixed-width font) where each character takes up equal width so everything will line up correctly. Examples are Courier and Andale Mono.

ok perfect! thanks a lot!
 
So this is what I have so far...The only problem I still have is that the Hard Disk space readings are incorrect, on the Mac HD it is 25GB off and on the Windows HD it is about 3GB off.

The script I am using for Mac is df -h | grep disk0s2 | awk '{print "Macintosh HD:", $2,"capacity", $4, "remaining"}'

And for Windowsdf -h | grep disk0s3 | awk '{print "Windows HD:", $2,"capacity", $4, "remaining"}'
 

Attachments

  • Screen shot 2010-06-02 at 1.51.39 PM.jpg
    Screen shot 2010-06-02 at 1.51.39 PM.jpg
    64.1 KB · Views: 300
So this is what I have so far...The only problem I still have is that the Hard Disk space readings are incorrect, on the Mac HD it is 25GB off and on the Windows HD it is about 3GB off.

The script I am using for Mac is df -h | grep disk0s2 | awk '{print "Macintosh HD:", $2,"capacity", $4, "remaining"}'

And for Windowsdf -h | grep disk0s3 | awk '{print "Windows HD:", $2,"capacity", $4, "remaining"}'

Hi,

You do or don't know that your apple counts 1Gb as 1000Mb instead of 1024Mb. Not sure if that is really the problem but it's possible...

Look up the man page of df or try the script with the capital "H"...
ex. df -H | ....

good luck
 
Hi,

You do or don't know that your apple counts 1Gb as 1000Mb instead of 1024Mb. Not sure if that is really the problem but it's possible...

Look up the man page of df or try the script with the capital "H"...
ex. df -H | ....

good luck

The capital H worked thanks.
 
Traffic Alerts for location (based on ip) - Probably US only

So, I've been playing some more and I've written a script to display traffic alerts from Yahoo's traffic RSS feed. I used the same location items from my location based weather scripts and display each of the items in the RSS feed (the feed appears to only contain current traffic alerts). I'm going to look to see if I can do something with the date since I can't seem to re-format into my current time zone easily (but I can probably break it up and work it that way).

Enjoy:

Code:
#!/bin/bash

#get location
postal1=`curl -s http://ipinfodb.com/my_ip_location.php | awk '/Zip or postal code : /{print $6}';`
postal=`echo "$postal1" | tr -d '\r' | awk '{gsub(/<\\/li>/,"")}; 1'`

#get City Name
city=`curl --silent "http://weather.yahooapis.com/forecastrss?p=$postal&u=f"  | grep -E '(<yweather:location city|"US"/>)'  | sed -e 's/<yweather\:location city="//' -e's/"   country="US"\/>//' -e 's/" region="/, /'`

#found out how many items there are
count=`curl -s "http://local.yahooapis.com/MapsService/rss/trafficData.xml?appid=YdnDemo&zip=$postal" | tr -s ' ' '\n' | grep -c "<item>"`

#trim the report
full=`curl -s "http://local.yahooapis.com/MapsService/rss/trafficData.xml?appid=YdnDemo&zip=$postal" | sed '1 s/.*//'| sed -e 's/.*<\/image><item>/<item>/'`
full=`echo $full | sed 's/<!--.*//'`

#set up the display header
echo Traffic alerts for $city:
echo

#loop through each item
i=0
while [ $i -lt $count ];
do
	
	#get the first item
	item=`echo $full| sed 's/<\/item>/CROP/'`
	full=$item	
	item=`echo $item |sed 's/CROP.*/CROP/'`
	
	#get the info we need
	title=`echo $item |sed -e 's/.*<item><title>//' -e 's/<\/title>.*//'`
	

	desc=`echo $item | sed -e 's/.*<\/link><description>//' -e 's/<\/description>.*//'`
	

	reported=`echo $item |sed -e 's/.*<pubDate>//' -e 's/<\/pubDate>.*//'`

	#output the results	
	echo $reported
	echo $title
	echo $desc
	echo 

	#trim the report
	full=`echo $full| sed 's/.*CROP//'`
		
	#go to the next item
	let i=$i+1

done

#EOF
 
This is what I have.
I was wondering if I could get a script that will display files that VLC is playing?
I don't really know anything about writing these scripts (mostly just copy/paste), and I tried changing around the iTunes script, but I couldn't get it.
 

Attachments

  • Screen shot 2010-06-04 at 4.15.30 PM.png
    Screen shot 2010-06-04 at 4.15.30 PM.png
    307.1 KB · Views: 233
This is what I have.
I was wondering if I could get a script that will display files that VLC is playing?
I don't really know anything about writing these scripts (mostly just copy/paste), and I tried changing around the iTunes script, but I couldn't get it.

I hope this is what you're looking for...
Code:
echo 'tell application "VLC" to return name of item 1 of every window' | osascript
 
Does anyone know how to get the weather icons (cloud for cloudy, a sun for sunny etc) from yahoo weather (my code is ASXX0089)? I am currently using this script
Code:
curl --silent "http://weather.yahooapis.com/forecastrss?p=ASXX0089&u=c" | grep -E '(Current Conditions:|C<BR)' | sed -e 's/Current Conditions://' -e 's/<br \/>//' -e 's/<b>//' -e 's/<\/b>//' -e 's/<BR \/>//' -e 's/<description>//' -e 's/<\/description>//'
 
It takes a couple of steps (one to retrieve the image, another one to display it and your text).

Check out my geektool set-up page for the scripts: http://www.blazingfrog.com/bf/geektool-scripts.html

Does anyone know how to get the weather icons (cloud for cloudy, a sun for sunny etc) from yahoo weather (my code is ASXX0089)? I am currently using this script
Code:
curl --silent "http://weather.yahooapis.com/forecastrss?p=ASXX0089&u=c" | grep -E '(Current Conditions:|C<BR)' | sed -e 's/Current Conditions://' -e 's/<br \/>//' -e 's/<b>//' -e 's/<\/b>//' -e 's/<BR \/>//' -e 's/<description>//' -e 's/<\/description>//'
 
Does anyone know how to get the weather icons (cloud for cloudy, a sun for sunny etc) from yahoo weather (my code is ASXX0089)? I am currently using this script
Code:
curl --silent "http://weather.yahooapis.com/forecastrss?p=ASXX0089&u=c" | grep -E '(Current Conditions:|C<BR)' | sed -e 's/Current Conditions://' -e 's/<br \/>//' -e 's/<b>//' -e 's/<\/b>//' -e 's/<BR \/>//' -e 's/<description>//' -e 's/<\/description>//'

here ya go! :D

http://www.youtube.com/watch?v=uNFkW1lLxtU

if you want, you can try her other video about applescripts

http://www.youtube.com/watch?v=u2e8VRZvRCY
 
IT ACTUALLY WORKS :eek: Thanks so much brenm! Sorry tbertran, I just couldn't get your script working but thanks for replying anyways.
 
So this is what I have so far...The only problem I still have is that the Hard Disk space readings are incorrect, on the Mac HD it is 25GB off and on the Windows HD it is about 3GB off.

The script I am using for Mac is df -h | grep disk0s2 | awk '{print "Macintosh HD:", $2,"capacity", $4, "remaining"}'

And for Windowsdf -h | grep disk0s3 | awk '{print "Windows HD:", $2,"capacity", $4, "remaining"}'


What font do you use for your date displays? I love them
 
This may be a dumb question but I am using iCalBuddy and wondering if anyone knows a way to change the times of my events from military to standard with an AM or PM?
 
This may be a dumb question but I am using iCalBuddy and wondering if anyone knows a way to change the times of my events from military to standard with an AM or PM?

From the iCalBuddy FAQ: Q: How can I get icalBuddy to display times according to a 12-hour clock?

You can use the -tf (or --timeFormat) argument to specify the format in which to display times. For example, icalBuddy -tf "%1I:%M %p" eventsToday would display times such as 5:00 PM. See Apple's documentation for all the possible values you can use for date and time formatting (there's also the -df (or --dateFormat) argument for date formatting, which works similarly to this one.)

(http://hasseg.org/icalBuddy/faq.html)
 
From the iCalBuddy FAQ: Q: How can I get icalBuddy to display times according to a 12-hour clock?

You can use the -tf (or --timeFormat) argument to specify the format in which to display times. For example, icalBuddy -tf "%1I:%M %p" eventsToday would display times such as 5:00 PM. See Apple's documentation for all the possible values you can use for date and time formatting (there's also the -df (or --dateFormat) argument for date formatting, which works similarly to this one.)

(http://hasseg.org/icalBuddy/faq.html)

Thank you very much, I should have looked at the iCalBuddy thing first.
 
Songbird applescript / emergency info

Hi everybody,

Love geektool, below is my first attempt on my new MBP.

I have been pouring over this thread for a couple weeks trying to see if there is some way to use Songbird and display info in the same manner that people have written applescripts for Itunes? Also, slightly offtopic but has anyone found a viable alternative to coversutra/bowtie to work with songbird?

Also, has anyone tried to integrate any emergency/police info via some sort of text feed onto their desktops? Seems this would be very cool, but I cannot really find any online sources for these feeds anyway. It seems they only come across the wire as audio?

Just curious and did a fair bit of searching to no avail. Thanks
 

Attachments

  • restinbeastdesktop.jpg
    restinbeastdesktop.jpg
    380.9 KB · Views: 267
hey Restinbeast... would you mind telling me how you changed the color of your menu bar? :D

about the scripts, i have absolutely no clue! :p
 
hey Restinbeast... would you mind telling me how you changed the color of your menu bar? :D

about the scripts, i have absolutely no clue! :p

Sure NP...

This guy on youtube does a great job of laying it all out
http://www.youtube.com/watch?v=JkX_bjVEwiE

He provides links to all the files you need. Basically you have to do some tinkering inside OSX. Just make sure that the files that you use are verified as working by someone and also, I cannot stress this enough, BACKUP all the files you replace.

You want to make sure that you can revert things easily.
 
Anyone have a proper way to display CPU usage?

I tried:

Code:
top -l2 | grep "CPU usage" | cut -c 1-11,25-26

with 'cut' to remove what I don't want displayed but seeing as the number fluctuates, the overall percentage sometimes gets cut off.

Anyone have a solution?

r0dxlc.png
 
Anyone have a proper way to display CPU usage?

I tried:

Code:
top -l2 | grep "CPU usage" | cut -c 1-11,25-26

with 'cut' to remove what I don't want displayed but seeing as the number fluctuates, the overall percentage sometimes gets cut off.

Anyone have a solution?

r0dxlc.png

Try this...

top -l 2 | awk '/CPU usage/ && NR > 5 {print "CPU Usage: ", "User = "$3",", "Sys = "$5",", "Idle = "$7}'
 
Status
Not open for further replies.
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.