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.
Hello,

i just found out how cool Geeltool is and have not been able to stay away from it...

I do have a rather pressing issue...

Is there a quick fix, of any fix for that matter, to get my font to print in CAPS?

I have a simple desktop and would like to have my date spelled out in caps. this is what i have over 2 geeklets.


date '+%A'

date '+%B %e'


also i would like to do the same with my weather... split the conditions and actual temperature to different lines, and have it all in caps...

curl --silent "http://weather.yahooapis.com/forecastrss?p=USCA0638&u=f" | grep -E '(Current Conditions:|F<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 would be great if someone could help me out with this...

thanks a million.

For the date stuff:
Code:
date +%A | tr "[:lower:]" "[:upper:]"
date '+%B %e' | tr "[:lower:]" "[:upper:]"

Try this script for the weather:
http://xtacocorex-geektool-scripts.googlecode.com/files/yahooweathergrabv2.py

Here are the script options:
Code:
Options:
  -h, --help    show this help message and exit
  -t, --temp    show the temperature + unit
  -d, --deg     show the temperature in degrees only
  -c, --cond    show the weather condition
  -o, --code    show the weather code (used to map the weather to the weather image file)
  -b, --both    show both the condition and temperature + unit
  -m, --metric

This will work, but you'll need to go back to this post to see how to install the script. There is a bunch of extra stuff in that post that isn't needed. The script linked above will automatically get your location based upon your ip address.

As I stated above, I'll be doing a major overhaul of my weather scripts.
 
wow, thanks.

i plugged in the all caps code right away and it worked great...

i think the only person happier than me is my wife... now i will be searching endlessly for this command...

i also tried the new weather code... but i was completely lost, sorry...

i downloaded and installed python, then i launched, double clicked, the .py file...

i did not get any results... can you give me a little hint where i can find more info on this, or just tell me what i have to do to make this guy work...

thanks, sorry to be so helpless...
 
Some of that is already in this thread, don't know about the GPU percent usage though.

I had downloaded a program from somebody that had some specialized stuff in it that allowed you to get system information out, it's smc.custom. I can't find it anywhere on the internets though and I don't know who provided it.

Thank you for your reply. I was able to get the memory/CPU, but Not able to get the Up/Dn, would you be able to help me with that?

Also for the CPU I used this:

top -l 1 | awk '/Load/ {print '; top -l 1 | awk '/CPU usage/ {print $1 " " $2" " $3" "$4" "$5" "$6" "$7" "$8}' ;

And it looks like this:

ANyha.png


I tried to tinker with the script, but I keep failing, I'd like to remove the sys and idle so it's just 0.0% User.

Thank you.
 
I'm thinking of an all inclusive, multiple site capable, weather center. It will grab your ip from the site that I currently use or the one you just provided. This could be the weather script to end all weather scripts.

Now I just need time to plan it out and start implementing.

This would be so awesome. Thanks for your response and best of luck on this ultimate weather script!
 
Thank you for your reply. I was able to get the memory/CPU, but Not able to get the Up/Dn, would you be able to help me with that?

Also for the CPU I used this:

top -l 1 | awk '/Load/ {print '; top -l 1 | awk '/CPU usage/ {print $1 " " $2" " $3" "$4" "$5" "$6" "$7" "$8}' ;

And it looks like this:

Image

I tried to tinker with the script, but I keep failing, I'd like to remove the sys and idle so it's just 0.0% User.

Thank you.

Is Up/Down the network utilization?

Here is the CPU usage for just the user:
Code:
top -l 1 | awk '/CPU usage/ {print $1 " " $2" " $3" "$4}' | sed -e 's/,//'

Here is the CPU Load Average for 1, 5, and 15 minute intervals:
Code:
top -l 1 | awk '/Load/ {print " 1 min: "$3"\n 5 min: "$4"\n15 min: "$5}' | sed -e 's/,//'
 
Is Up/Down the network utilization?

Here is the CPU usage for just the user:
Code:
top -l 1 | awk '/CPU usage/ {print $1 " " $2" " $3" "$4}' | sed -e 's/,//'

