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.

creator2456

macrumors 68000
Jul 10, 2007
1,649
2
Chicago
I've been reading through the past 20 pages which took me a couple of hours, and 81 pages seemed a little too much.

I know what you mean, but it is worth it in the end. People have done some great stuff.



Also, a GeekTool update (3.0 12A) just got pushed through sometime in the last 12 hours.
 

Kaham

macrumors newbie
May 4, 2010
2
0
Use Geektool to display conditional images?

Hey all,

I've recently discovered Geektool, but also noticed that some of the scripting is still far out of my league as I only recently made the switch to a Mac.

Therefore, I would like to ask you amazing coders if you would be able to pull anything like this off:

I have found this really neat Futurama wallpaper at kremalicious.com (http://www.kremalicious.com/2009/02/out-of-whale-oil/). For those not Futurama-fans (shame on you :p), the whale-oil is more or less the gasoline of the future, and therefore I figured that it would be nice to use the whale in the middle of the desktop to display my battery charge.

However, my issue: Can Geektools (v3) display conditional images?

Here's my basic idea:
I will use the background with the completely 'white' whale. This corresponds to a full battery charge.
I cut up the other image, with the nearly empty 'blue' whale into 9 parts. (The grid in the whale contains 10 blocks).
Then what I would need is a geeklet script that displays the first blue block on top of the background image as soon as my battery ticks below 90%, the second after 80%, etcetera.

Is there a script that could pull this off? I've already browsed this entire thread, but I havent seen anything like this yet. I did find the following piece of code by raltenbach on page 57, which already correctly returns the battery charge, if that is of any help:

Code:
#!/bin/bash

asbreg=`ioreg -rc "AppleSmartBattery"`

maxcap=`echo "${asbreg}" | awk '/MaxCapacity/{print $3}'`;
curcap=`echo "${asbreg}" | awk '/CurrentCapacity/{print $3}'`;

prcnt=`echo "scale=2; 100*$curcap/$maxcap" | bc`;

printf "%1.0f%%" ${prcnt};

#EOF

Many many thanks in advance guys!
 

Stormraven

macrumors newbie
May 5, 2010
21
0
I'm trying to get it to show what's running and what resources its running on my mac. im using this code:

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

But nothing is showing up, i just put it in a shell command box but nothing shows up after I save it, can someone help me please?

Also my website is http://www.prowebforums.com, is there a way to check if my server is online, and using the green dot if it is, and the red one if its not?

Kind Regards.
 

tbertran

macrumors newbie
Apr 3, 2009
23
0
I'm trying to get it to show what's running and what resources its running on my mac. im using this code:

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

But nothing is showing up, i just put it in a shell command box but nothing shows up after I save it, can someone help me please?

Also my website is http://www.prowebforums.com, is there a way to check if my server is online, and using the green dot if it is, and the red one if its not?

Kind Regards.

Not exactly sure what you're trying to do but here's what I use:

for RAM:
total: echo "$(top -l 1 | grep PhysMem | sed 's/M//g' | awk '{print "RAM used: : " $2 + $4 " Mb (" int((4064-($2 + $4))*100/4064) "% free)"}')"
items: ps -amcwwxo "command %mem ruser" | head -6 | sed -e "s/COMMAND//g" -e 's/ \%MEM RUSER//' -e 's/ / /'

for disk space: df -h | grep disk0s2 | awk '{print "Free: " $4 " (" $5 " used)"}'

for CPU: ps -arcwwxo "command %cpu ruser" | head -11 | sed '/top/d' | head -6 | sed -e "s/COMMAND//g" -e 's/ \%CPU RUSER//'

For your green dot thingy, I would try pinging the web site and maybe play with an image depending on the result.
 

partyBoy

macrumors 68000
Nov 8, 2009
1,558
0
Dilligaf
Changed it alittle...

desktop.png
 

ecsong187

macrumors newbie
Jan 23, 2009
16
0
Anyone know where to get the codes for the days forecast like on this one?

Screenshot2010-04-17at105635AM.png


Also I have a problem with my geektool time. It doesn't change?
Unless I restart my computer or go into geektool. Or else the time just stays the same and doesn't work??

Thanks
Edwin
 

creator2456

macrumors 68000
Jul 10, 2007
1,649
2
Chicago
Anyone know where to get the codes for the days forecast like on this one?

Also I have a problem with my geektool time. It doesn't change?
Unless I restart my computer or go into geektool. Or else the time just stays the same and doesn't work??

Thanks
Edwin

Pretty sure that is a yahoo Widget for the weather. Nothing that GeekTool can do about that.

The time issue is probably just the refresh rate is set too high. Change it to 60 and it should work.
 

phillyphill

macrumors 6502
Apr 23, 2010
259
0
lorton
im still confused, read almost the whole thread and still cant figure it out. i have geektool 3

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


when i post that code nothing happens what am i doing wrong?
 

tomge

macrumors member
Dec 13, 2009
53
0
Belgium
im still confused, read almost the whole thread and still cant figure it out. i have geektool 3

tell application "Finder"
set dayss to ""
set AppleScript's text item delimiters to "up"
....

....
return res
end tell


when i post that code nothing happens what am i doing wrong?

Hi,

Are you pasting the whole script inside the shell geeklet?
Because then you're wrong, you actually need to save the script first to your desktop or anywhere else as "scpt" using "Applescript Editor".
Then drag'n'drop a shell geeklet and enter the following:
osascript path/to/your/script.scpt

How to get the correct path?
Open up Terminal.app en drag'n'drop the script in it. Terminal will enter the path all you have to do is copy and past.
Beware!! if there are any spaces in the path it's recommended to use double quotes
like this example.
Code:
osascript "/Users/me/Documents/geektool/uptime.scpt"

Still doesn't work?
Try the script instead. So openup the script in Applescript Editor and give it a go.
If you get a result down below then it works and you have made an error in the shell geeklet.

Script doesn't work, then I'll have to fix it =D
but be sure to save it as applescript and not some sort of txt file.
- greetz -
 

rreulbach

macrumors newbie
Aug 18, 2009
2
0
Wanting to put Adium contacts on desktop...

Hey all,
I've been using Geektool for the past couple days. I've been trying to figure out how to put my Adium contacts on the desktop similar to the attached desktop below. Its been made to sound very simple and able to apply through some preferences but I haven't been able to find out how. Any help would be appreciated.

Also, I'm really interested in attaching a facebook feed as well but so far I've been extremely confused in creating the automator workflow. It's been tough to find information on this.
 

Attachments

  • Picture 1.jpg
    Picture 1.jpg
    830.4 KB · Views: 393

tomge

macrumors member
Dec 13, 2009
53
0
Belgium
Hey all,
I've been using Geektool for the past couple days. I've been trying to figure out how to put my Adium contacts on the desktop similar to the attached desktop below. Its been made to sound very simple and able to apply through some preferences but I haven't been able to find out how. Any help would be appreciated.

Also, I'm really interested in attaching a facebook feed as well but so far I've been extremely confused in creating the automator workflow. It's been tough to find information on this.

hi, for adium its best to have a look @ adium extras or try to contact this person.
Facebook, well i don't think it's not possible yet don't know how for the moment...
I'll give it a go, if others allready have made something for facebook please don't hesitate.

- greetz -
 

VETTE277

macrumors member
Apr 29, 2010
37
0
Hey all,
I've been using Geektool for the past couple days. I've been trying to figure out how to put my Adium contacts on the desktop similar to the attached desktop below. Its been made to sound very simple and able to apply through some preferences but I haven't been able to find out how. Any help would be appreciated.

Also, I'm really interested in attaching a facebook feed as well but so far I've been extremely confused in creating the automator workflow. It's been tough to find information on this.

Hey where did you get the folder icons, and how'd you set your dock ?
 

DNC1970

macrumors newbie
Jul 16, 2008
10
0
thnks everyone for everything. i'm making my own desktop and i want a countdown script on it. i want it to say something like: Days Until Kickoff (then insert days here). The world cup (which is what i'm counting down to) starts on june 11, 2010. i can't find much online and i'm pretty much a n00b when it comes to this stuff. i'm hoping someone on here can help me out with this. thnks again.

