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 guess I'm missing something...
why a script for something is yet done by the uptime bash command?
i tried the script and it outputs this:
Code:
 2 days, 14 hrs, 30 mins
in NerdTool i use the uptime command:
Code:
uptime | awk '{sub(/[0-9]|user\,|users\,|load/, "", $6); sub(/mins,|min,/, "min", $6); sub(/user\,|users\,/, "", $5); sub(",", "min", $5); sub(":", "h ", $5); sub(/[0-9]/, "", $4); sub(/day,/, " day ", $4); sub(/days,/, " days ", $4); sub(/mins,|min,/, "min", $4); sub("hrs,", "h", $4); sub(":", "h ", $3); sub(",", "min", $3); print $3$4$5$6}'
whitch outputs:
Code:
2 days 14h 33min
why to prefer using a more expensive script?
 
I guess I'm missing something...
why a script for something is yet done by the uptime bash command?
i tried the script and it outputs this:
Code:
 2 days, 14 hrs, 30 mins
in NerdTool i use the uptime command:
Code:
uptime | awk '{sub(/[0-9]|user\,|users\,|load/, "", $6); sub(/mins,|min,/, "min", $6); sub(/user\,|users\,/, "", $5); sub(",", "min", $5); sub(":", "h ", $5); sub(/[0-9]/, "", $4); sub(/day,/, " day ", $4); sub(/days,/, " days ", $4); sub(/mins,|min,/, "min", $4); sub("hrs,", "h", $4); sub(":", "h ", $3); sub(",", "min", $3); print $3$4$5$6}'
whitch outputs:
Code:
2 days 14h 33min
why to prefer using a more expensive script?

Well..., erm what to say.
I like to make my own scripts and at this moment i'm figuring out how to read/create suchs code and I didn't googled it so I don't know...

I just prefer to figure it out myself and keep learning stuff.
So thanks anyway for the code ;-)
 
ok ok perfect, i think exacly like you, studying scripts for educational purposes it's always a good thing.
i didn't understand why reinventing the wheel, but your answer clarifies everything.
 
ok ok perfect, i think exacly like you, studying scripts for educational purposes it's always a good thing.
i didn't understand why reinventing the wheel, but your answer clarifies everything.

;) there should be a "thumbs up" icon, so we can click it
 
I can't seem to find it anywhere but I would to like to display the hour and the minutes in separate colors.
I found this code:
Hour: date +"%H"
Minute: date +"%M"

But the hour code displays it in 24Hour clock, I like it to be 12H. Does anyone know? Thanks in advance.

Edit: Nvm. I figured its date+"%l".
 
ow crap, i forgot to change my test line

here is the corrected one,
Code:
tell application "Finder"
	set dayss to ""
	set AppleScript's text item delimiters to "up"
	set upt to text item 2 of (do shell script "uptime")
	
	if upt contains "days" then
		set AppleScript's text item delimiters to "days"
		set dayss to (text item 1 of upt) & "days,"
	end if
	
	if upt does not contain "hr" and upt does not contain "mins" then
		if dayss ≠ "" then
			set AppleScript's text item delimiters to "days,"
			set upt to text item 2 of upt
		end if
		set AppleScript's text item delimiters to ","
		set other to text item 1 of upt
		set AppleScript's text item delimiters to ":"
		set other_hr to dayss & (text item 1 of other) & " hrs, "
		set res to other_hr & (text item 2 of other) & " mins"
	end if
	
	if upt contains "hr" then
		set AppleScript's text item delimiters to "hr"
		set res to dayss & (text item 1 of upt) & "hrs"
	end if
	
	if upt contains "min" then
		set AppleScript's text item delimiters to "min"
		set res to dayss & (text item 1 of upt) & "mins"
	end if
	
	return res
end tell

So far its beautiful, I love it. And for the hell of it I tried the other code posted and it wasn't as cosmetically as pleasing. I haven't have my computer up for more then 2 hours but I'll leave it up for a day to see how it looks. Thanks again.
 
Hello everyone.

I have created html file with code:
"
<iframe width="400px" height="140px" scrolling="auto"
frameborder="0" allowtransparency="true"
src="http://quotes4all.net/quotes.html?image=none&update=120">
</iframe>
"