Here is the CPU Load Average for 1, 5, and 15 minute intervals:
Code:
top -l 1 | awk '/Load/ {print " 1 min: "$3"\n 5 min: "$4"\n15 min: "$5}' | sed -e 's/,//'

Thank you very much. Yes that's what it is for. I came across this script in my search for one, and it seems to work well.

Network activity Up/Dn

#!/bin/sh
# created by chris helming.
# chris dot helming at gmail
# get the current number of bytes in and bytes out
myvar1=`netstat -ib | grep -e "en1" -m 1 | awk '{print $7}'` # *bytes in
myvar3=`netstat -ib | grep -e "en1" -m 1 | awk '{print $10}'` # bytes out
#wait one second
sleep 1
# get the number of bytes in and out one second later
myvar2=`netstat -ib | grep -e "en1" -m 1 | awk '{print $7}'` # bytes in again
myvar4=`netstat -ib | grep -e "en1" -m 1 | awk '{print $10}'` # bytes out again
# find the difference between bytes in and out during that one second
subin=$(($myvar2 - $myvar1))
subout=$(($myvar4 - $myvar3))
# convert bytes to kilobytes
kbin=`echo "scale=2; $subin/1024;" | bc`
kbout=`echo "scale=2; $subout/1024;" | bc`
# print the results
echo "Up: $kbout KB/S" "Dn: $kbin KB/S"
 
Thank you very much. Yes that's what it is for. I came across this script in my search for one, and it seems to work well.

Sweet, found that one too in my searches; just wasn't sure if that was your ultimate goal. Glad everything is working now.
 
I'll keep that one in mind when I re-do all the weather stuff I've done. I need to get the chance of precipitation for parsed from the Weather Channel for ren7on.

I'm thinking of an all inclusive, multiple site capable, weather center. It will grab your ip from the site that I currently use or the one you just provided. This could be the weather script to end all weather scripts.

Now I just need time to plan it out and start implementing.

Thank you so much xtacocorex!!!!!!
 
This seemed like an almost impossible task, but thanks to some persuasion from activate and reading between the lines (in the html code on www.foxsports.com.au/results) I have figured out how to get the Australians their live sports scores.

Introducing, the Australian Sports Live Scoreboard!

Have you been able to figure out an American sports feed geeklet? All I am interested in is the scores for the Detroit Red Wings or NHL.
 
Have you been able to figure out an American sports feed geeklet? All I am interested in is the scores for the Detroit Red Wings or NHL.

Not yet, I started on the Ultimate Weather script, which I think I'm making it too complex.

I just opened up ESPN.com and pulled the source. Similar to the Fox Sports Australian page, all the score data is in JSON, so it shouldn't be too hard to parse through, but it's going to be involved since there is a lot of data.
 
Does anyone have a script that can display the number of files in a selected directory?
 
Does anyone have a script that can display the number of files in a selected directory?

The ls and wc command is what you after. It list or display the contents inside a directory.

so, to write a bash script using ls command. it will look something like this.



Code:
#!/bin/bash  
#.bash script

variablename=$(ls <path> | wc -l);  #replace the <path> with the actual selected path you want to display. 
# the wc -l command counts the number contents that inside the selected directory. 

echo $variablename; #echo prints out the results


But there is another way of doing it. instead of wc command you could use grep -c " " command.
 
Last edited:
The ls and wc command is what you after. It list or display the contents inside a directory.

Thanks but that's not exactly what I'm looking for. I simply want the total count of files to be displayed numerically. if there are 12,765 files in a folder, i want that number displayed on my desktop. A user definable refresh rate would be nice as well.
 
Thanks but that's not exactly what I'm looking for. I simply want the total count of files to be displayed numerically. if there are 12,765 files in a folder, i want that number displayed on my desktop. A user definable refresh rate would be nice as well.

Yes. But I have piped it with another command that does the total count and that it will display numerically, which does lead into the right direction. But what I don't know if there is a command that will do it specifically of a file type that you asking. Maybe someone else here can.
 
The ls and wc command is what you after. It list or display the contents inside a directory.

so, to write a bash script using ls command. it will look something like this.



