You are not logged in.

#2376 2019-04-04 07:53:11

loutch
Member
Registered: 2015-12-12
Posts: 311

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

Don't change anything

here current conditions section

#current conditions
    if [[ -s $HOME/1_accuweather/curr_cond_raw ]]; then
        #retire le contenu du fichier qui ne se trouve pas entre la ligne contenant detail-now et Astronomy <span class
        #MODIFICATION de Astronomy en Astronomie
        sed -i '/detail-now/,/Astronomie <span class/!d' $HOME/1_accuweather/curr_cond_raw
        #On envoie les lignes contenant les valeurs à récupérer dans curr_cond
        #MODIFICATION de Humidity en Humidit
        #MODIFICATION de Pressure en Pression
        #MODIFICATION de UV Index en Indice UV
        #MODIFICATION de Cloud Cover en Couverture nuageuse
        #MODIFICATION de Ceiling en Plafond
        #MODIFICATION de Dew Point en Point de ros
        #MODIFICATION de Visibility en Visibilit
        #MODIFICATION de Sunrise: en Lever du soleil:
        #MODIFICATION de Sunset: en Lever du soleil:
        #MODIFICATION de Moonrise: en Lever de lune:
        #MODIFICATION de Moonset: en Coucher de lune:
        egrep -i '"cond"|icon i-|large-temp|small-temp|wind-point|"wind"><strong>|Humidit|Pression|Indice UV|Couverture nuageuse|Plafond|Point de ros|Visibilit|Duration|Lever du soleil:|Coucher de soleil:|Lever de lune:|Coucher de lune:' $HOME/1_accuweather/curr_cond_raw > $HOME/1_accuweather/curr_cond
        #AJOUT remplacement des accents
        sed -i -e 's/\&#234;/ê/g' -e 's/\&#233;/é/g' -e 's/\&#244;/ô/g' -e 's/\&#232;/è/g' -e 's/\&#231;/ç/g' -e 's/\&#39;/'"'"'/g' $HOME/1_accuweather/curr_cond
            sed -i -e 's/NW/NO/g' -e 's/WNW/ONO/g' -e 's/NNW/NNO/g' -e 's/W/O/g' -e 's/SSW/SSO/g' -e 's/SW/SO/g' -e 's/WSW/OSO/g' -e 's/W/O/g' $HOME/1_accuweather/curr_cond
        #nettoyage des lignes par la gauche
        sed -i -e 's/^.*<strong>//g' -e 's/^.*<span>//g' -e 's/^.*icon i-//g' -e 's/^.*large-temp">//g' -e 's/^.*<\/em> //g' -e 's/^.*"cond">//g' -e 's/^.*wind-point //g' $HOME/1_accuweather/curr_cond
        #nettoyage des lignes par la droite
        sed -i -e 's/">.*$//g' -e 's/&deg.*$//g' -e 's/<\/span>.*$//g' -e 's/&#.*$//g' -e 's/ &darr.*$//g' -e 's/ &uarr.*$//g' -e 's/<\/strong>.*$//g' $HOME/1_accuweather/curr_cond
      
           round_press=$(printf "%.0f\n" $(sed -n 8p $HOME/1_accuweather/curr_cond|sed 's/ mb//'))
           sed -i "8s/.*/$round_press/" $HOME/1_accuweather/curr_cond

