You are not logged in.

#1451 2017-01-12 18:29:39

Sector11
Tpyo Knig
From: 77345 ¡#
Registered: 2015-08-20
Posts: 5,260

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

NICE!  One quick question.

Why the LUA script?


BunsenLabs Forum Rules ---== I'm a Conky 1.9'er ==---
System:    Host: s12 Kernel: 3.16.0-4-amd64 x86_64 (64 bit gcc: 4.8.4)
Desktop: Openbox 3.5.2 dm: (startx) Distro: Debian GNU/Linux 8

Offline

#1452 2017-01-12 19:29:24

chepioq
Member
Registered: 2015-11-29
Posts: 63

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

Sector11 wrote:

NICE!  One quick question.

Why the LUA script?

Why not ? wink
In my conky with yahoo's api, I have a lua script, I prefer launch the wget before drawing to the window, with conky 1.9 I used "pre_exec" command for that, but with conky 1.10 this command no longer exists.

Offline

#1453 2017-01-12 19:56:43

Sector11
Tpyo Knig
From: 77345 ¡#
Registered: 2015-08-20
Posts: 5,260

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

chepioq wrote:

Why not ? wink

That answer is right up there with Crinos512's response about his 'bash powered conky' 8 years ago:  Because I can.
End of the discussion.  big_smile

His conky was:

TEXT
${execpi 3600 ~/.conky/conkyparts/conkytemplate.sh}
${execpi 3600 ~/.conky/conkyparts/conkyheader.sh}
${execpi 60 ~/.conky/conkyparts/conkycalender.sh}
${execp ~/.conky/conkyparts/conkycore.sh}
${execp ~/.conky/conkyparts/conkymemory.sh}
${execpi 3600 ~/.conky/conkyparts/conkygraphics.sh}
${execp ~/.conky/conkyparts/conkydevices.sh}
${execp ~/.conky/conkyparts/conkynetwork.sh}
${execp ~/.conky/conkyparts/conkyTV.sh}
${execpi 3600 conkyForecast --location=USOK0233 --template=/home/crinos/.conky/conkyparts/weather.template}
chepioq wrote:

with conky 1.9 I used "pre_exec"

That's "one of" the reasons I won't move to conky v1.10 in the foreseeable future, I use the "pre_exec" a lot, although I know at some time I'll have to.
- ${execi 86400 ...} just isn't the same.


BunsenLabs Forum Rules ---== I'm a Conky 1.9'er ==---
System:    Host: s12 Kernel: 3.16.0-4-amd64 x86_64 (64 bit gcc: 4.8.4)
Desktop: Openbox 3.5.2 dm: (startx) Distro: Debian GNU/Linux 8

Offline

#1454 2017-01-13 05:22:54

chepioq
Member
Registered: 2015-11-29
Posts: 63

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

Sector11 wrote:

That's "one of" the reasons I won't move to conky v1.10 in the foreseeable future, I use the "pre_exec" a lot, although I know at some time I'll have to.

The setting "lua_draw_hook_pre" has the same effect as "pre_exec" command

lua_draw_hook_pre:

This function, if defined, will be called by Conky through each iteration before drawing to the window. Requires X support. Takes any number of optional arguments. Use this hook for drawing things on top of what Conky draws. Conky puts 'conky_' in front of function_name to prevent accidental calls to the wrong function unless you place 'conky_' in front of it yourself.

Offline

#1455 2017-01-13 21:22:52

TeoBigusGeekus
BL DieHard
From: /Greece/Kastoria
Registered: 2015-10-04
Posts: 819

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

Nice one chepioq.


Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!

Offline

#1456 2017-01-14 18:46:48

chepioq
Member
Registered: 2015-11-29
Posts: 63

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

Another weather conky in french, based on "2b_Wunderground_API" and without lua.
I modified the 2b script an rename in 3b
script 3b :

#!/bin/bash

#put your hemisphere here: n for north, s for south
hemisphere=n

#put your Weather Underground address API here
address="http://api.wunderground.com/api/your_api_key_here/conditions/forecast10day/astronomy/hourly/satellite/q/aubagne.json"

wun_icon_to_png () {
    if [[ $1 == day ]]; then
        case $2 in
            chanceflurries)
                echo 21
            ;;
            chancerain)
                echo 14
            ;;
            chancesleet)
                echo 26
            ;;
            chancesnow)
                echo 20
            ;;
            chancetstorms)
                echo 17
            ;;
            clear)
                echo 1
            ;;
            cloudy)
                echo 7
            ;;
            flurries)
                echo 21
            ;;
            fog)
                echo 11
            ;;
            hazy)
                echo 5
            ;;
            mostlycloudy)
                echo 6
            ;;
            mostlysunny)
                echo 4
            ;;
            partlycloudy)
                echo 4
            ;;
            partlysunny)
                echo 6
            ;;
            sleet)
                echo 26
            ;;
            rain)
                echo 18
            ;;
            snow)
                echo 22
            ;;
            sunny)
                echo 1
            ;;
            tstorms)
                echo 15
            ;;
            unknown)
                echo 0
            ;;
        esac
    elif [[ $1 == night ]]; then
        case $2 in
            chanceflurries)
                echo 43
            ;;
            chancerain)
                echo 39
            ;;
            chancesleet)
                echo 40
            ;;
            chancesnow)
                echo 43
            ;;
            chancetstorms)
                echo 41
            ;;
            clear)
                echo 33
            ;;
            cloudy)
                echo 38
            ;;
            flurries)
                echo 43
            ;;
            fog)
                echo 11
            ;;
            hazy)
                echo 37
            ;;
            mostlycloudy)
                echo 36
            ;;
            mostlysunny)
                echo 35
            ;;
            partlycloudy)
                echo 35
            ;;
            partlysunny)
                echo 36
            ;;
            sleet)
                echo 40
            ;;
            rain)
                echo 40
            ;;
            snow)
                echo 44
            ;;
            sunny)
                echo 33
            ;;
            tstorms)
                echo 41
            ;;
            unknown)
                echo 0
            ;;
        esac
    fi
    }
    
#rm $HOME/test/*.png

curl $address -o $HOME/test/raw_data
    