Code:
#!/bin/bash  
#.bash script

variablename=$(ls <path> | wc -l);  #replace the <path> with the actual selected path you want to display. 
# the wc -l command counts the number contents that inside the selected directory. 

echo $variablename; #echo prints out the results


But there is another way of doing it. instead of wc command you could use grep -c " " command.

Thanks but that's not exactly what I'm looking for. I simply want the total count of files to be displayed numerically. if there are 12,765 files in a folder, i want that number displayed on my desktop. A user definable refresh rate would be nice as well.

Yes. But I have piped it with another command that does the total count and that it will display numerically, which does lead into the right direction. But what I don't know if there is a command that will do it specifically of a file type that you asking. Maybe someone else here can.

Looking into spotlight search command mdfind, which is probably exactly the one. What kind of files in your directory do you have in there with a specific number that you want display in the desktop, is it just documents??
 
Looking into spotlight search command mdfind, which is probably exactly the one. What kind of files in your directory do you have in there with a specific number that you want display in the desktop, is it just documents??

the kind of file is not important. i just need a tally of all the files in all the subfolders of a selected directory. say i have a folder of dvd rips. inside that folder the .mkv files are further sorted into folders according to genre. i want a total number of mkv files to display on my desktop.
 
the kind of file is not important. i just need a tally of all the files in all the subfolders of a selected directory. say i have a folder of dvd rips. inside that folder the .mkv files are further sorted into folders according to genre. i want a total number of mkv files to display on my desktop.

You can use mdfind for that.

Code:
mdfind -count -onlyin PATH mkv

replace PATH with the actual directory path where the mkv files are.
 
You can use mdfind for that.

Code:
mdfind -count -onlyin PATH mkv

replace PATH with the actual directory path where the mkv files are.

Thanks! Is there a way to total the sum of two different file formats. For example, display the total of all mkv AND mp4 files?
 
Thanks! Is there a way to total the sum of two different file formats. For example, display the total of all mkv AND mp4 files?

Yes there is a way. But i'm finding mdfind isn't just finding the one file format as i thought it would by telling the command to find the one file format. My findings using the mdfind command display some other file formats in the search with a different file format not the file extension you want mdfind to display and or count.

Instead of using mdfind use the find command to find one or more file formats but it has to be piped with another command that does the total count because find does not have a count flag like mdfind does.

to find one file format:

Code:
find PATH  -name "*.mkv" | wc -l

or to find two file formats:

Code:
find PATH \( -name "*.mkv" -or  -name "*.mp4" \) | wc -l
 
to find one file format:

Code:
find PATH  -name "*.mkv" | wc -l

or to find two file formats:

Code:
find PATH \( -name "*.mkv" -or  -name "*.mp4" \) | wc -l

This works perfectly! Thanks so much for your help.
 
Hi, I'm kinda new to geektool and would like to know how you can mirror the hour or date to make it look like a reflection. And also to be able to bring the clock in a perspective. I've read that it is possible with a program called imagemagick, but I have no clue on how to use it. Does anyone have a tutorial, or a simple explanation on how it works? I would like to learn it though, to create some awesome geektool wallpapers! Here is one of my creations,

9f7ad5e.jpg
 
Hi, I'm kinda new to geektool and would like to know how you can mirror the hour or date to make it look like a reflection. And also to be able to bring the clock in a perspective. I've read that it is possible with a program called imagemagick, but I have no clue on how to use it. Does anyone have a tutorial, or a simple explanation on how it works? I would like to learn it though, to create some awesome geektool wallpapers! Here is one of my creations,

Image

That's great! Can I please have a link to the wall paper?
 
Hi, I'm kinda new to geektool and would like to know how you can mirror the hour or date to make it look like a reflection. And also to be able to bring the clock in a perspective. I've read that it is possible with a program called imagemagick, but I have no clue on how to use it. Does anyone have a tutorial, or a simple explanation on how it works? I would like to learn it though, to create some awesome geektool wallpapers!

Imagemagick isn't worth the pain and hassle of installing it onto the system. It would also use up enough cycles that it might cause the time to be off from system time.
 
Status
Not open for further replies.
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.