#nettoyage de l'id icone
        sed -i '1s/-.*$//' $HOME/1_accuweather/curr_cond
        #affectation des valeurs du fichier curr_cond aux variables
        image=$(sed -n 1p $HOME/1_accuweather/curr_cond)
        echo $(test_image $image) >> $HOME/1_accuweather/curr_cond
        sunrise_time=$(sed -n 14p $HOME/1_accuweather/curr_cond)
        echo $(convert_time "$sunrise_time") >> $HOME/1_accuweather/curr_cond
        sunrise_time=$(sed -n 15p $HOME/1_accuweather/curr_cond)
        echo $(convert_time "$sunrise_time") >> $HOME/1_accuweather/curr_cond
        sunrise_time=$(sed -n 18p $HOME/1_accuweather/curr_cond)
        echo $(convert_time "$sunrise_time") >> $HOME/1_accuweather/curr_cond
        sunrise_time=$(sed -n 19p $HOME/1_accuweather/curr_cond)
        echo $(convert_time "$sunrise_time") >> $HOME/1_accuweather/curr_cond
        wind=$(sed -n 5p $HOME/1_accuweather/curr_cond)
        echo $(test_wind $wind) >> $HOME/1_accuweather/curr_cond
        if (( $(sed -n 14p /$HOME/1_accuweather/curr_cond|wc -c) == 8 )); then
            sed -i '14s/^/0/' $HOME/1_accuweather/curr_cond
        fi
        if (( $(sed -n 15p /$HOME/1_accuweather/curr_cond|wc -c) == 8 )); then
            sed -i '15s/^/0/' $HOME/1_accuweather/curr_cond
        fi
        if (( $(sed -n 18p /$HOME/1_accuweather/curr_cond|wc -c) == 8 )); then
            sed -i '18s/^/0/' $HOME/1_accuweather/curr_cond
        fi
        if (( $(sed -n 19p /$HOME/1_accuweather/curr_cond|wc -c) == 8 )); then
            sed -i '19s/^/0/' $HOME/1_accuweather/curr_cond
        fi
        #création de l'image correspondante
        if [[ $forecast2015 == 1 ]]; then
            cp $HOME/1_accuweather/Forecast_Images_2015/$(sed -n 1p $HOME/1_accuweather/curr_cond).png $HOME/1_accuweather/forecast_2015/forecast_0.png
            cp $HOME/1_accuweather/Forecast_Images_2015/$(sed -n 5p $HOME/1_accuweather/curr_cond).png $HOME/1_accuweather/forecast_2015/wind_0.png
        fi
        if [[ $forecast2016 == 1 ]]; then
            cp $HOME/1_accuweather/Forecast_Images_2016/$(sed -n 1p $HOME/1_accuweather/curr_cond).png $HOME/1_accuweather/forecast_2016/forecast_0.png
            cp $HOME/1_accuweather/Forecast_Images_2016/$(sed -n 5p $HOME/1_accuweather/curr_cond).png $HOME/1_accuweather/forecast_2016/wind_0.png
        fi
    fi
   
    # icone direction vent
wind_direction=$(sed -n 5p $HOME/1_accuweather/curr_cond)
if [[ $wind_direction == "S" ]]; then
    cp $HOME/1_accuweather/vents/"02.png" $HOME/1_accuweather/Wind1.png
elif [[ $wind_direction == "South" ]]; then
    cp $HOME/1_accuweatherI/vents/"02.png" $HOME/1_accuweather/Wind1.png
elif [[ $wind_direction == "SSO" ]]; then
    cp $HOME/1_accuweather/vents/"03.png" $HOME/1_accuweather/Wind1.png
elif [[ $wind_direction == "SO" ]]; then
    cp $HOME/1_accuweather/vents/"04.png" $HOME/1_accuweather/Wind1.png
elif [[ $wind_direction == "OSO" ]]; then
    cp $HOME/1_accuweather/vents/"05.png" $HOME/1_accuweather/Wind1.png
elif [[ $wind_direction == "O" ]]; then
    cp $HOME/1_accuweather/vents/"06.png" $HOME/1_accuweather/Wind1.png
elif [[ $wind_direction == "West" ]]; then
    cp $HOME/1_accuweather/vents/"06.png" $HOME/1_accuweather/Wind1.png
elif [[ $wind_direction == "ONO" ]]; then
    cp $HOME/1_accuweather/vents/"07.png" $HOME/1_accuweather/Wind1.png
elif [[ $wind_direction == "NO" ]]; then
    cp $HOME/1_accuweather/vents/"08.png" $HOME/1_accuweather/Wind1.png
elif [[ $wind_direction == "NNO" ]]; then
    cp $HOME/1_accuweather/vents/"09.png" $HOME/1_accuweather/Wind1.png
elif [[ $wind_direction == "N" ]]; then
    cp $HOME/1_accuweather/vents/"10.png" $HOME/1_accuweather/Wind1.png
elif [[ $wind_direction == "North" ]]; then
    cp $HOME/1_accuweather/vents/"10.png" $HOME/1_accuweather/Wind1.png