sed -n '/,	"current_observation": {/,/,	"satellite": {/p' $HOME/test/raw_data | sed 's/"Clear"/"Ciel dégagé"/g;s/"Partly Cloudy"/"Partiellement Nuageux"/g;s/"Chance of Flurries"/"Risque de neige"/g;s/"Chance of Rain"/"Risque de pluie"/g;s/"Chance Rain"/"Risque de pluie"/g;s/"Chance of Freezing Rain"/"Risque de pluie verglaçante"/g;s/"Chance of Sleet"/"Risque de grésil"/g;s/"Chance of Snow"/"Risque de neige"/g;s/"Chance of Thunderstorm*"/"Risque d orage"/g;s/"Cloudy"/"Nuageux"/g;s/"Flurries"/"Averse de neige"/g;s/"Fog"/"Brouillard"/g;s/"Haze"/"Brume"/g;s/"Mostly Cloudy"/"Plutôt nuageux"/g;s/"Mostly Sunny"/"Plutôt ensoleillé"/g;s/"Partly Sunny"/"Partiellement ensoleillé"/g;s/"Freezing Rain"/"Pluie verglaçante"/g;s/"Rain"/"Pluie"/g;s/"Sleet"/"Neige fondue"/g;s/"Snow"/"Neige"/g;s/"Sunny"/"Ensoleillé"/g;s/"Thunderstorm*"/"Orage"/g;s/"Overscat"/"Couvert"/g;s/"Scattered Clouds"/"Nuages épars"/g;s/"NW"/"NO"/g;s/"WNW"/"ONO"/g;s/"SW"/"SO"/g;s/"WSW"/"OSO"/g;s/"NNW"/"NNO"/g' > $HOME/test/Conditions
sed -i 's/^[ \t]*"//g' $HOME/test/Conditions
sed -i '/current_observation\|image":\|logo_\|title":\|link":\|^[ \t]*},$\|^[ \t]*}$\|temperature_string\|forecast_url\|history_url\|ob_url\|satellite":/d' $HOME/test/Conditions
sed -i -e 's/":"/\n/g' -e 's/",\|": {$//g' -e 's/"precip_1hr_string/\nprecip_1hr_string/g' -e 's/":/\n/g' -e 's/,$//g' $HOME/test/Conditions
sed -i -e 's/^http.*\/c\/k\///g' -e '/gif/s/_.*$//g' $HOME/test/Conditions
day_or_night=$(sed -n 137p $HOME/test/Conditions)
if [[ $day_or_night == nt ]]; then
	cp $HOME/test/Forecast_Images/$(wun_icon_to_png night $(sed -n 135p $HOME/test/Conditions)).png $HOME/test/Now.png
else 
	cp $HOME/test/Forecast_Images/$(wun_icon_to_png day $(sed -n 135p $HOME/test/Conditions)).png $HOME/test/Now.png
fi
#Forecast feature: Forecast
sed -n '/"forecast":{/,/"simpleforecast": {/p' $HOME/test/raw_data > $HOME/test/Forecast
sed -i -e '/"period":\|icon_url/d' $HOME/test/Forecast
sed -i 's/^[ \t]*"//g' $HOME/test/Forecast
sed -i -e '/period\|icon\|title\|fcttext/!d' -e 's/":"/\n/g' -e 's/":/\n/g' -e 's/",//g' -e 's/,$//g' -e 's/nt_//g' $HOME/test/Forecast

#Forecast feature: Moon_Sun
sed -n '/"moon_phase": {/,/"sun_phase": {/p' $HOME/test/raw_data > $HOME/test/Moon_Sun
sed -i 's/^[ \t]*"//g' $HOME/test/Moon_Sun
sed -i '/moon_phase\|^[ \t]*},$\|sun_phase\|^[ \t]*}$/d' $HOME/test/Moon_Sun
sed -i -e 's/":"/\n/g' -e 's/".*$//g' $HOME/test/Moon_Sun

#Forecast feature: Simple Forecast
sed -n '/"simpleforecast": {/,/"hourly_forecast": \[/p' $HOME/test/raw_data | sed 's/"Clear"/"Ciel dégagé"/g;s/"Partly Cloudy"/"Partiellement Nuageux"/g;s/"Chance of Flurries"/"Risque de neige"/g;s/"Chance of Rain"/"Risque de pluie"/g;s/"Chance Rain"/"Risque de pluie"/g;s/"Chance of Freezing Rain"/"Risque de pluie verglaçante"/g;s/"Chance of Sleet"/"Risque de grésil"/g;s/"Chance of Snow"/"Risque de neige"/g;s/"Chance of Thunderstorm*"/"Risque d orage"/g;s/"Cloudy"/"Nuageux"/g;s/"Flurries"/"Averse de neige"/g;s/"Fog"/"Brouillard"/g;s/"Haze"/"Brume"/g;s/"Mostly Cloudy"/"Plutôt nuageux"/g;s/"Mostly Sunny"/"Plutôt ensoleillé"/g;s/"Partly Sunny"/"Partiellement ensoleillé"/g;s/"Freezing Rain"/"Pluie verglaçante"/g;s/"Rain"/"Pluie"/g;s/"Sleet"/"Neige fondue"/g;s/"Snow"/"Neige"/g;s/"Sunny"/"Ensoleillé"/g;s/"Thunderstorm*"/"Orage"/g;s/"Overscat"/"Couvert"/g;s/"Scattered Clouds"/"Nuages épars"/g;s/"NW"/"NO"/g;s/"WNW"/"ONO"/g;s/"SW"/"SO"/g;s/"WSW"/"OSO"/g;s/"NNW"/"NNO"/g' > $HOME/test/Simple_Forecast
sed -i 's/^[ \t]*"//g' $HOME/test/Simple_Forecast
sed -i '/hourly_forecast\|simpleforecast\|forecastday\|{"date"\|period\|icon_url\|^[ \t]*},$\|^[ \t]*}$\|^[ \t]*,$\|^[ \t]*\]$/d' $HOME/test/Simple_Forecast
sed -i -e 's/":"/\n/g' -e 's/":/\n/g' -e 's/",$//g' -e 's/,$//g' -e 's/"$//g' $HOME/test//Simple_Forecast
sed -i '/^[ \t]*{/d' $HOME/test/Simple_Forecast
sed -i -e 's/^[ \t]*"//g' -e 's/^[ \t]*//g' $HOME/test/Simple_Forecast
for (( i=2; i<=146; i+=16 ))
    do
        cp $HOME/test/Forecast_Images/$(wun_icon_to_png day $(sed -n ${i}p $HOME/test/Forecast)).png $HOME/test/d$(( 1+(i-2)/16 )).png
        j=$(( i+8 ))
        cp $HOME/test/Forecast_Images/$(wun_icon_to_png night $(sed -n ${j}p $HOME/test/Forecast)).png $HOME/test//n$(( 1+(i-2)/16 )).png
    done
    
    sed -n '/"hourly_forecast": \[/,/"moon_phase": {/p' $HOME/test/raw_data > $HOME/test/Hourly