It download quote from http://quotes4all.net and refresh with new quote every 120 seconds.
After opening it in firefox it looks like
"quote
autor"

I would like to have it on my desktop, but I couldn't find any way to display html file. "curl -s" works with website, but with file it just display html-code.

Any idea how display it?
 
Hello everyone.

I have created html file with code:
"
<iframe width="400px" height="140px" scrolling="auto"
frameborder="0" allowtransparency="true"
src="http://quotes4all.net/quotes.html?image=none&update=120">
</iframe>
"

It download quote from http://quotes4all.net and refresh with new quote every 120 seconds.
After opening it in firefox it looks like
"quote
autor"

I would like to have it on my desktop, but I couldn't find any way to display html file. "curl -s" works with website, but with file it just display html-code.

Any idea how display it?

Follow this link.
https://forums.macrumors.com/showthread.php?p=8957532&#post8957532

search for post #1460
Maybe I need to try it in poppero style :D
I'll try it tomorrow, yay ;-)
 
Thanks, I love quotes.

But about html file codes.
That's the only language except C I know, so if there is way to use them in geektool, I would be glad to know how.

One more time thanks for quote ^^

EDIT:
Which code languages GeekTool understand?
How they call and what have to be typed into "url" to use it?
 
last time my geektool updated was the 15th. its been working on and off like this. am i the only one this is happening to? is there another program i can use?
 
Is there an option to type "image display", or "geektool group turn on/off" by script?

For example:
Clock check,
If hour = 1 display image1.jpg
If hour = 2 display image2.jpg
...

Image display would be great way to create lots of awesome geektool, but also geektool group on/off script.
I could use it in same way.

Clock check,
If hour = 1 turn on h1 group
...
 
Yeah if you don't mind that would be amazing. I have it but it's very simple looking. I just have todays date and under it it has all my stuff for how ever many days set. It doesn't separate them into the multiple dates like that or have the color code which is super sexy.

*Edit* Heres what I have if this helps my description.

Screenshot2010-04-17at105635AM.png

How did you put that 5 day forecast? care sharing?
 
Back to basics...

I'm currently using this code to get the Date:
date +%d | sed -E 's/([^1]1)$/\1st/'| sed -E 's/([^1]2)$/\1nd/' |sed -E 's/([^1]3)$/\1rd/' | sed -E 's/([0-9])$/\1th/'

Any way to get it so that instead of 01st, it'll show 1st?
 
Any way to get it so that instead of 01st, it'll show 1st?

you must use a different option in date command:
Code:
date +%e | sed -E 's/([^1]1)$/\1st/'| sed -E 's/([^1]2)$/\1nd/' |sed -E 's/([^1]3)$/\1rd/' | sed -E 's/([0-9])$/\1th/'
 
I am trying to put the Weather onto my desktop, using:
Code:
lynx -dump http://printer.wunderground.com/cgi-bin/findweather/getForecast?query=torpoint|awk '/Temp/{printf $2, ": "; for (i=3; i<=3; i++) printf $i " " }'

But Geektool isn't displaying anything at all, any idea what to do about this?

EDIT. solved now.
 
Weather Image

Hello.

This might be a dumb question, but I'm newbie to GeekTool.

I want to have one of those fancy weather images, but I don't know how to do it. Can anyone please post a little guide to retrieve it?

Thanks in advance,
Kralle
 
Hello.

This might be a dumb question, but I'm newbie to GeekTool.

I want to have one of those fancy weather images, but I don't know how to do it. Can anyone please post a little guide to retrieve it?

Thanks in advance,
Kralle

Not to come off rude, but it has been discussed in previous posts. Just read through the thread. You will learn a lot of what Geektool can and cannot do as well as what each part means.
 
Not to come off rude, but it has been discussed in previous posts. Just read through the thread. You will learn a lot of what Geektool can and cannot do as well as what each part means.

Fair enough. I've been reading through the past 20 pages which took me a couple of hours, and 81 pages seemed a little too much. But no worries - I'll keep looking. :)
 
Status
Not open for further replies.
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.