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'm new to using geektool and I can get the time to come up but when I try to get the date as well, it deletes the time and vice versa. I can't seem to get more than one geektool to display at one time, they just disappear. Any help? Thanks !:eek:
 
I'm new to using geektool and I can get the time to come up but when I try to get the date as well, it deletes the time and vice versa. I can't seem to get more than one geektool to display at one time, they just disappear. Any help? Thanks !:eek:

Well are you putting them in separate geeklets or trying to do it all in one?
 
I'm sure this has been asked, but how do I get the "F" and the "*" in the temperature to be hidden?

Here's the code im using.
Code:
curl --silent "http://xml.weather.yahoo.com/forecastrss?p=USOH0110&u=f" | grep -E '(Current Conditions:|[A-Z]<BR)' | sed -e 's/Current Conditions://' -e 's/<br \/>//' -e 's/<b>//' -e 's/<\/b>//' -e 's/<BR \/>//' -e 's/[A-Z a-z]*, //' -e 's/\(.*\) F/\1 °F/' -e 's/\(.*\) C/\1 °C/' | sed 's/ //' | tail -n1


EDIT

nvm figured it out, thanks.
 
Here's my geektool setup at work...
Hope you like it ;-)

Just started working on mine, but after seeing that one above, I'm gonna have to change it around a little

My iteration of tomge's layout and striker9's wallpaper. It may need some tweaking once I see how all the numbers roll over and change the spacing.

With dock and without. Need to find a new icons, just can't find anything I like for everything yet.
 

Attachments

  • Screen shot 2010-03-09 at 9.50.22 PM.jpg
    Screen shot 2010-03-09 at 9.50.22 PM.jpg
    708.6 KB · Views: 500
  • Screen shot 2010-03-09 at 9.50.10 PM.jpg
    Screen shot 2010-03-09 at 9.50.10 PM.jpg
    725.8 KB · Views: 296
How'd you do the battery and uptime like that, whats the codes and how do you change half the code to one colour?

I use 2 geeklets for each to get it done...

For the battery;

1. drag'n'drop new geeklet and type following in the command line
Code:
echo Battery

2. drag'n'drop new shell geeklet ans paste this in the command line
Code:
#!/bin/sh
bat=$((`ioreg -rc "AppleSmartBattery" | awk '/CurrentCapacity/{print $3}'` * 100 / `ioreg -rc "AppleSmartBattery" | awk '/MaxCapacity/{print $3}'`))
echo $bat"%"


Uptime

I'm still learning shell script, sometime soon there will be a shell version of the uptime which is better at performance i think ;-)

1. drag'n'drop new geeklet and type following in the command line
Code:
echo uptime

2.drag'n'drop new shell geeklet ans paste this in the command line
Path to the script (don't forget to change the path)
Code:
osascript /Users/me/Documents/geektool/Uptime.scpt

Applescript code | Uptime
copy, past and save as an applescript

Code:
tell application "Finder"
	set upt to do shell script "uptime"
	
	set AppleScript's text item delimiters to ","
	set upt to text item 1 of (upt as string)
	set AppleScript's text item delimiters to " "
	set upt to last text item of (upt as string)
	set AppleScript's text item delimiters to ""
	return (upt as string)
end tell

If you feel like sharing these codes on other websites, forums,... please ask/inform me and put my credentials with it. If you don't then I won't be sharing any applescript or other in the future. thx ;-)
 
If you feel like sharing these codes on other websites, forums,... please ask/inform me and put my credentials with it. If you don't then I won't be sharing any applescript or other in the future. thx ;-)

What? Seems kinda arrogant to me. You really think other people can't duplicate exactly what you did without any particular trouble? You're demanding credit for fairly basic operations that anyone with some basic knowledge should be able to do without consulting you at all.

I dunno, it just doesn't seem like you have any right to demand that.

jW
 
What? Seems kinda arrogant to me. You really think other people can't duplicate exactly what you did without any particular trouble? You're demanding credit for fairly basic operations that anyone with some basic knowledge should be able to do without consulting you at all.

I dunno, it just doesn't seem like you have any right to demand that.

jW

Yeah, ok. Maybe I didn't have to put that overthere.