sed -i -e 's/^[ \t]*"//g' -e 's/^[ \t]*//g' $HOME/test/Hourly
sed -i '/hourly_forecast\|FCTTIME\|^{$\|^},$\|^}$\|^,$\|^]$\|moon_phase/d' $HOME/test/Hourly
sed -i -e 's/": /\n/g' -e 's/","/\n/g' -e 's/", "/\n/g' $HOME/test/Hourly
sed -i -e 's/^""//g' -e 's/^"//g' -e 's/^{"//g' -e 's/"},$//g' -e 's/",$//g' $HOME/test/Hourly 
sed -i -e 's/^},//g' -e 's/"}$//g' -e 's/^,//g' $HOME/test/Hourly
sed -i -e 's/^icon_url.*\/c\/k\///g' -e '/gif/s/_.*$//g' $HOME/test/Hourly
sed -i -e '/min_unpadded\|UTCDATE/,+1d' $HOME/test/Hourly
for (( i=64; i<=4212; i+=117 ))
    do
		j=$(( i+1 ))
		day_or_night=$(sed -n ${j}p $HOME/test/Hourly)
		if [[ $day_or_night == nt ]]; then
			cp $HOME/test/Forecast_Images/$(wun_icon_to_png night $(sed -n ${i}p $HOME/test/Hourly)).png $HOME/test/h$(( 1+(i-64)/117 )).png
		else 
			cp $HOME/test/Forecast_Images/$(wun_icon_to_png day $(sed -n ${i}p $HOME/test/Hourly)).png $HOME/test/h$(( 1+(i-64)/117 )).png
		fi
    done
    

The conky :

conky.config = {
background = false,
use_xft = true,
font = 'DejaVuSansMono:size=8',
update_interval = 1800.0,
total_run_times = 0,
own_window = true,
own_window_type = 'dock',
own_window_transparent = true,
own_window_argb_visual = true,
own_window_hints = 'undecorated,skip_taskbar,skip_pager,below',
double_buffer = true,
draw_shades = false,
draw_outline = false,
draw_borders = false,
draw_graph_borders = true,
stippled_borders = 8,
border_inner_margin = 4,
alignment = 'top_left',
minimum_width = 350,
minimum_height = 400,
gap_x = 130,
gap_y = 85,
no_buffers = false,
uppercase = false,
cpu_avg_samples = 2,
net_avg_samples = 2,
override_utf8_locale = true,
use_spacer = right,
text_buffer_size = 6144,
imlib_cache_size = 8192, 

default_outline_color = '000000',
color1 = 'F5B800',
color2 = '00f5ff',
}

conky.text = [[
${exec bash $HOME/test/3b}\
${alignc}${font DejaVuSansMono:bold:size=10}${color2}Actuel
${image ~/test/Now.png -p -25,15 -s 125x75}
${voffset -15}${font}${goto 70}Temp : ${color1}${exec sed -n '67p' $HOME/test/Conditions}°       ${color2}Pression  : ${color1}${exec sed -n '85p' $HOME/test/Conditions} hPa
${goto 70}${color2}Vent : ${color1}${exec sed -n '81p' $HOME/test/Conditions} km/h${color2}  Direction : ${color1}${exec sed -n '73p' $HOME/test/Conditions}
${color2}${alignc}${exec sed -n '63p' $HOME/test/Conditions}

${color2}${alignc}SOLEIL
${goto 70}Lever : ${color1}${execi 600  sed -n '16p' $HOME/test/Moon_Sun}:${execi 600  sed -n '18p' $HOME/test/Moon_Sun} \
       ${color2}Coucher : ${color1}${execi 600  sed -n '21p' $HOME/test/Moon_Sun}:${execi 600  sed -n '23p' $HOME/test/Moon_Sun}

${alignc}${font DejaVuSansMono:bold:size=10}${color2}Prévisions${font}
${color2}${goto 30}${membar 0,110} Aujourd'hui ${membar 0,85}
${image ~/test/d1.png -p 15,135 -s 53x32}
${voffset -15}${font}${goto 70}Temp mini : ${color1}${exec sed -n '44p' $HOME/test/Simple_Forecast}°       ${color2}Temp maxi : ${color1}${exec sed -n '39p' $HOME/test/Simple_Forecast}°
${color2}${alignc}${exec sed -n '46p' $HOME/test/Simple_Forecast}

${color2}${goto 30}${membar 0,120} ${execi 3600 date --date="1 day" | awk '{print $1""$3}' | tr '[a-z]' '[A-Z]'} ${color2}${membar 0,110}
${image ~/test/d2.png -p 15,185 -s 53x32}
${voffset -15}${font}${goto 70}Temp mini : ${color1}${exec sed -n '150p' $HOME/test/Simple_Forecast}°      ${color2}Temp maxi : ${color1}${exec sed -n '145p' $HOME/test/Simple_Forecast}°
${color2}${alignc}${exec sed -n '152p' $HOME/test/Simple_Forecast}

${color2}${goto 30}${membar 0,120} ${execi 3600 date --date="2 day" | awk '{print $1""$3}' | tr '[a-z]' '[A-Z]'} ${color2}${membar 0,110}
${image ~/test/d3.png -p 15,235 -s 53x32}
${voffset -15}${font}${goto 70}Temp mini : ${color1}${exec sed -n '256p' $HOME/test/Simple_Forecast}°       ${color2}Temp maxi : ${color1}${exec sed -n '251p' $HOME/test/Simple_Forecast}°
${color2}${alignc}${exec sed -n '258p' $HOME/test/Simple_Forecast}

${color2}${goto 30}${membar 0,120} ${execi 3600 date --date="3 day" | awk '{print $1""$3}' | tr '[a-z]' '[A-Z]'} ${color2}${membar 0,110}
${image ~/test/d4.png -p 15,285 -s 53x32}
${voffset -15}${font}${goto 70}Temp mini : ${color1}${exec sed -n '362p' $HOME/test/Simple_Forecast}°       ${color2}Temp maxi : ${color1}${exec sed -n '357p' $HOME/test/Simple_Forecast}°
${color2}${alignc}${exec sed -n '364p' $HOME/test/Simple_Forecast}

${color2}${goto 30}${membar 0,120} ${execi 3600 date --date="4 day" | awk '{print $1""$3}' | tr '[a-z]' '[A-Z]'} ${color2}${membar 0,110}
${image ~/test/d5.png -p 15,335 -s 53x32}
${voffset -15}${font}${goto 70}Temp mini : ${color1}${exec sed -n '468p' $HOME/test/Simple_Forecast}°       ${color2}Temp maxi : ${color1}${exec sed -n '463p' $HOME/test/Simple_Forecast}°
${color2}${alignc}${exec sed -n '470p' $HOME/test/Simple_Forecast}

${color2}${goto 30}${membar 0,120} ${execi 3600 date --date="5 day" | awk '{print $1""$3}' | tr '[a-z]' '[A-Z]'} ${color2}${membar 0,110}
${image ~/test/d6.png -p 15,385 -s 53x32}
${voffset -15}${font}${goto 70}Temp mini : ${color1}${exec sed -n '574p' $HOME/test/Simple_Forecast}°       ${color2}Temp maxi : ${color1}${exec sed -n '569p' $HOME/test/Simple_Forecast}°
${color2}${alignc}${exec sed -n '576p' $HOME/test/Simple_Forecast}

${color2}${goto 30}${membar 0,120} ${execi 3600 date --date="6 day" | awk '{print $1""$3}' | tr '[a-z]' '[A-Z]'} ${color2}${membar 0,110}
${image ~/test/d7.png -p 15,435 -s 53x32}
${voffset -15}${font}${goto 70}Temp mini : ${color1}${exec sed -n '680p' $HOME/test/Simple_Forecast}°       ${color2}Temp maxi : ${color1}${exec sed -n '675p' $HOME/test/Simple_Forecast}°
${color2}${alignc}${exec sed -n '682p' $HOME/test/Simple_Forecast}

${color2}${goto 30}${membar 0,120} ${execi 3600 date --date="7 day" | awk '{print $1""$3}' | tr '[a-z]' '[A-Z]'} ${color2}${membar 0,110}
${image ~/test/d8.png -p 15,485 -s 53x32}
${voffset -15}${font}${goto 70}Temp mini : ${color1}${exec sed -n '786p' $HOME/test/Simple_Forecast}°       ${color2}Temp maxi : ${color1}${exec sed -n '781p' $HOME/test/Simple_Forecast}°
${color2}${alignc}${exec sed -n '788p' $HOME/test/Simple_Forecast}


]]

