townrest.blogg.se

Geektool weather 2015
Geektool weather 2015








geektool weather 2015

Can you run this in your shell? which ansiweatherĭepending where you have ansiweather it may be something like /usr/local/bin/ansiweather or /bin/ansiweather. My first guess is that you have installed ansiweather on your PATH, but that cron is not picking it up. * * * * * ansiweather -l Oslo,NO -f1 -a false > Applications/GeekTool/geeklets/weather/ansiweather.txtĬron will run commands for you, but its environment (use env to list your environment variables and values) may different from your user environment. So, does anyone have any experience with crontab? I feel like I'm missing something very simple. But if I run the script manually, everything works like it should. I also tried creating a small script that does the same thing and then get crontab to run the script, with the same results. But if I run the exact same command directly, the file spawns and fills in perfectly. The crontab runs like it should and the text-file gets created, but for some reason the file is empty. I set up crontab to run the command I want every minute as a test (I'll change that to once an hour later). But to get the updated weather displayed I need to run the command from terminal, which obviously isn't optimal. txt file that I can then display with Geektool. To get the weather I use Ansiweather, which I finally got configured the way I want it and I got it to write the output to a simple. Nothing fancy, just date, time, weather and a countdown to RDR2s release. Now my Desktop looks like this.Ok, so I've got everything set up the way I want it. The change is the optional hyphen ( -?) before the digit.

geektool weather 2015

The temperature is always on theġ7: # second line, so exchange it with the last line.Ģ0: # Sometimes there's a windchill line, and sometimes there isn't.Ģ1: # Add a blank line to the front of the array if there isn't.Ģ4: # Print the lines of interest in the order I want.Ģ5: print join "", 7 has the new regular expression. This is what the noaanow script looks like now: 1: #!/usr/bin/perlģ: # Grab all the lines and put in an array.Ħ: # Keep only certain lines for the current conditions.ħ: = grep /^ +(Temperature -?\d|Wind|Relative)/, # Erase the leading spaces and parenthetical (metric) values.ġ5: # I want the temperature line to print on the bottom to make itġ6: # easy to see on the desktop. I couldn’t believe I hadn’t run into this bug earlier maybe I just wasn’t paying attention on below-zero days before today. So the regular expression didn’t collect the temperature line. The problem was that today’s temperature didn’t start with a digit( \d), it started with a minus sign (actually a hyphen). Many lines in the data start with the word “Temperature,” but only the line with the current temperature is immediately followed by a number, hence the Temperature \d portion of the regular expression. Ob KARR 181452Z 00000KT 4SM BR CLR M18/M18 A3034 RMK AO2 SLP291 T11781183 51011Īnd here’s the line in the Perl script that extracts the data I want = grep /^ +(Temperature \d|Wind|Relative)/, is the list of all the lines in the data. Pressure tendency 0.03 inches (1.1 hPa) higher than three hours ago Here’s chunk of the output that has the current conditions Conditions at In the Terminal, I saw what the problem was. I first thought that NOAA had changed the format of the data, which would screw up my extraction script, but after running /opt/local/bin/lynx -dump -width 100 This gets a big chunk of data from the local NOAA weather station and dumps it to a Perl script that extracts just the parts I want to display. Why was the temperature missing? The GeekTool shell command that controls the display is this command /opt/local/bin/lynx -dump -width 100 | /Users/drang/bin/noaanow Here’s what the lower left corner of my Desktop looked like. Today I noticed that my GeekTool weather information was goofed up.

geektool weather 2015

Next post Previous post GeekTool desktop weather fix










Geektool weather 2015