But I and I'm not the only one here is putting time and effort in doing this.
And why we do that, because we are proud and want to help others who are not that familiar with scripting.

And if you find it arrogant, then you are talking to every single person inhere who ever posted a script or something inhere.
By the way, if somebody duplicates a complete script with all the info needed to another website then it's always fine that the person says it's not his.
Thats being fair against others

Thats the main reason why I wrote it overthere. I hope you'll understand why I posted it.
And hope there are not more people who thinks this is negative because it's not... i'll keep posting new scripts and stuff

Kind regards,
 
in my humble opinion your are both partially right.
by one side who posts some code or scripts can't control the use that people can do about it because the aim of forums is sharing, unconditionally and only if you want. for this reason i think that who posts code lines or scripts should have the right to see recognized his work and his efforts and there are even too much creative common's licences that can be used for this purpose. hence i think that if someone wants some rights on his product must use one of the admitted copyright form avoiding any reason that could give impression to be arrogant.
by the other side i think that users that make use of code and scripts requested and posted here on the forum must respect the work of who spent time to do it and they should consider to communicate to the code editor if they have intention to make any particular use of that code.
in both sides i think that nobody have the right to say "you can't get my code for everything" or "i take your code and earn on it because you didn't copyrighted it". i think that things like that should be clear due the nature of the medium you are using to get or share that informations. forums mean sharing, than if i post here i can't control what kind of use would be done of my code, i post it for knowledge or educational purposes. the way users exploit the things i posted could be ruled only by the forgotten netiquette.
that's my opinion, free to not share...
 
Yeah, ok. Maybe I didn't have to put that overthere.

But I and I'm not the only one here is putting time and effort in doing this.
And why we do that, because we are proud and want to help others who are not that familiar with scripting.

And if you find it arrogant, then you are talking to every single person inhere who ever posted a script or something inhere.
By the way, if somebody duplicates a complete script with all the info needed to another website then it's always fine that the person says it's not his.
Thats being fair against others

Thats the main reason why I wrote it overthere. I hope you'll understand why I posted it.
And hope there are not more people who thinks this is negative because it's not... i'll keep posting new scripts and stuff

Kind regards,

all hail tomge the writer of the elusive uptime script.

if you want to contribute to MacRumors, you post on their forums - if you want to have code that people cite you for - please make something worthwhile and post it on your OWN website
 
I use 2 geeklets for each to get it done...

For the battery;

1. drag'n'drop new geeklet and type following in the command line
Code:
echo Battery

2. drag'n'drop new shell geeklet ans paste this in the command line
Code:
#!/bin/sh
bat=$((`ioreg -rc "AppleSmartBattery" | awk '/CurrentCapacity/{print $3}'` * 100 / `ioreg -rc "AppleSmartBattery" | awk '/MaxCapacity/{print $3}'`))
echo $bat"%"


Uptime

I'm still learning shell script, sometime soon there will be a shell version of the uptime which is better at performance i think ;-)

1. drag'n'drop new geeklet and type following in the command line
Code:
echo uptime

2.drag'n'drop new shell geeklet ans paste this in the command line
Path to the script (don't forget to change the path)
Code:
osascript /Users/me/Documents/geektool/Uptime.scpt

Applescript code | Uptime
copy, past and save as an applescript

Code:
tell application "Finder"
	set upt to do shell script "uptime"
	
	set AppleScript's text item delimiters to ","
	set upt to text item 1 of (upt as string)
	set AppleScript's text item delimiters to " "
	set upt to last text item of (upt as string)
	set AppleScript's text item delimiters to ""
	return (upt as string)
end tell

If you feel like sharing these codes on other websites, forums,... please ask/inform me and put my credentials with it. If you don't then I won't be sharing any applescript or other in the future. thx ;-)

Well I wasn't going to share and I'm still not so thank you for the info. And if my opinion means anything I wasn't offended by that.

*Edit* I did the uptime script and it was working fine and I restarted my computer a while ago and now all it returns in "mins". Any help?
 
And if you find it arrogant, then you are talking to every single person inhere who ever posted a script or something inhere.