And the result :
Ea1X.jpg

Offline

#1457 2017-01-14 19:35:10

Sector11
Tpyo Knig
From: 77345 ¡#
Registered: 2015-08-20
Posts: 5,260

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

Very Nice!


BunsenLabs Forum Rules ---== I'm a Conky 1.9'er ==---
System:    Host: s12 Kernel: 3.16.0-4-amd64 x86_64 (64 bit gcc: 4.8.4)
Desktop: Openbox 3.5.2 dm: (startx) Distro: Debian GNU/Linux 8

Offline

#1458 2017-01-14 20:25:51

TeoBigusGeekus
BL DieHard
From: /Greece/Kastoria
Registered: 2015-10-04
Posts: 819

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

Bon!


Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!

Offline

#1459 2017-01-15 14:09:28

chepioq
Member
Registered: 2015-11-29
Posts: 63

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

my last conky-meteo (with 2b_Wunderground_API and script 3b (post #1457 ))
02LD.jpg

The conky :

conky.config = {
background = false,
use_xft = true,
font = 'DejaVuSansMono:size=8',
update_interval = 1800.0,
total_run_times = 0,
own_window = true,
own_window_type = 'dock',
own_window_transparent = true,
own_window_argb_visual = true,
own_window_hints = 'undecorated,skip_taskbar,skip_pager,below',
double_buffer = true,
draw_shades = false,
draw_outline = false,
draw_borders = false,
draw_graph_borders = true,
stippled_borders = 8,
border_inner_margin = 4,
alignment = 'top_left',
minimum_width = 240,
minimum_height = 400,
gap_x = 130,
gap_y = 85,
no_buffers = false,
uppercase = false,
cpu_avg_samples = 2,
net_avg_samples = 2,
override_utf8_locale = true,
use_spacer = right,
text_buffer_size = 6144,
imlib_cache_size = 8192, 

default_outline_color = '000000',
color1 = 'F5B800',
color2 = '00f5ff',
}

conky.text = [[${exec bash $HOME/test/3b}\${font DejaVuSansMono:bold:size=10}${color2}${goto 145}Actuel


${font}${color2}${goto 40}${voffset 10}Temp ${color1}${exec sed -n '67p' $HOME/test/Conditions}°${color2}${goto 210} Pression ${color1}${exec sed -n '85p' $HOME/test/Conditions} hPa
${image ~/test/Now.png -p 55,0 -s 210x126}
${color2}${goto 40}${voffset 15}Vent ${color1}${exec sed -n '81p' $HOME/test/Conditions} km/h ${color2}${goto 210} Direction ${color1}${exec sed -n '73p' $HOME/test/Conditions}

${color2}${goto 150}SOLEIL
${goto 60}Lever : ${color1}${execi 600  sed -n '16p' $HOME/test/Moon_Sun}:${execi 600  sed -n '18p' $HOME/test/Moon_Sun} \
       ${color2}Coucher : ${color1}${execi 600  sed -n '21p' $HOME/test/Moon_Sun}:${execi 600  sed -n '23p' $HOME/test/Moon_Sun}

${goto 130}${font DejaVuSansMono:bold:size=10}${color2}Prévisions${font}
${color2}${goto 30}${membar 0,95} Aujourd'hui ${membar 0,100}
${image ~/test/d1.png -p 15,190 -s 53x32}
${voffset -15}${font}${goto 70}Temp mini : ${color1}${exec sed -n '44p' $HOME/test/Simple_Forecast}°       ${color2}Temp maxi : ${color1}${exec sed -n '39p' $HOME/test/Simple_Forecast}°
${color2}${alignc}${exec sed -n '46p' $HOME/test/Simple_Forecast}

${color2}${goto 30}${membar 0,105} ${execi 3600 date --date="1 day" | awk '{print $1""$3}' | tr '[a-z]' '[A-Z]'} ${color2}${membar 0,125}
${image ~/test/d2.png -p 15,240 -s 53x32}
${voffset -15}${font}${goto 70}Temp mini : ${color1}${exec sed -n '150p' $HOME/test/Simple_Forecast}°       ${color2}Temp maxi : ${color1}${exec sed -n '145p' $HOME/test/Simple_Forecast}°
${color2}${alignc}${exec sed -n '152p' $HOME/test/Simple_Forecast}

${color2}${goto 30}${membar 0,105} ${execi 3600 date --date="2 day" | awk '{print $1""$3}' | tr '[a-z]' '[A-Z]'} ${color2}${membar 0,125}
${image ~/test/d3.png -p 15,290 -s 53x32}
${voffset -15}${font}${goto 70}Temp mini : ${color1}${exec sed -n '256p' $HOME/test/Simple_Forecast}°       ${color2}Temp maxi : ${color1}${exec sed -n '251p' $HOME/test/Simple_Forecast}°
${color2}${alignc}${exec sed -n '258p' $HOME/test/Simple_Forecast}

${color2}${goto 30}${membar 0,105} ${execi 3600 date --date="3 day" | awk '{print $1""$3}' | tr '[a-z]' '[A-Z]'} ${color2}${membar 0,125}
${image ~/test/d4.png -p 15,340 -s 53x32}
${voffset -15}${font}${goto 70}Temp mini : ${color1}${exec sed -n '362p' $HOME/test/Simple_Forecast}°       ${color2}Temp maxi : ${color1}${exec sed -n '357p' $HOME/test/Simple_Forecast}°
${color2}${alignc}${exec sed -n '364p' $HOME/test/Simple_Forecast}

${color2}${goto 30}${membar 0,105} ${execi 3600 date --date="4 day" | awk '{print $1""$3}' | tr '[a-z]' '[A-Z]'} ${color2}${membar 0,125}
${image ~/test/d5.png -p 15,390 -s 53x32}
${voffset -15}${font}${goto 70}Temp mini : ${color1}${exec sed -n '468p' $HOME/test/Simple_Forecast}°       ${color2}Temp maxi : ${color1}${exec sed -n '463p' $HOME/test/Simple_Forecast}°
${color2}${alignc}${exec sed -n '470p' $HOME/test/Simple_Forecast}

${color2}${goto 30}${membar 0,105} ${execi 3600 date --date="5 day" | awk '{print $1""$3}' | tr '[a-z]' '[A-Z]'} ${color2}${membar 0,125}
${image ~/test/d6.png -p 15,440 -s 53x32}
${voffset -15}${font}${goto 70}Temp mini : ${color1}${exec sed -n '574p' $HOME/test/Simple_Forecast}°       ${color2}Temp maxi : ${color1}${exec sed -n '569p' $HOME/test/Simple_Forecast}°
${color2}${alignc}${exec sed -n '576p' $HOME/test/Simple_Forecast}

${color2}${goto 30}${membar 0,105} ${execi 3600 date --date="6 day" | awk '{print $1""$3}' | tr '[a-z]' '[A-Z]'} ${color2}${membar 0,125}
${image ~/test/d7.png -p 15,490 -s 53x32}
${voffset -15}${font}${goto 70}Temp mini : ${color1}${exec sed -n '680p' $HOME/test/Simple_Forecast}°       ${color2}Temp maxi : ${color1}${exec sed -n '675p' $HOME/test/Simple_Forecast}°
${color2}${alignc}${exec sed -n '682p' $HOME/test/Simple_Forecast}

${color2}${goto 30}${membar 0,105} ${execi 3600 date --date="7 day" | awk '{print $1""$3}' | tr '[a-z]' '[A-Z]'} ${color2}${membar 0,125}
${image ~/test/d8.png -p 15,540 -s 53x32}
${voffset -15}${font}${goto 70}Temp mini : ${color1}${exec sed -n '786p' $HOME/test/Simple_Forecast}°       ${color2}Temp maxi : ${color1}${exec sed -n '781p' $HOME/test/Simple_Forecast}°
${color2}${alignc}${exec sed -n '788p' $HOME/test/Simple_Forecast}


]]

I have a question:
when I go to wundergroud-weather site ( https://www.wunderground.com/q/zmw:0000 … IAUBAGNE45 ) I can see all strings for forecast are in french.

But with the API they are in English.
Can I have the API in french ?
Or it is not possible ?

Offline

#1460 2017-01-15 14:35:09

chepioq
Member
Registered: 2015-11-29
Posts: 63

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

Forget my question, I found the answer.
To have the API in French, you must just add lang:FR in the address in the script 3b (or 2b), like this :

#put your Weather Underground address API here
address="http://api.wunderground.com/api/you_api_key_here/conditions/forecast10day/astronomy/hourly/satellite/lang:FR/q/aubagne.json"

I test and that work !!!  big_smile

Now you can remove the translation in the script :

#!/bin/bash

#put your hemisphere here: n for north, s for south
hemisphere=n

#put your Weather Underground address API here
address="http://api.wunderground.com/api/your_api_key_here/conditions/forecast10day/astronomy/hourly/satellite/lang:FR/q/aubagne.json"

wun_icon_to_png () {
    if [[ $1 == day ]]; then
        case $2 in
            chanceflurries)
                echo 21
            ;;
            chancerain)
                echo 14
            ;;
            chancesleet)
                echo 26
            ;;
            chancesnow)
                echo 20
            ;;
            chancetstorms)
                echo 17
            ;;
            clear)
                echo 1
            ;;
            cloudy)
                echo 7
            ;;
            flurries)
                echo 21
            ;;
            fog)
                echo 11
            ;;
            hazy)
                echo 5
            ;;
            mostlycloudy)
                echo 6
            ;;
            mostlysunny)
                echo 4
            ;;
            partlycloudy)
                echo 4
            ;;
            partlysunny)
                echo 6
            ;;
            sleet)
                echo 26
            ;;
            rain)
                echo 18
            ;;
            snow)
                echo 22
            ;;
            sunny)
                echo 1
            ;;
            tstorms)
                echo 15
            ;;
            unknown)
                echo 0
            ;;
        esac
    elif [[ $1 == night ]]; then
        case $2 in
            chanceflurries)
                echo 43
            ;;
            chancerain)
                echo 39
            ;;
            chancesleet)
                echo 40
            ;;
            chancesnow)
                echo 43
            ;;
            chancetstorms)
                echo 41
            ;;
            clear)
                echo 33
            ;;
            cloudy)
                echo 38
            ;;
            flurries)
                echo 43
            ;;
            fog)
                echo 11
            ;;
            hazy)
                echo 37
            ;;
            mostlycloudy)
                echo 36
            ;;
            mostlysunny)
                echo 35
            ;;
            partlycloudy)
                echo 35
            ;;
            partlysunny)
                echo 36
            ;;
            sleet)
                echo 40
            ;;
            rain)
                echo 40
            ;;
            snow)
                echo 44
            ;;
            sunny)
                echo 33
            ;;
            tstorms)
                echo 41
            ;;
            unknown)
                echo 0
            ;;
        esac
    fi
    }
    
