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.
Here's a sample of my current set up. Thanks for all the scripts!


5235453353_1e15877def.jpg

5236043968_6df6acacf4.jpg
*

http://player.vimeo.com/video/17459093

images sreen captured from www.coachdantonio.com
set to refresh every 5sec
Font: Anklepants
http://www.1001freefonts.com/Anklepants.php


All scripts found somewhere in this forum.

Someone should compile a wiki, or more updated/organized site!

can somebody provide me with the script for this calendar??

i would greatly appreciate it
 
can somebody provide me with the script for this calendar??

i would greatly appreciate it

here's dateline: http://www.macupdate.com/app/mac/18272/dateline

and the script im using that kinda looks the same:
Code:
#!/usr/bin/env ruby
#
# Author: Robert Jorgenson
# Author email: rjorgenson@gmail.com
require 'Date'
ABBR_DAYNAMES = {0, 'Su', 1, 'Mo', 2, 'Tu', 3, 'We', 4, 'Th', 5, 'Fr', 6, 'Sa'}

def days_in_month(year, month)
  return (Date.new(year, 12, 31) << (12 - month)).day
end

def day_in_month(year, month, day)
  return Date.new(year, month, day).wday
end

def build_day_array(year, month)
  day_array = Array.new
  for d in (1..days_in_month(year, month))
    day_array[d] = ABBR_DAYNAMES[day_in_month(year, month, d)]
  end
  day_array.shift
  return day_array * " "
end

def build_separator(year, month)
  color = "\e[30m" #black
  #color = "\e[37m" #uncomment for white
  separator_string = "██" # change this to change separator, best if 2 characters wide
  close = "\e[0m" # don't change this
  separator = Array.new
  for d in (1..days_in_month(year, month))
    if year == Time.now.year && month == Time.now.month && d == Time.now.day then
      separator[d] = "#{color}#{separator_string}#{close}"
    else
      separator[d] = "#{separator_string}"
    end
  end
  separator.shift
  return separator * "█"
end

def build_date_array(year, month)
  date_array = Array.new
  for d in (1..days_in_month(year, month))
    date_array[d] = d
  end
  date_array.shift
  date_array.each do |d|
    if d < 10 then
      date_array[(d-1)] = "0#{d}"
    end
  end
  return date_array * " "
end

year = Time.now.year
month = Time.now.month

puts build_day_array(year, month)
puts build_separator(year, month)
puts build_date_array(year, month)
 
Attached is a 3-month calendar with the current month progress and day highlighted. Below is the code for it.

