You are not logged in.

#2426 2019-06-12 16:50:58

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

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

No it update with another conky (conky-meteo) witch use same data.

Offline

#2427 2019-06-13 12:08:04

ragamatrix
Member
Registered: 2015-10-04
Posts: 347

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

ok... well I'm not sure if I've understood how it works..
I got that (but the datas are not correct):
3b1:

#!/bin/bash

wget -O $HOME/conky-meteo-dark_sky/weather.json https://api.darksky.net/forecast/--my-id-number--/'47.250549','8.623953'?'lang=fr&units=si'


Dark_Sky_icons () {
    case $1 in
         clear-day)
            echo 1
        ;;
         clear-night)
            echo 2
        ;;
         cloudy)
            echo 3
        ;;
         fog)
            echo 4
        ;;
         partly-cloudy-day)
            echo 5
        ;;
         partly-cloudy-night)
            echo 6
        ;;
         rain)
            echo 7
        ;;
         sleet)
            echo 8
        ;;
         snow)
            echo 9
        ;;
         wind)
            echo 10
        ;;
        esac
}

rm $HOME/conky-meteo-dark_sky/*.png
#Forecast feature: Forecast
jq --raw-output '.currently[]' $HOME/conky-meteo-dark_sky/weather.json > Conditions

cp $HOME/conky-meteo-dark_sky/Dark_Sky_icons/$(Dark_Sky_icons $(sed -n 3p $HOME/conky-meteo-dark_sky/Conditions)).png $HOME/conky-meteo-dark_sky/Now.png

jq --raw-output '.daily.data[].icon' $HOME/conky-meteo-dark_sky/weather.json > daily-icons

cat $HOME/conky-meteo-dark_sky/weather.json | jq '.daily.data' | sed 's/[",:,},{]//g' | awk '{$1=""}1' | sed 's/^[ \t]*//' |  sed '/./!d' > Forecasts

for (( i=1; i<=8; i+=1 ))
    do
        cp $HOME/conky-meteo-dark_sky/Dark_Sky_icons/$(Dark_Sky_icons $(sed -n ${i}p $HOME/conky-meteo-dark_sky/daily-icons)).png $HOME/conky-meteo-dark_sky/d$(( i )).png
   done

#Hourly feature, commented out by default, uncomment if you wish so

#for (( j=1; j<=24; j+=1 ))
#    do
#        cp $HOME/conky-meteo-dark_sky/Dark_Sky_icons/$(Dark_Sky_icons $(sed -n ${j}p $HOME/conky-meteo-dark_sky/hourly-icons)).png $HOME/conky-meteo-dark_sky/h$(( j )).png
#   done

    # icone direction vent 
wind_direction=$(cat $HOME/conky-meteo-dark_sky/weather.json | jq --raw-output '.currently.windBearing')
if [[ $wind_direction > 0 ]] && [[ $wind_direction < 12 ]]; then
    cp $HOME/conky-meteo-dark_sky/vent/"01.png" $HOME/conky-meteo-dark_sky/Wind.png
elif [[ $wind_direction > 34 ]] && [[ $wind_direction < 56 ]]; then
    cp $HOME/conky-meteo-dark_sky/vent/"03.png" $HOME/conky-meteo-dark_sky/Wind.png
elif [[ $wind_direction > 56 ]] && [[ $wind_direction < 78 ]]; then
    cp $HOME/conky-meteo-dark_sky/vent/"04.png" $HOME/conky-meteo-dark_sky/Wind.png
elif [[ $wind_direction > 78 ]] && [[ $wind_direction < 101 ]]; then
    cp $HOME/conky-meteo-dark_sky/vent/"05.png" $HOME/conky-meteo-dark_sky/Wind.png 
elif [[ $wind_direction > 101 ]] && [[ $wind_direction < 124 ]]; then
    cp $HOME/conky-meteo-dark_sky/vent/"06.png" $HOME/conky-meteo-dark_sky/Wind.png
elif [[ $wind_direction > 124 ]] && [[ $wind_direction < 146 ]]; then
    cp $HOME/conky-meteo-dark_sky/vent/"07.png" $HOME/conky-meteo-dark_sky/Wind.png
elif [[ $wind_direction > 146 ]] && [[ $wind_direction < 169 ]]; then
    cp $HOME/conky-meteo-dark_sky/vent/"08.png" $HOME/conky-meteo-dark_sky/Wind.png
elif [[ $wind_direction > 169 ]] && [[ $wind_direction < 192 ]]; then
    cp $HOME/conky-meteo-dark_sky/vent/"09.png" $HOME/conky-meteo-dark_sky/Wind.png
elif [[ $wind_direction > 192 ]] && [[ $wind_direction < 214 ]]; then
    cp $HOME/conky-meteo-dark_sky/vent/"10.png" $HOME/conky-meteo-dark_sky/Wind.png
elif [[ $wind_direction > 214 ]] && [[ $wind_direction < 236 ]]; then
    cp $HOME/conky-meteo-dark_sky/vent/"11.png" $HOME/conky-meteo-dark_sky/Wind.png
elif [[ $wind_direction > 236 ]] && [[ $wind_direction < 259 ]]; then
    cp $HOME/conky-meteo-dark_sky/vent/"12.png" $HOME/conky-meteo-dark_sky/Wind.png
elif [[ $wind_direction > 259 ]] && [[ $wind_direction < 281 ]]; then
    cp $HOME/conky-meteo-dark_sky/vent/"13.png" $HOME/conky-meteo-dark_sky/Wind.png