#rm $HOME/test/*.png

curl $address -o $HOME/test/raw_data
    
sed -n '/,	"current_observation": {/,/,	"satellite": {/p' $HOME/test/raw_data > $HOME/test/Conditions
sed -i 's/^[ \t]*"//g' $HOME/test/Conditions
sed -i '/current_observation\|image":\|logo_\|title":\|link":\|^[ \t]*},$\|^[ \t]*}$\|temperature_string\|forecast_url\|history_url\|ob_url\|satellite":/d' $HOME/test/Conditions
sed -i -e 's/":"/\n/g' -e 's/",\|": {$//g' -e 's/"precip_1hr_string/\nprecip_1hr_string/g' -e 's/":/\n/g' -e 's/,$//g' $HOME/test/Conditions
sed -i -e 's/^http.*\/c\/k\///g' -e '/gif/s/_.*$//g' $HOME/test/Conditions
day_or_night=$(sed -n 137p $HOME/test/Conditions)
if [[ $day_or_night == nt ]]; then
	cp $HOME/test/Forecast_Images/$(wun_icon_to_png night $(sed -n 135p $HOME/test/Conditions)).png $HOME/test/Now.png
else 
	cp $HOME/test/Forecast_Images/$(wun_icon_to_png day $(sed -n 135p $HOME/test/Conditions)).png $HOME/test/Now.png
fi
#Forecast feature: Forecast
sed -n '/"forecast":{/,/"simpleforecast": {/p' $HOME/test/raw_data > $HOME/test/Forecast
sed -i -e '/"period":\|icon_url/d' $HOME/test/Forecast
sed -i 's/^[ \t]*"//g' $HOME/test/Forecast
sed -i -e '/period\|icon\|title\|fcttext/!d' -e 's/":"/\n/g' -e 's/":/\n/g' -e 's/",//g' -e 's/,$//g' -e 's/nt_//g' $HOME/test/Forecast

#Forecast feature: Moon_Sun
sed -n '/"moon_phase": {/,/"sun_phase": {/p' $HOME/test/raw_data > $HOME/test/Moon_Sun
sed -i 's/^[ \t]*"//g' $HOME/test/Moon_Sun
sed -i '/moon_phase\|^[ \t]*},$\|sun_phase\|^[ \t]*}$/d' $HOME/test/Moon_Sun
sed -i -e 's/":"/\n/g' -e 's/".*$//g' $HOME/test/Moon_Sun