This will display the number of days:

python -c 'from datetime import *; print (date(2010, 7, 11) - date.today()).days'

From: http://ask.metafilter.com/72555/Help-Me-Morbidly-Count-Down-the-Remaining-Days-of-My-Life

This just gets the number of days - you'll need to add something to print whatever text you want before/after the number.
 

Schranke

macrumors 6502a
Apr 3, 2010
974
1,072
Copenhagen, Denmark
Hey all
I have some problems making a to do list in geektool.
I am using this script:
/User/schranke/Documents/Todo.txt | sed -e '1p' -e :a -e'$q;N;5,$D;ba'

and i cant get it to show anything.
can you guys plz help me out?

sincerely Schranke
 

Intell

macrumors P6
Jan 24, 2010
18,955
509
Inside
I was hoping if someone here could make a simple script to display the battery percentage in the Apple Bluetooth keyboard and mouse? I know it can be done but I lack the proper know how.

I did find out that
Code:
ioreg -l | grep -i batterypercent
displays the remaining battery life, but it shows both devices as one and its has extra characters in it.

EDIT:
Is there a way for GeekTool to show the next movie in one's Netflix Queue using the rss feed?

EDIT 2:
I got the Netflix thing working.

Code:
curl --silent "http://rss.netflix.com/AtHomeRSS?id=NETFLIX_USER_ID_GOES_HERE" | grep -e "<item>" -A 1 | tail -n 1 | sed -e 's/<title>//' | sed -e 's/      //'  | sed -e 's/<\/title>//'

