My new Geektooldesktop - with the help of everyone in the forum (kudos!)
Clean and easy to read.
My new Geektooldesktop - with the help of everyone in the forum (kudos!)
Create a php script as follows:Anyone know how to made script for get seconds,minutes, or days left to 2011 ?
that would be great![]()
<?php
date_default_timezone_set('America/New_York');
$nxtYear = date(Y)+1;
$futDate = mktime(00,00,00,01,01,$nxtYear);
$nowDate = time();
$secRemain = number_format(($futDate - $nowDate),0,'.',',');
$minRemain = number_format(($futDate - $nowDate)/60,0,'.',',');
$hrsRemain = number_format(($futDate - $nowDate)/3600,0,'.',',');
$dayRemain = number_format(($futDate - $nowDate)/86400,0,'.',',');
printf("Seconds Until %4s :%' 11s\n",$nxtYear,$secRemain);
printf("Minutes Until %4s :%' 11s\n",$nxtYear,$minRemain);
printf("Hours Until %4s :%' 11s\n",$nxtYear,$hrsRemain);
printf("Days Until %4s :%' 11s\n",$nxtYear,$dayRemain);
?>
php /var/tmp/date_diff.php
Seconds Until 2011 : 31,316,869
Minutes Until 2011 : 521,948
Hours Until 2011 : 8,699
Days Until 2011 : 362
Assuming you used Geektools to create the black box; e.g., an empty shell, you can right-click on the shell and choose Send to Back.On the left side I have that black box, is there a way to set it to always be behind so it doesnt fade my font?
Assuming you used Geektools to create the black box; e.g., an empty shell, you can right-click on the shell and choose Send to Back.
these are my geektool scripts for finance does anyone know how to get them to go red when their at a loss and green when their at a gain.
Hi antcuc,
It's actually just a simple workaround. You make two scripts laid on top of each other, one in green and one in red. Then you configure the red one not to print anything if the stock has gone up and green one not to print anything if the stock has gone down.
So, take a general stock quote script. Here's mine for the DOW:
curl http://www.google.ca/finance?q=INDEXDJX:.DJI | sed -n '/price-panel style/,/ Close/p' | sed -e :a -e 's/<[^>]*>//g;/</N;//ba'| sed '/^$/d' | sed -e '$!N;s/\n/ /' -e '$!N;s/\n/ /' | head -1 | sed 's/^/DOW: /g'
That outputs: DOW: 9,256.26 -24.71 (-0.27%)
Now copy it so you have two.
Then add this to the end of the one you make red:
| sed -n '/-/p'
That makes it so it will only print lines where a "-" appears, so it'll only give the output if things went south that day.
Then, add this one to the one that you make green:
| sed '/-/d'
That'll delete the output if a "-" appears, so it'll only print if the index went up or stayed put.
Since, you're just modifying the format of the two scripts, you can have any change occur depending on whether things went up or down. You could have the background change colour or tranparency. You could change the font, size, whatever.
Hope that helps, let me know if you have any other questions.
(Oh yeah, and to make this work for other stocks, you just have to change the link in the original curl script, and then change the label that you give it at the end of the script)
Hi MSTRKRFT - here's my workaround all the way back from post 751:
I scoured the entire thread to make a comprehensive list of most geektool scripts because I got tired of going through all 63 pages. Please look at my uploaded files see if you have anything to add and then PM me with what you think will help. I'm uploading this now but it might change within the next hour or two so pay attention to that. I hope this can help the beginners and maybe we can see better codes.
MSTRKRFT
Does anyone have a script for Sunset and Sunrise that doesn't need zipcodes?
I tried to use the ones you posted on page 10 with lynx and nothing came up. I do have lynx installed and everything but still nothing showed up.
EDIT: I just got my iCal events and To Do list to show up. I wanted to get the headers underlined but when I choose underline in the font section it doesn't actually underline it. Any suggestions?
I don't use lynx and more. Use the curl scripts.
When I try that nothing shows up when I use my Zip and I went to wund website and put my zip in and copied the adress and when I use that on geektool I just get all the html info, same problem you seemed to have back then. How did you fix it?
I'd really like to hear what you think of my guide. So please let me know if one thing needs to be worked on. I enjoy doing this for like an hour a night. I went through 4 versions in a matter of a day, it will probably be slower from here on out just because I'm struggling to find new stuff.
searching your city on yahoo's weather service at weather.yahoo.com you'll be redirected to your city's weather page and that's the URL you should use between the quotes.Image Grabber
curl --silent "http://weather.yahoo.com/netherlands/north-holland/haarlem-729636YOU GOTTA REPLACE ALL THIS BUT I REALLY DON"T KNOW HOW TO PUT IT" | grep "forecast-icon" | sed "s/.*background\:url(\'\(.*\)\')\;\ _background.*/\1/" | xargs curl --silent -o /var/tmp/weather_image.png\
Displays nothing but it gets the weather image for the next shell script.
I can get "Fair, 24 F" from Yahoo
But I can't seem to get just "24 F"
Any ideas on that?
curl --silent "http://weather.yahooapis.com/forecastrss?p=[B]YOURCITY[/B]&u=[B]c[/B]" | 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/<description>//' -e 's/<\/description>//' [B]-e 's/[A-Za-z]*, //'[/B] | tail -n1
this is your script for temperature only:
Code:curl --silent "http://weather.yahooapis.com/forecastrss?p=[B]YOURCITY[/B]&u=[B]c[/B]" | 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/<description>//' -e 's/<\/description>//' [B]-e 's/[A-Za-z]*, //'[/B] | tail -n1
- remember to change the substring YOURCITY with the code of your city;
- the c means Celsius, for Fahrenheit should replace it with f;
- the last bold substring is the part i append to let show only the temperature.
That works for things like "Cloudy, 42 F" = "42 F"
But if it is "Partly Cloudy, 42 F" = "Partly 42 F"
curl --silent "http://weather.yahooapis.com/forecastrss?p=YOURCITY&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/<description>//' -e 's/<\/description>//' [B]-e 's/[A-Z a-z]*, //'[/B] | tail -n1
sorry, I forget a space in the regular expression...
Code:curl --silent "http://weather.yahooapis.com/forecastrss?p=YOURCITY&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/<description>//' -e 's/<\/description>//' [B]-e 's/[A-Z a-z]*, //'[/B] | tail -n1
this one works great!
I'd really like to hear what you think of my guide. So please let me know if one thing needs to be worked on. I enjoy doing this for like an hour a night. I went through 4 versions in a matter of a day, it will probably be slower from here on out just because I'm struggling to find new stuff.