No, I'm really not. Not one single other person on here has made any claim to originality or that they are deserving of credit (with the possible exception of the guy who put together a guide, but that's not the same as posting a snippet of code).

As has been said, if you expect credit for your work, assuming it's even truly unique or original in any way, don't post it on a public forum. It's naive of you to do so, especially on something so trivial as a few lines of code, which are undoubtedly not unique to you.

jW
 
To all of you,

I know I'm wrong about the credit and asking stuff, and as Poppero said: you've got to respect the people who put their time in doing this and you can't claim basic coding.
And respecting the people who are willing to share, thats what i think is important to keep forums running

Mal if you are serious and if I don't want to have these code having their own life on the internet then I wouldn't share
because thats what I did, didn't I?
same for you Michael.Lauden.

And if you guys think I'm a jerk, then think twice.
The guy "Scrbzzz" asked for those codes, i posted them the next day so that he wouldn't have to wait long.
You can ask SSpiro aswel, he personally asked for some script's well I helped him out by sending all the code he needs and what he has to do

The only thing I/we want to do is contribute and hoping people respect what do
 

Your welcome,

Here is the update for the uptime code.
This should work now ;-) with minutes, hours and normal
Code:
tell application "Finder"
	set upt to do shell script "uptime" as string
	
	
	if upt contains "mins" then
		set one to "mins"
		set two to "up "
		set type to "min"
		my uptime(one, two, type, upt)
		
	else if upt contains "hr" then
		set one to "hr"
		set two to "up "
		set type to "hour"
		my uptime(one, two, type, upt)
		
	else
		set one to ","
		set two to "up  "
		set type to ""
		my uptime(one, two, type, upt)
	end if
end tell

on uptime(one, two, type, upt)
	tell application "Finder"
		set AppleScript's text item delimiters to one
		set upt to text item 1 of upt
		set AppleScript's text item delimiters to two
		return (text item 2 of upt) & type
	end tell
end uptime
 
Your welcome,

Here is the update for the uptime code.
This should work now ;-) with minutes, hours and normal
Code:
tell application "Finder"
	set upt to do shell script "uptime" as string
	
	
	if upt contains "mins" then
		set one to "mins"
		set two to "up "
		set type to "min"
		my uptime(one, two, type, upt)
		
	else if upt contains "hr" then
		set one to "hr"
		set two to "up "
		set type to "hour"
		my uptime(one, two, type, upt)
		
	else
		set one to ","
		set two to "up  "
		set type to ""
		my uptime(one, two, type, upt)
	end if
end tell

on uptime(one, two, type, upt)
	tell application "Finder"
		set AppleScript's text item delimiters to one
		set upt to text item 1 of upt
		set AppleScript's text item delimiters to two
		return (text item 2 of upt) & type
	end tell
end uptime
Wow thank you, looks amazing!
 
I certainly appreciate everyone who posts and shares code here, because I don't understand any of it, but I can sure copy/paste with the best of them

I don't take anyone's time and effort for granted here
And I always come back to say thank you to the one who helped me
But to me, helping someone and sharing is always the reward in itself

If you need a pat on the back every time a snip of code is used, then make a commercial app and sell it, then the $$ can be your reward
 
I certainly appreciate everyone who posts and shares code here, because I don't understand any of it, but I can sure copy/paste with the best of them

I don't take anyone's time and effort for granted here
And I always come back to say thank you to the one who helped me
But to me, helping someone and sharing is always the reward in itself

If you need a pat on the back every time a snip of code is used, then make a commercial app and sell it, then the $$ can be your reward

I totally agree and i'm allready happy when some people are using them. A thank you is allways nice to get. I'm not seeking for pat on the back everything time i post something.

But please, i think its cleared out now and can we get back on topic?

How's your desktop looking like?
Does anybody has new idea's for displaying info, cause i ran out for the moment. Thx in advance
 
Wow thank you, looks amazing!