EDIT 3:
This one shows multiple movies in your Netflix Queue

Code:
curl --silent "http://rss.netflix.com/QueueRSS?id=NETFLIX_USER_ID_GOES_HERE" | grep -e "<title>"  | sed -e 's/<title>00//' | sed -e 's/<title>0//' | sed -e 's/<\/title>//' | sed -e 's/      //' | sed -e 's/<title>Netflix Queue//'

If you want some other Netflix based thing to appear just log into your Netflix account and click on RSS at the bottom and change out the "AtHome" or the "Queue" part of the code with the feed you want.
 

tomge

macrumors member
Dec 13, 2009
53
0
Belgium
Hey all
I have some problems making a to do list in geektool.
I am using this script:
/User/schranke/Documents/Todo.txt | sed -e '1p' -e :a -e'$q;N;5,$D;ba'

and i cant get it to show anything.
can you guys plz help me out?

sincerely Schranke

I would go for /Users/schranke/....
just users with an s at the end, unless you've made a typo inhere

greetz
 

Schranke

macrumors 6502a
Apr 3, 2010
974
1,072
Copenhagen, Denmark
I would go for /Users/schranke/....
just users with an s at the end, unless you've made a typo inhere

greetz

Thanks for seeing that. But after the correction was made in the command it didn't change anything.
If there are some one out there with a working todo list plz post script.
Will be glad if some one have 1 there only need a .txt and geektool

Sincerely Schranke
 

saunterer

macrumors newbie
May 13, 2008
29
0
Properly showing free disk space

This is a simple script to more accurately show free disk space under the hard drive icon. (Why hasn't Apple fixed the dot-dot-dot issue yet?)

Going from this:

skrmavbild20100517kl163.png


to this:

skrmavbild20100517kl163.png


Using this:

Code:
#!/bin/sh
FREE=$(df -Hl | grep disk | awk '{print $4}' | cut -c -3)
echo "500 GB, $FREE GB ledigt"

The font and its shadow isn't perfect, but it looks okay I think. And of course, this only works if you do not show information about objects on the desktop.
 

rjsbass

macrumors member
Nov 20, 2006
52
0
Ah..I see where the problem is...
The Code in my post, isn't actually the Code I posted (sounds strange, though right =)!
It's been formatted by the forum software somehow....

This:
Code:
 sed -e 's/°/°C/' |

is wrong. You have to replace & # 1 7 6 ; (remove spaces)



This will work for you:
http://dl.getdropbox.com/u/1144075/test.sh.zip

what does this mean? 'replace & # 1 7 6 ; '

i'm trying to get this code to work
 
Status
Not open for further replies.
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.