ConkyForecast-SunsetSunriseCountdown.py help (en)
From Conky PitStop
conkyForecast-SunsetSunriseCountdown.py help
| Language | English Français |
Author: Mark Buck (Kaivalagi)
NOTE: Weather.com have removed developer support and as such most will have great difficulty using the service through the conkyForecast script in the future.
Please note however that there is an "alpha" version of the script called conkyForecastWU which is also included in the latest conkyWeather package and is detailed towards the end of this thread which works against weather underground...this is a good alternative but has not been documented for here as yet.
There has been an addition to conkyforecast_2.18 - conkyForecast-SunsetSunriseCountdown.py
This little app calculates the time to sunrise or sundown, depending on the position of the sun. It changes between the two automatically.
09:39 ~
$ conkyForecast-SunsetSunriseCountdown --help
Usage: conkyForecast-SunsetSunriseCountdown.py [options]
Options:
-h, --help show this help message and exit
-C FILE, --config=FILE
[default: ~/.conkyForecast.config] The path to the
configuration file, allowing multiple config files to
be used.
-l CODE, --location=CODE
location code for weather data [default set in
config]. Use the following url to determine your
location code by city name:
http://xoap.weather.com/search/search?where=Norwich
-o OPTION, --outputformat=OPTION
default:[DIFF]Specify the format of the output date
time difference values, options are either DIFF,
HOURS, MINUTES, SECONDS
-L, --longoutput Specify if long output is required resulting in plain
english output such as '1 hr 2 mins 14 secs' rather
than '01:02:14' or '23 secs' rather than '23'
-t, --textoutput Request textual output instead of time to remain to
identify whether a sunset or sunrise is due, will
either be 'Sunrise' or 'Sunset'
-v, --verbose Request verbose output, not a good idea when running
through conky!
-V, --version Displays the version of the script.
--errorlogfile=FILE If a filepath is set, the script appends errors to the
filepath.
--infologfile=FILE If a filepath is set, the script appends info to the
filepath.
09:39 ~
$
There is a GOTCHA though:
It MUST be run after conkyForecast has created the cache file as it does not go on the internet to collect the information, it reads the existing cashed file.
Here is a shot of it in action. It is also being used with an ${if_matching} statement to display a sun during the day and a moon at night. Sunrise and sunsets look too similar to know the difference, in my opinion.
Here is the code used in the image above:
${color4}${hr 1}${color}${if_match "${execi 1 conkyForecast-SunsetSunriseCountdown --location=ARBA0009 -t}"=="Sunrise"}${image ~/Conky/images/Moon.png -p 150,140 -s 60x60}${else}${image ~/Conky/images/Sun.png -p 150,140 -s 60x60}${endif}
${voffset 5}${goto 22}${color3}Sunrise:${goto 90}${color}[--datatype=SR]
${goto 28}${color3}Sunset:${goto 90}${color}[--datatype=SS]
${goto 16}${color3}Daylight:${goto 90}${color}[--datatype=DL]
${goto 10}${color3}${execi 1 conkyForecast-SunsetSunriseCountdown --location=ARBA0009 -t} in:${goto 90}${color}${execi 1 conkyForecast-SunsetSunriseCountdown --location=ARBA0009}
${color4}${hr 1}${color}