I've spotted a problem when you leave your mac on. its fixed now ;-)
So when your uptime is going over 10 hours
copy and paste
Code:
tell application "Finder"
	set upt to do shell script "uptime" as string
	
	
	if upt contains "mins" then
		set one to "mins"
		set two to "up "
		set type to "min"
		my uptime(one, two, type, upt)
		
	else if upt contains "hr" then
		set one to "hr"
		set two to "up "
		set type to "hour"
		my uptime(one, two, type, upt)
		
	else
		set one to ","
		set two to "up "
		set type to ""
		my uptime(one, two, type, upt)
	end if
end tell

on uptime(one, two, type, upt)
	tell application "Finder"
		set AppleScript's text item delimiters to one
		set upt to text item 1 of upt
		set AppleScript's text item delimiters to two
		return (text item 2 of upt) & type
	end tell
end uptime
 
I've spotted a problem when you leave your mac on. its fixed now ;-)
So when your uptime is going over 10 hours
copy and paste
Code:
tell application "Finder"
	set upt to do shell script "uptime" as string
	
	
	if upt contains "mins" then
		set one to "mins"
		set two to "up "
		set type to "min"
		my uptime(one, two, type, upt)
		
	else if upt contains "hr" then
		set one to "hr"
		set two to "up "
		set type to "hour"
		my uptime(one, two, type, upt)
		
	else
		set one to ","
		set two to "up "
		set type to ""
		my uptime(one, two, type, upt)
	end if
end tell

on uptime(one, two, type, upt)
	tell application "Finder"
		set AppleScript's text item delimiters to one
		set upt to text item 1 of upt
		set AppleScript's text item delimiters to two
		return (text item 2 of upt) & type
	end tell
end uptime

I feel terrible asking because I wish I could write these myself but when it went over 1 day uptime it was fine until it got to 1 day and 1 hour it just reads 1 day. Is it any easy fix to get to to so x Day, x Hour, x Min?

EDIT* It will read 1 Day 1 Hour, 1 Day 2 Hour ext ext but anything like x Day x Hour x Min it just puts out 1 Day.
 
GeekTool World time + DST

Well, the US flipped over daylight savings and my world time script is giving the wrong answer. Here's what I've got:

TZ=America/GMT+8 date +"Sacramento: %l:%M %p on %d %B"


Can anyone help me fix it so it gives the correct time?

Thanks in advance.

EDIT: Yes, I can just change the GMT number - what I'm after is a fix that allows for DST.
 
I feel terrible asking because I wish I could write these myself but when it went over 1 day uptime it was fine until it got to 1 day and 1 hour it just reads 1 day. Is it any easy fix to get to to so x Day, x Hour, x Min?

EDIT* It will read 1 Day 1 Hour, 1 Day 2 Hour ext ext but anything like x Day x Hour x Min it just puts out 1 Day.

Hi,

how would you like to get it displayed?
1) 3 days, 10:33 | 3 days, 33 min | 3days, 10 hours
2) 3 days, 10 hours, 33 min

The code underneath returns it like number 1 depending if it has hours or minutes or both. If you prefer number 2 then I'll have to modify it
PS. sorry for those problems but I don't leave my mac powered on for several days

greetz

Code:
tell application "Finder"
	set upt to do shell script "uptime" as string
	
	if upt contains "days" then
		set one to ","
		set two to "up "
		set type to ""
		my uptime(one, two, type, upt)
		
	else if upt contains "mins" then
		set one to "mins"
		set two to "up "
		set type to "min"
		my uptime(one, two, type, upt)
		
	else if upt contains "hr" then
		set one to "hr"
		set two to "up "
		set type to "hour"
		my uptime(one, two, type, upt)
		
	else
		set one to ","
		set two to "up "
		set type to ""
		my uptime(one, two, type, upt)
	end if
end tell

on uptime(one, two, type, upt)
	tell application "Finder"
		set hrs to ""
		set AppleScript's text item delimiters to one
		set dys to text item 1 of upt
		if upt contains "days" then
			set hrs to text item 2 of upt
			set dys to dys & ","
		end if
		set AppleScript's text item delimiters to two
		return (text item 2 of dys) & hrs & type
	end tell
end uptime
 
Heres a simple question for you guys (I hope). How do I get my fonts smooth? They're looking quite jagged on screen, all the fonts I've seen here are nice and smooth - any help?

Thanks :)
 
Status
Not open for further replies.
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.