elif [[ $wind_direction == "NNE" ]]; then
    cp $HOME/1_accuweather/vents/"11.png" $HOME/1_accuweather/Wind1.png
elif [[ $wind_direction == "NE" ]]; then
    cp $HOME/1_accuweather/vents/"12.png" $HOME/1_accuweather/Wind1.png
elif [[ $wind_direction == "ENE" ]]; then
    cp $HOME/1_accuweather/vents/"13.png" $HOME/1_accuweather/Wind1.png
elif [[ $wind_direction == "E" ]]; then
    cp $HOME/1_accuweather/vents/"14.png" $HOME/1_accuweather/Wind1.png
elif [[ $wind_direction == "East" ]]; then
    cp $HOME/1_accuweather/vents/"14.png" $HOME/1_accuweather/Wind1.png
elif [[ $wind_direction == "ESE" ]]; then
    cp $HOME/1_accuweather/vents/"15.png" $HOME/1_accuweather/Wind1.png
elif [[ $wind_direction == "SE" ]]; then
    cp $HOME/1_accuweather/vents/"16.png" $HOME/1_accuweather/Wind1.png
elif [[ $wind_direction == "SSE" ]]; then
    cp $HOME/1_accuweather/vents/"17.png" $HOME/1_accuweather/Wind1.png
elif [[ $wind_direction == "Variable" ]]; then
    cp $HOME/1_accuweather/vents/"00.png" $HOME/1_accuweather/Wind1.png
fi


Linuxmint 19.1 Tessa cinnamon & mageia 7 mate on ssd hp pavilion g7
Xubuntu 18.10 xfce on ASUS Rog STRIX

Offline

#2377 2019-04-04 07:58:42

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

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

Try adding the commands at the end of the script then.


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

#2378 2019-04-04 08:01:32

loutch
Member
Registered: 2015-12-12
Posts: 311

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

At line 8 i have 0

Last edited by loutch (2019-04-04 08:03:49)


Linuxmint 19.1 Tessa cinnamon & mageia 7 mate on ssd hp pavilion g7
Xubuntu 18.10 xfce on ASUS Rog STRIX

Offline

#2379 2019-04-04 08:03:23

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

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

What's the pressure before adding the commands?


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

#2380 2019-04-04 08:12:39

loutch
Member
Registered: 2015-12-12
Posts: 311

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

990.40 mb


Linuxmint 19.1 Tessa cinnamon & mageia 7 mate on ssd hp pavilion g7
Xubuntu 18.10 xfce on ASUS Rog STRIX

Offline

#2381 2019-04-04 08:20:46

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

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

I tried it with my script, it changes 1016.00 mb to 1016.

Give it another try.


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

#2382 2019-04-04 08:26:25

loutch
Member
Registered: 2015-12-12
Posts: 311

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

Killall my conky

Launch them nothind in line 8 i have 0


Linuxmint 19.1 Tessa cinnamon & mageia 7 mate on ssd hp pavilion g7
Xubuntu 18.10 xfce on ASUS Rog STRIX

Offline

#2383 2019-04-04 08:29:01

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

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

Maybe the lua command affects the final result?


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

#2384 2019-04-04 08:30:27

loutch
Member
Registered: 2015-12-12
Posts: 311

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

If that don't work with accuweather i try it with wunderground conditions


Linuxmint 19.1 Tessa cinnamon & mageia 7 mate on ssd hp pavilion g7
Xubuntu 18.10 xfce on ASUS Rog STRIX

Offline

#2385 2019-04-04 08:32:38

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

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

Try executing the script without launching conky, see if that works.


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

#2386 2019-04-04 08:35:28

loutch
Member
Registered: 2015-12-12
Posts: 311

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

~$ bash $HOME/1_accuweather/1_accuweather -f2016
/home/romuald/1_accuweather/1_accuweather: ligne 858 : printf: 999.40: nombre non valable

Linuxmint 19.1 Tessa cinnamon & mageia 7 mate on ssd hp pavilion g7
Xubuntu 18.10 xfce on ASUS Rog STRIX

Offline

#2387 2019-04-04 08:38:10

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

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

try this :

name='exec',                arg='sed -n 8p $HOME/1_accuweather/curr_cond | awk '{printf("%d\n",$1)}'