Code:
cal -m $(($[10#$(date +%m)]-1)) | sed -e s'/^/ /'
echo "\033[32m\c"
cal | sed "s/^/ /;s/$/ /;s/ $(date +%e | sed s'/ //') /$(date +%e | sed -e s'/ //' -e s'/\(.*\)/ \1 /g')/"
cal -m $(($[10#$(date +%m)]+1)) | sed -e s'/^/ /'
There are escaped characters on line 3. They are entered by doing a control+q esc (It's invisible when typed) and go right before the two [ chars toward the end of the line. When used inside a double quote area, you can use \033 instead, like on line 2. The coloring is done with ANSI color does. This page list the small list of codes.

Edit [20100801]: There was an octal parsing error so made the script parse to decimal explicitly.

Hi, I was wondering why whenever I put in a calendar shell, the dates don't line up correctly. I'm not sure if it's something I'm missing or something wrong with my program.
 
Hi, I was wondering why whenever I put in a calendar shell, the dates don't line up correctly. I'm not sure if it's something I'm missing or something wrong with my program.

If it doesn't line up correctly, try using Courier or Courier new or somethin like that as a font.. it'll be correctly normally ^^


Meanwhile I'm tryin to find how to get the weather forecast like an icon and expected degrees for the next 2/3 days.. but can't seem to find it.. *newbiemode activated*
 
Followed directions and tried to make date, time, temp, cd playing part of the wallpaper. Good stuff :D
 

Attachments

  • Screen shot 2011-03-31 at 8.41.59 PM.png
    Screen shot 2011-03-31 at 8.41.59 PM.png
    952.7 KB · Views: 319
Question about a GeekTool script for anyone who knows anything about scripting:

Alright, so I have this script (pulled it off the internet somewhere):

Code:
top -l 1 | awk '/PhysMem/ {print $8 " : RAM"}'; top -l1 | grep "CPU usage:" | sed 's/.*\(CPU .*\)\ user.*/\1/' | awk '{print $3 " : " $1}'; uptime | awk '{print $3 " " $4 " " $5 " : UPTIME" }' | sed 's/\(.*\)\,/\1/'
And it comes out looking something like this:

Screen_shot_2011_04_02_at_2.51.17_PM.png


And I wanted to change it so the words "RAM," "CPU," and "UPTIME" are on the left. So I messed around for a bit and got this:

Code:
top -l 1 | awk '/PhysMem/ {print "RAM : " $8}'; top -l1 | grep "CPU usage:" | sed 's/.*\(CPU .*\)\ user.*/\1/' | awk '{print "CPU : " $3 " : " $1}'; uptime | awk '{print "UPTIME : " $3 " " $4 " " $5 }' | sed 's/\(.*\)\,/\1/'
Which renders this:

Screen_shot_2011_04_02_at_2.51.24_PM.png


Now, how do I make the "CPU" on the end go away?

Thanks in advance!

as an aside, my desktop
 
Last edited:
Hi everyone,

There is something I'd like my geektool set-up to do (if it's possible), but I don't have the coding know-how to set it up. I was hoping one of you guys (or gals) can help me.

Basically, what I want to display the days of the week using the appropriate Kanji. So a script that checks the day, then returns the appropriate kanji. I think it's possible, and it doesn't seem complicated, but I don't know how to code.

Here's the list of days/kanji:

Sun - 日
Mon - 月
Tues - 火
Wed - 水
Thur - 木
Fri - 金
Sat - 土

Thanks in advance!

For you Sinophiles out there, here's the script for Chinese:

Code:
date "+%A" | sed -e 's/Monday/星期一/g' -e 's/Tuesday/星期二/g' -e 's/Wednesday/星期三/g' -e 's/Thursday/星期四/g' -e 's/Friday/星期五/g' -e 's/Saturday/星期六/g' -e 's/Sunday/星期日/g'

And months as well:

Code:
date "+%B" | sed -e 's/January/一月/g' -e 's/February/二月/g' -e 's/March/三月/g' -e 's/April/四月/g' -e 's/May/五月/g' -e 's/June/六月/g' -e 's/July/七月/g' -e 's/August/八月/g'  -e 's/September/九月/g'  -e 's/October/十月/g'  -e 's/November/十一月/g'  -e 's/December/十二月/g'

Screen_shot_2011_04_03_at_12.32.14_AM.png


Now isn't that just lovely?
 
And I wanted to change it so the words "RAM," "CPU," and "UPTIME" are on the left. So I messed around for a bit and got this:

Code:
top -l 1 | awk '/PhysMem/ {print "RAM : " $8}'; top -l1 | grep "CPU usage:" | sed 's/.*\(CPU .*\)\ user.*/\1/' | awk '{print "CPU : " $3 " : " $1}'; uptime | awk '{print "UPTIME : " $3 " " $4 " " $5 }' | sed 's/\(.*\)\,/\1/'
Which renders this:

Screen_shot_2011_04_02_at_2.51.24_PM.png


Now, how do I make the "CPU" on the end go away?

Just remove the

: " $1

from the CPU info output. Thus:
Code:
top -l 1 | awk '/PhysMem/ {print "RAM : " $8}'; top -l1 | grep "CPU usage:" | sed 's/.*\(CPU .*\)\ user.*/\1/' | awk '{print "CPU : " $3}'; uptime | awk '{print "UPTIME : " $3 " " $4 " " $5 }' | sed 's/\(.*\)\,/\1/'
 
Sorry to bring up old stuff, but a few pages back is a guide to setting up weather scripts with Yahoo, and I am having a slight issue with it.

Here is a screen shot of my weather display. Is there a way to get rid of that odd character in the degree display?
2degreesAC.png


Here is the code I used to get it:
Code:
curl --silent "http://xml.weather.yahoo.com/forecastrss?p=YourCityCodeHere" | 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

Other details that may be of use:
I run OS X Tiger 10.4.11
Geektool 2
Intel iMac

I understand some things just won't work with Tiger, perhaps this is one of them.



edit:
I forgot my second question:

To get the image in the background for the "partly cloudy" thing, the guide had a shell script which left me with a blank window. It said that it would be blank, and that's okay. It then said to link to a picture in my tmp folder.

What I did was made another geektool entry with a link to that picture in the tmp folder, is that correct? or should I have put the link somewhere in the shell script?
 
Just remove the

: " $1

from the CPU info output. Thus:
Code:
top -l 1 | awk '/PhysMem/ {print "RAM : " $8}'; top -l1 | grep "CPU usage:" | sed 's/.*\(CPU .*\)\ user.*/\1/' | awk '{print "CPU : " $3}'; uptime | awk '{print "UPTIME : " $3 " " $4 " " $5 }' | sed 's/\(.*\)\,/\1/'

Excellent, thanks.
 
I'm terribly sorry if this has been asked before and I missed it -

I'm new to GeekTools, and although I've been having lots of fun with it, I wonder if there is a way I can "lock it" to a specific Space.

Amazed by everything I've seen so far,

Zetthy\\
 
Where can I find the weather script you are using? I like it a lot!

for the billionth time its a yahoo widget! when are people gonna start to read the previous pages before posting? ;)

and while im at it. anyway to get the font youre using pdrolvra?

I'm terribly sorry if this has been asked before and I missed it -

I'm new to GeekTools, and although I've been having lots of fun with it, I wonder if there is a way I can "lock it" to a specific Space.

Amazed by everything I've seen so far,

Zetthy\\

nope. not possible. not in geektool 3 at least...

just changed my desktop. same setup than before, different image (from http://vhm-alex.deviantart.com/)
 

Attachments

  • Screen shot 2011-04-04 at 11.34.53 PM.jpg
    Screen shot 2011-04-04 at 11.34.53 PM.jpg
    165 KB · Views: 391
Last edited:
Does anyone know what these yahoo geektool scripts are written in?

I'm trying to remove an odd character in the output, but I'm basically just randomly deleting sections of the code and hoping it works. It may help if I had at least some understanding of how it works.


The code in question is:
Code:
curl --silent "http://xml.weather.yahoo.com/forecastrss?p=YOURCITYCODE&u=c" | 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


My problem is that the temperature output has an odd character between the temperature, and the degrees symbol.
 
Alright I broke down the code and noticed that there is a lot of "-e" sections, which seem to be commands. As it turns out, the problem seems to be the fact that the ° symbol is in final bit of code.

I guess geektool does not know how to handle it. If I delete the ° symbol, the odd character vanishes. If I place an * in there, it works just fine.

edit: Solved (Sort of).

Since my version of OS X, or Geektool seems to be unable to handle the degrees symbol in the code, I just removed it completely. To get a degree symbol up there, I create an image a transparent background and a degree symbol which can easily sit there since the symbol itself never needs to change.
 
Last edited:
Oh no,,, sorry,,, I talked about that one in the right lower corner with the multi colours.... :rolleyes:

oh this one... I think I'm starting to have too many things on my desktop... :p

its my school schedule. so I just took a print screen of it, erased all the white in preview (instant alpha) and put some colors around the different classes. I had fun making it! :D
 
Status
Not open for further replies.
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.