#Forecast feature: Simple Forecast
sed -n '/"simpleforecast": {/,/"hourly_forecast": \[/p' $HOME/test/raw_data > $HOME/test/Simple_Forecast
sed -i 's/^[ \t]*"//g' $HOME/test/Simple_Forecast
sed -i '/hourly_forecast\|simpleforecast\|forecastday\|{"date"\|period\|icon_url\|^[ \t]*},$\|^[ \t]*}$\|^[ \t]*,$\|^[ \t]*\]$/d' $HOME/test/Simple_Forecast
sed -i -e 's/":"/\n/g' -e 's/":/\n/g' -e 's/",$//g' -e 's/,$//g' -e 's/"$//g' $HOME/test//Simple_Forecast
sed -i '/^[ \t]*{/d' $HOME/test/Simple_Forecast
sed -i -e 's/^[ \t]*"//g' -e 's/^[ \t]*//g' $HOME/test/Simple_Forecast
for (( i=2; i<=146; i+=16 ))
    do
        cp $HOME/test/Forecast_Images/$(wun_icon_to_png day $(sed -n ${i}p $HOME/test/Forecast)).png $HOME/test/d$(( 1+(i-2)/16 )).png
        j=$(( i+8 ))
        cp $HOME/test/Forecast_Images/$(wun_icon_to_png night $(sed -n ${j}p $HOME/test/Forecast)).png $HOME/test//n$(( 1+(i-2)/16 )).png
    done
    
    sed -n '/"hourly_forecast": \[/,/"moon_phase": {/p' $HOME/test/raw_data > $HOME/test/Hourly
sed -i -e 's/^[ \t]*"//g' -e 's/^[ \t]*//g' $HOME/test/Hourly
sed -i '/hourly_forecast\|FCTTIME\|^{$\|^},$\|^}$\|^,$\|^]$\|moon_phase/d' $HOME/test/Hourly
sed -i -e 's/": /\n/g' -e 's/","/\n/g' -e 's/", "/\n/g' $HOME/test/Hourly
sed -i -e 's/^""//g' -e 's/^"//g' -e 's/^{"//g' -e 's/"},$//g' -e 's/",$//g' $HOME/test/Hourly 
sed -i -e 's/^},//g' -e 's/"}$//g' -e 's/^,//g' $HOME/test/Hourly
sed -i -e 's/^icon_url.*\/c\/k\///g' -e '/gif/s/_.*$//g' $HOME/test/Hourly
sed -i -e '/min_unpadded\|UTCDATE/,+1d' $HOME/test/Hourly
for (( i=64; i<=4212; i+=117 ))
    do
		j=$(( i+1 ))
		day_or_night=$(sed -n ${j}p $HOME/test/Hourly)
		if [[ $day_or_night == nt ]]; then
			cp $HOME/test/Forecast_Images/$(wun_icon_to_png night $(sed -n ${i}p $HOME/test/Hourly)).png $HOME/test/h$(( 1+(i-64)/117 )).png
		else 
			cp $HOME/test/Forecast_Images/$(wun_icon_to_png day $(sed -n ${i}p $HOME/test/Hourly)).png $HOME/test/h$(( 1+(i-64)/117 )).png
		fi
    done
    

Last edited by chepioq (2017-01-15 14:39:48)

Offline

#1461 2017-01-15 14:41:06

Sector11
Tpyo Knig
From: 77345 ¡#
Registered: 2015-08-20
Posts: 5,260

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

chepioq wrote:

I have a question:
when I go to wundergroud-weather site ( https://www.wunderground.com/q/zmw:0000 … IAUBAGNE45 ) I can see all strings for forecast are in french.

But with the API they are in English.
Can I have the API in french ?
Or it is not possible ?

I can't answer your questions - that's beyond me.  But I do have a comment.
When I click on the link you posted, I see everything in English.

A quick search, maybe here Switch Language.

oh oh ... here: How to Tap The Weather Underground’s Plethora of Data Via API I see - and they used French as an example too:

In your URL you also can include an optional setting. There are a few, but one important one is language. The default is English; if you want to use, for example, French, you input lang:FR.

So far, our URL looks like this:

http://api.wunderground.com/api/SECURITYKEY/feature/

Or, with a language:

http://api.wunderground.com/api/SECURIT … re/lang:FR

I hope that helps you.
Have a GREAT day!


BunsenLabs Forum Rules ---== I'm a Conky 1.9'er ==---
System:    Host: s12 Kernel: 3.16.0-4-amd64 x86_64 (64 bit gcc: 4.8.4)
Desktop: Openbox 3.5.2 dm: (startx) Distro: Debian GNU/Linux 8

Offline

#1462 2017-01-15 14:46:56

chepioq
Member
Registered: 2015-11-29
Posts: 63

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

thank sector, our post crossed, I have the solution in my last post ( #1461 )

Offline

#1463 2017-01-15 15:09:27

Sector11
Tpyo Knig
From: 77345 ¡#
Registered: 2015-08-20
Posts: 5,260

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

Well, I tried ...  main point:  You got it!  wink


BunsenLabs Forum Rules ---== I'm a Conky 1.9'er ==---
System:    Host: s12 Kernel: 3.16.0-4-amd64 x86_64 (64 bit gcc: 4.8.4)
Desktop: Openbox 3.5.2 dm: (startx) Distro: Debian GNU/Linux 8

Offline

#1464 2017-01-15 15:48:44

chepioq
Member
Registered: 2015-11-29
Posts: 63

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

And here the list of available language : https://www.wunderground.com/weather/ap … ge-support

Offline

#1465 2017-01-15 16:19:32

Sector11
Tpyo Knig
From: 77345 ¡#
Registered: 2015-08-20
Posts: 5,260

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

SUPERB!  That link should be in the OP!   Just an opinion!


BunsenLabs Forum Rules ---== I'm a Conky 1.9'er ==---
System:    Host: s12 Kernel: 3.16.0-4-amd64 x86_64 (64 bit gcc: 4.8.4)
Desktop: Openbox 3.5.2 dm: (startx) Distro: Debian GNU/Linux 8

Offline

#1466 2017-01-15 16:23:33

TeoBigusGeekus
BL DieHard
From: /Greece/Kastoria
Registered: 2015-10-04
Posts: 819

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

I don't have time to test the script, but does it work in French without changing the original one?


Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!

Offline

#1467 2017-01-15 16:55:49

chepioq
Member
Registered: 2015-11-29
Posts: 63

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

I test the two scripts, the original 2b and mine, 3b, and that work.

Offline

#1468 2017-01-15 17:18:40

Sector11
Tpyo Knig
From: 77345 ¡#
Registered: 2015-08-20
Posts: 5,260

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

TeoBigusGeekus wrote:

I don't have time to test the script, but does it work in French without changing the original one?

OH YEA!  HUSTON WE HAVE A WINNER
6-langs.th.png
The ONLY change: /lang=XX/ nothing else.

Left to right:

English
address="http://api.wunderground.com/api/################/conditions/forecast10day/astronomy/hourly/satellite/q/Argentina/Jorge_Newbery_Aeroparque.json"

Spanish
address="http://api.wunderground.com/api/################/conditions/forecast10day/astronomy/hourly/satellite/lang:SP/q/Argentina/Jorge_Newbery_Aeroparque.json"

French
address="http://api.wunderground.com/api/################/conditions/forecast10day/astronomy/hourly/satellite/lang:FR/q/Argentina/Jorge_Newbery_Aeroparque.json"

Greek
address="http://api.wunderground.com/api/################/conditions/forecast10day/astronomy/hourly/satellite/lang:GR/q/Argentina/Jorge_Newbery_Aeroparque.json"

German
address="http://api.wunderground.com/api/################/conditions/forecast10day/astronomy/hourly/satellite/lang:DL/q/Argentina/Jorge_Newbery_Aeroparque.json"

Italian
address="http://api.wunderground.com/api/################/conditions/forecast10day/astronomy/hourly/satellite/lang:IT/q/Argentina/Jorge_Newbery_Aeroparque.json"

EDIT:  Ninja'd by chepioq  I take too long!

@chepioq
If I may be so bold: Merci beaucoup from Teo, myself and all who use this script! KUDOS!

=====
What's in English is either hard coded or comes from the "date" command that should work properly on any system installed in another language.

Last edited by Sector11 (2017-01-15 17:26:11)


BunsenLabs Forum Rules ---== I'm a Conky 1.9'er ==---
System:    Host: s12 Kernel: 3.16.0-4-amd64 x86_64 (64 bit gcc: 4.8.4)
Desktop: Openbox 3.5.2 dm: (startx) Distro: Debian GNU/Linux 8

Offline

#1469 2017-01-15 19:19:18

chepioq
Member
Registered: 2015-11-29
Posts: 63

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

Now I can get the full forecast in french.
Just a little screen-shot, It just for test, I do another conky-weather...
9aKR.jpg

Offline

#1470 2017-01-15 19:54:22

Sector11
Tpyo Knig
From: 77345 ¡#
Registered: 2015-08-20
Posts: 5,260

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

^ Getting better all the time.

The 4 conky companions I have for wunderground are working quite well in Spanish.  You should have no problem in French  smile

2017-01-15_164755_Scrot11.th.png 2017-01-15_164818_Scrot11.th.png
2017-01-15_164836_Scrot11.th.png 2017-01-15_164851_Scrot11.th.png

Teo's scripts got handed an Easter Egg and it too chepioq to find it  big_smile


BunsenLabs Forum Rules ---== I'm a Conky 1.9'er ==---
System:    Host: s12 Kernel: 3.16.0-4-amd64 x86_64 (64 bit gcc: 4.8.4)
Desktop: Openbox 3.5.2 dm: (startx) Distro: Debian GNU/Linux 8

Offline

#1471 2017-01-16 12:38:11

TeoBigusGeekus
BL DieHard
From: /Greece/Kastoria
Registered: 2015-10-04
Posts: 819

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

Something's not right.
I get this when I run conkyrc1:
2thHtUyt.jpg

Also, on an unrelated note, conkyrc4 doesn't seem to work. Hmmm.....


Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!

Offline

#1472 2017-01-16 12:59:41

Sector11
Tpyo Knig
From: 77345 ¡#
Registered: 2015-08-20
Posts: 5,260

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

YUP, I noticed the same thing late last night.  Changing the language means that the script "output" is reporting the moon phases in the language chosen.  The script itself has hard coded English moon phase  terms to search for:

The last section, so not as universal as we thought - SOME TWEAKING REQUIRED BY THE USERS:

#Forecast feature: Moon_Sun
sed -n '/"moon_phase": {/,/"sun_phase": {/p' /media/5/Conky/2b_Wunderground_API/raw_data > /media/5/Conky/2b_Wunderground_API/Moon_Sun
sed -i 's/^[ \t]*"//g' /media/5/Conky/2b_Wunderground_API/Moon_Sun
sed -i '/moon_phase\|^[ \t]*},$\|sun_phase\|^[ \t]*}$/d' /media/5/Conky/2b_Wunderground_API/Moon_Sun
sed -i -e 's/":"/\n/g' -e 's/".*$//g' /media/5/Conky/2b_Wunderground_API/Moon_Sun
moon_phase=$(sed -n 6p /media/5/Conky/2b_Wunderground_API/Moon_Sun)
if [[ $moon_phase == "Waning Crescent" ]]; then
	cp /media/5/Conky/2b_Wunderground_API/moonicons/$hemisphere"21.png" /media/5/Conky/2b_Wunderground_API/Moon_phase.png
elif [[ $moon_phase == "Waxing Crescent" ]]; then
	cp /media/5/Conky/2b_Wunderground_API/moonicons/$hemisphere"04.png" /media/5/Conky/2b_Wunderground_API/Moon_phase.png
elif [[ $moon_phase == "Waning Gibbous" ]]; then
	cp /media/5/Conky/2b_Wunderground_API/moonicons/$hemisphere"17.png" /media/5/Conky/2b_Wunderground_API/Moon_phase.png
elif [[ $moon_phase == "Waxing Gibbous" ]]; then
	cp /media/5/Conky/2b_Wunderground_API/moonicons/$hemisphere"09.png" /media/5/Conky/2b_Wunderground_API/Moon_phase.png
elif [[ $moon_phase == "First Quarter" ]]; then
	cp /media/5/Conky/2b_Wunderground_API/moonicons/$hemisphere"07.png" /media/5/Conky/2b_Wunderground_API/Moon_phase.png
elif [[ $moon_phase == "Last Quarter" ]]; then
	cp /media/5/Conky/2b_Wunderground_API/moonicons/$hemisphere"19.png" /media/5/Conky/2b_Wunderground_API/Moon_phase.png
elif [[ $moon_phase =~ New.* ]]; then
	cp /media/5/Conky/2b_Wunderground_API/moonicons/$hemisphere"24.png" /media/5/Conky/2b_Wunderground_API/Moon_phase.png
elif [[ $moon_phase =~ Full.* ]]; then
	cp /media/5/Conky/2b_Wunderground_API/moonicons/$hemisphere"13.png" /media/5/Conky/2b_Wunderground_API/Moon_phase.png
fi

There is a "sun phase"  ??


BunsenLabs Forum Rules ---== I'm a Conky 1.9'er ==---
System:    Host: s12 Kernel: 3.16.0-4-amd64 x86_64 (64 bit gcc: 4.8.4)
Desktop: Openbox 3.5.2 dm: (startx) Distro: Debian GNU/Linux 8

Offline

#1473 2017-01-16 17:18:21

Sector11
Tpyo Knig
From: 77345 ¡#
Registered: 2015-08-20
Posts: 5,260

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

Last week I went out walking 4 blocks to a "supermarcado" (grocery store) and 4 blocks home, I was wearing a 'modified' T-Shirt - no neck, no sleeves - to combat the heat.
That night my wife said "OMG, What did you do?"  The back of my neck and shoulders were a deep red!  UVI was a Very High 9 out of 11.

She applied a thick layer of cream.  GD UVI so I made a very simple conky that I cannot help but see:
2017-01-16_135948_Scrot11.th.png
It changes colours according to the chart linked above.
2017-01-16_124545_Scrot11.png 2017-01-16_120557_Scrot11.png 2017-01-16_083128_Scrot11.png 2017-01-15_193039_Scrot11.png 2017-01-15_170001_Scrot11.png
0, 1 & 2 = Green
3, 4 & 5 = Yellow
6 & 7 = Orange
8, 9 & 10 = Red
11+ = Violet <<--- yup seen that a few times here.  Normal summer days are 9 or 10 though.

Not something most northern hemisphere people are concerned with but here in the south!

Any Australians or New Zealanders here?
BTW:  The bash script getting the data is in another conky, this just uses the existing data!

# pkill -xf "conky -c ~/1_accuweather/S11_accu_UVI.conky" &
# Created - Sat 14 Jan 2017
###  Begin Window Settings  ########################################
own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,below,skip_taskbar,skip_pager
own_window_colour 000000
own_window_class Conky
own_window_title Accuweather UVI

minimum_size 64 64
maximum_width 64

## Because I always forget which is which :D
## l|r
gap_x 115
## u|d
gap_y 0

alignment tl
##########################################  End Window Settings  ###
###  Font Settings  ################################################
use_xft yes
xftfont Fira Mono:size=13
xftalpha 1.0
override_utf8_locale yes
############################################  End Font Settings  ###
###  Color Settings  ###############################################
draw_shades yes
default_shade_color ffffff

default_color 000000 #Black
###########################################  End Color Settings  ###
###  Borders Section  ##############################################
draw_borders no    ##<<<<<<<<<< ------------------------------------
stippled_borders 5
border_inner_margin 0
border_outer_margin 0
###########################################  End Borders Secton  ###
###  Miscellaneous Section  ########################################
background yes
use_spacer none
no_buffers yes
double_buffer yes


update_interval 1
TEXT
${if_match ${execi 300 sed -n '9p' ~/1_accuweather/curr_cond}==0}${image ~/1_accuweather/UVI/Green_D_128.png -s 64x64}
${goto 23}0${execi 300 sed -n '9p' ~/1_accuweather/curr_cond}${endif}\
${if_match ${execi 300 sed -n '9p' ~/1_accuweather/curr_cond}==1}${image ~/1_accuweather/UVI/Green_D_128.png -s 64x64}
${goto 23}0${execi 300 sed -n '9p' ~/1_accuweather/curr_cond}${endif}\
${if_match ${execi 300 sed -n '9p' ~/1_accuweather/curr_cond}==2}${image ~/1_accuweather/UVI/Green_D_128.png -s 64x64}
${goto 23}0${execi 300 sed -n '9p' ~/1_accuweather/curr_cond}${endif}\
${if_match ${execi 300 sed -n '9p' ~/1_accuweather/curr_cond}==3}${image ~/1_accuweather/UVI/Yellow_D_128.png -s 64x64}
${goto 23}0${execi 300 sed -n '9p' ~/1_accuweather/curr_cond}${endif}\
${if_match ${execi 300 sed -n '9p' ~/1_accuweather/curr_cond}==4}${image ~/1_accuweather/UVI/Yellow_D_128.png -s 64x64}
${goto 23}0${execi 300 sed -n '9p' ~/1_accuweather/curr_cond}${endif}\
${if_match ${execi 300 sed -n '9p' ~/1_accuweather/curr_cond}==5}${image ~/1_accuweather/UVI/Yellow_D_128.png -s 64x64}
${goto 23}0${execi 300 sed -n '9p' ~/1_accuweather/curr_cond}${endif}\
${if_match ${execi 300 sed -n '9p' ~/1_accuweather/curr_cond}==6}${image ~/1_accuweather/UVI/Orange_D_128.png -s 64x64}
${goto 23}0${execi 300 sed -n '9p' ~/1_accuweather/curr_cond}${endif}\
${if_match ${execi 300 sed -n '9p' ~/1_accuweather/curr_cond}==7}${image ~/1_accuweather/UVI/Orange_D_128.png -s 64x64}
${goto 23}0${execi 300 sed -n '9p' ~/1_accuweather/curr_cond}${endif}\
${if_match ${execi 300 sed -n '9p' ~/1_accuweather/curr_cond}==8}${image ~/1_accuweather/UVI/Red_D_128.png -s 64x64}
${goto 23}0${execi 300 sed -n '9p' ~/1_accuweather/curr_cond}${endif}\
${if_match ${execi 300 sed -n '9p' ~/1_accuweather/curr_cond}==9}${image ~/1_accuweather/UVI/Red_D_128.png -s 64x64}
${goto 23}0${execi 300 sed -n '9p' ~/1_accuweather/curr_cond}${endif}\
${if_match ${execi 300 sed -n '9p' ~/1_accuweather/curr_cond}==10}${image ~/1_accuweather/UVI/Red_D_128.png -s 64x64}
${goto 23}${execi 300 sed -n '9p' ~/1_accuweather/curr_cond}${endif}\
${if_match ${execi 300 sed -n '9p' ~/1_accuweather/curr_cond}==11}${image ~/1_accuweather/UVI/Violet_D_128.png -s 64x64}
${goto 23}${execi 300 sed -n '9p' ~/1_accuweather/curr_cond}${endif}

Green_D_128.png Orange_D_128.png Red_D_128.png Violet_D_128.png Yellow_D_128.png


BunsenLabs Forum Rules ---== I'm a Conky 1.9'er ==---
System:    Host: s12 Kernel: 3.16.0-4-amd64 x86_64 (64 bit gcc: 4.8.4)
Desktop: Openbox 3.5.2 dm: (startx) Distro: Debian GNU/Linux 8

Offline

#1474 2017-01-16 19:20:09

TeoBigusGeekus
BL DieHard
From: /Greece/Kastoria
Registered: 2015-10-04
Posts: 819

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

I'll be damned: .conkyrc4 from script #2b works now.
I swear it didn't work last night and today at noon.  hmm

@S11
Thats a great idea S11 and it can come handy in hot and semi hot climates.
I'm putting it on the front page.


Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!

Offline

#1475 2017-01-16 19:25:34

TeoBigusGeekus
BL DieHard
From: /Greece/Kastoria
Registered: 2015-10-04
Posts: 819

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

Sector11 wrote:

There is a "sun phase"  ??

From the source code on wunderground's page:

"sun_phase": {
		"sunrise": {
		"hour":"7",
		"minute":"55"
		},
		"sunset": {
		"hour":"17",
		"minute":"33"

Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!

Offline

Board footer

Powered by FluxBB