Last edited by chepioq (2019-04-04 09:58:55)

Offline

#2388 2019-04-04 08:39:38

loutch
Member
Registered: 2015-12-12
Posts: 311

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

Theo i quit you a fews minutes must chearch my son at school


Linuxmint 19.1 Tessa cinnamon & mageia 7 mate on ssd hp pavilion g7
Xubuntu 18.10 xfce on ASUS Rog STRIX

Offline

#2389 2019-04-04 08:41:26

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

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

Could it be a regional setting?
What's your system's decimal separator?
Is it a comma or a period?


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

#2390 2019-04-04 09:24:47

loutch
Member
Registered: 2015-12-12
Posts: 311

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

i have this

it's a comma

1554369938.png


Linuxmint 19.1 Tessa cinnamon & mageia 7 mate on ssd hp pavilion g7
Xubuntu 18.10 xfce on ASUS Rog STRIX

Offline

#2391 2019-04-04 09:35:57

loutch
Member
Registered: 2015-12-12
Posts: 311

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

Hello chepioq

tanks for helping ,sorry don't work


Linuxmint 19.1 Tessa cinnamon & mageia 7 mate on ssd hp pavilion g7
Xubuntu 18.10 xfce on ASUS Rog STRIX

Offline

#2392 2019-04-04 09:39:51

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

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

loutch wrote:

i have this

it's a comma

That's why it's not recognized as a valid number.

Use these instead

round_press=$(printf "%.0f\n" $(sed -n 8p $HOME/1_accuweather/curr_cond|sed 's/ mb//'|sed 's/\./\,/'))
sed -i "8s/.*/$round_press/" $HOME/1_accuweather/curr_cond

EDIT: Corrected the commands

Last edited by TeoBigusGeekus (2019-04-04 09:45:35)


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

#2393 2019-04-04 09:48:36

loutch
Member
Registered: 2015-12-12
Posts: 311

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

wait no error in terminal

Last edited by loutch (2019-04-04 09:50:06)


Linuxmint 19.1 Tessa cinnamon & mageia 7 mate on ssd hp pavilion g7
Xubuntu 18.10 xfce on ASUS Rog STRIX

Offline

#2394 2019-04-04 09:49:28

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

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

I've corrected the commands in my latest post, copy them again.


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

#2395 2019-04-04 09:54:35

loutch
Member
Registered: 2015-12-12
Posts: 311

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

ok work great  i have 1000 at line 8 conky work great

Tanks MASTERS


Linuxmint 19.1 Tessa cinnamon & mageia 7 mate on ssd hp pavilion g7
Xubuntu 18.10 xfce on ASUS Rog STRIX

Offline

#2396 2019-04-04 09:55:57

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

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

wink

Took us a while but we finally got it.


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

#2397 2019-04-04 09:58:16

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

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

loutch wrote:

Hello chepioq

tanks for helping ,sorry don't work

I have a mistake in my code the good is :

name='exec',                arg='sed -n 8p $HOME/1_accuweather/curr_cond | awk '{printf("%d\n",$1)}'

Offline

#2398 2019-04-04 12:19:02

loutch
Member
Registered: 2015-12-12
Posts: 311

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

Don't work

something like ' or \ or , make a mistake

in conkyrc i used this before

sed -n '8p' $HOME/1_accuweather/curr_cond |cut -c1-4

in lua script this

sed -n 8p $HOME/1_accuweather/curr_cond |cut -c1-4

without ' for 8p

@+


Linuxmint 19.1 Tessa cinnamon & mageia 7 mate on ssd hp pavilion g7
Xubuntu 18.10 xfce on ASUS Rog STRIX

Offline

#2399 2019-04-04 12:22:28

loutch
Member
Registered: 2015-12-12
Posts: 311

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

Conkys are working great since this morning

1554380635.png


Linuxmint 19.1 Tessa cinnamon & mageia 7 mate on ssd hp pavilion g7
Xubuntu 18.10 xfce on ASUS Rog STRIX

Offline

#2400 2019-04-04 14:11:46

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

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

@ loutch
Where is the conky which show the graphic for the pressure ?

Offline

Board footer

Powered by FluxBB