elif [[ $wind_direction > 281 ]] && [[ $wind_direction < 304 ]]; then
    cp $HOME/conky-meteo-dark_sky/vent/"14.png" $HOME/conky-meteo-dark_sky/Wind.png
elif [[ $wind_direction > 304 ]] && [[ $wind_direction < 326 ]]; then
    cp $HOME/conky-meteo-dark_sky/vent/"15.png" $HOME/conky-meteo-dark_sky/Wind.png
elif [[ $wind_direction > 326 ]] && [[ $wind_direction < 349 ]]; then
    cp $HOME/conky-meteo-dark_sky/vent/"16.png" $HOME/conky-meteo-dark_sky/Wind.png
elif [[ $wind_direction > 349 ]] && [[ $wind_direction < 360 ]]; then
    cp $HOME/conky-meteo-dark_sky/vent/"01.png" $HOME/conky-meteo-dark_sky/Wind.png

fi

conky-meteo-V2:

conky.config = {
background = false,
use_xft = true,
font = 'DejaVuSansMono:size=8',
update_interval = 300.0,
total_run_times = 0,
own_window = true,
own_window_type = 'normal',
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 = 390,
minimum_height = 900,
gap_x = 40,
gap_y = 40,
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',
color3 = '005fff',
color4 = 'ff4500',
lua_load = '/home/raphix/conky-meteo-dark_sky/date_position.lua', 
lua_draw_hook_pre = 'date_position',

}

conky.text = [[
${execi 300 bash /home/raphix/conky-meteo-dark_sky/3b1}\
${color2}${goto 90}${font DejaVuSansMono:bold:size=10}Prévisions semaine${font}
${image ~/conky-meteo-dark_sky/d1.png -p -1,35 -s 53x32}
${image ~/conky-meteo-dark_sky/d2.png -p -1,105 -s 53x32}
${image ~/conky-meteo-dark_sky/d3.png -p -1,175 -s 53x32}
${image ~/conky-meteo-dark_sky/d4.png -p -1,245 -s 53x32}
${image ~/conky-meteo-dark_sky/d5.png -p -1,315 -s 53x32}
${image ~/conky-meteo-dark_sky/d6.png -p -1,385 -s 53x32}
${image ~/conky-meteo-dark_sky/d7.png -p -1,455 -s 53x32}
${image ~/conky-meteo-dark_sky/d8.png -p -1,525 -s 53x32}
]]

Offline

#2428 2019-06-14 04:42:51

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

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

Try to add

    os.execute ('/home/raphix/conky-meteo-dark_sky/3b1')

in the file date_position.lua:

require 'cairo'
require 'imlib2'

    os.execute ('/home/raphix/conky-meteo-dark_sky/3b1')

function conky_date_position()
    if conky_window == nil then return end

............................................

and remove "${execi 300 bash /home/raphix/conky-meteo-dark_sky/3b1}\" in your conky-meteo-V2

Offline

#2429 2019-06-14 08:20:57

ragamatrix
Member
Registered: 2015-10-04
Posts: 347

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

Thanks for your help chepioq but I still have the same uncorect datas appearing...

Offline

#2430 2019-06-18 04:45:40

unklar
Member
Registered: 2015-10-31
Posts: 856

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

Hi friends,

the page moongiant.com has a bug. Do you have that too?

Verbindungsaufbau zu www.moongiant.com (www.moongiant.com)|23.0.40.247|:80... verbunden.
HTTP-Anforderung gesendet, warte auf Antwort... 302 Moved Temporarily
Platz: https://www.moongiant.com/phase/today[folge]
--2019-06-18 06:30:25--  https://www.moongiant.com/phase/today
Verbindungsaufbau zu www.moongiant.com (www.moongiant.com)|23.0.40.247|:443... verbunden.
HTTP-Anforderung gesendet, warte auf Antwort... 500 Internal Server Error
2019-06-18 06:30:25 FEHLER 500: Internal Server Error.

Offline

#2431 2019-06-18 04:54:03

ohnonot
...again
Registered: 2015-09-29
Posts: 3,742
Website

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

^ No, it's all good here.
Just a temporary glitch I guess.

Offline

#2432 2019-06-18 20:37:32

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

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

Open the script (moon_MoonGiant) and replace line #48

wget -O $HOME/4_Moon/raw "http://www.moongiant.com/phase/today"

with

wget -O $HOME/4_Moon/raw "http://www.moongiant.com/phase/today/"

ie. add a slash at the end of today.

The former url doesn't seem to work anymore whereas the slashed one seems to be ok; I'll watch it for a while (couple of days) and then I'll update the script.


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

#2433 Yesterday 07:48:01

unklar
Member
Registered: 2015-10-31
Posts: 856

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

Thank you, Teo, I'll try it out.   smile

Offline

#2434 Yesterday 07:54:51

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

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

...and today both urls work OK; go figure  roll


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

#2435 Yesterday 08:04:02

unklar
Member
Registered: 2015-10-31
Posts: 856

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

and I have now inserted the / and the data is there, the raw file is filled.

TeoBigusGeekus wrote:

...and today both urls work OK; go figure  roll

Teo, Got'es ways are unfathomable....  not with me now.   hmm

only with /
retested

Last edited by unklar (Yesterday 08:07:27)

Offline

Board footer

Powered by FluxBB