You are not logged in.

#1676 2017-06-16 06:51:18

chairman67
Member
From: West Coast, Australia
Registered: 2017-06-12
Posts: 18

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

No worries mate, no need for any apology... Brainfarts get the better of us all from time to time. smile
In most cases there is always a workaround to fix most technical problems we encounter.. but in life, well that's a different challenge!

Offline

#1677 2017-06-16 10:57:15

chairman67
Member
From: West Coast, Australia
Registered: 2017-06-12
Posts: 18

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

Sector11 wrote:

Two weeks into Linux and you already have a weather conky!  That's a sign of conky addiction, we'll have you in the One Step Program before you know it.
In a terminal check out man conky. 'man' is your friendly manual for 99% of the programs you have installed.
Did I say welcome to the forums?  Come back anytime.

Thanks Sector, much appreciated!

Sector11 wrote:

Yea go get some sleep ... 9:30ish in the AM is a LONG night.

Actually it was more like 0730ish being that I am currently living in China !

Last edited by chairman67 (2017-06-16 12:15:55)

Offline

#1678 2017-06-16 11:40:04

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

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

Hello,
I still have an update problem with the wu and acc weather scripts. I've noticed this error with sed :

sed: -e expression n°1, caractère 4: commande manquante

The conky is not displayed, after that I re-launch the conky which is now displayed. The problem is that I run 2 conkys with one time with a bug and at the second time without error reported...
After a while the script crash, I didn't find a solution to correct the sed problem, thanks by advance for help.
... oh and the T° of the last hour forecast is not dispayed. here is my conky:

conky.config = {
-- Create own window instead of using desktop (required in nautilus)
	own_window = true,
	own_window_type = 'override',
	own_window_transparent = true,
	own_window_hints = 'undecorated,below,skip_taskbar,skip_pager,sticky',

-- Use double buffering (reduces flicker, may not work for everyone)
	double_buffer = true,
	text_buffer_size = 2048,
-- fiddle with window
	use_spacer = 'none',
	use_xft = true,

-- Update interval in seconds
	update_interval = 1,
	cpu_avg_samples = 2,
	net_avg_samples = 2,
-- Minimum size of text area
	minimum_width = 235, minimum_height = 320,
	maximum_width = 235,

	override_utf8_locale = true,

-- Draw shades?
	draw_shades = true,

-- Text stuff
	draw_outline = true,-- amplifies text if yes
	draw_borders = false,
--font freesans -12
	font = 'Liberation Mono:bold:size=9',
	uppercase = false,-- set to yes if you want all text to be in uppercase

-- Stippled borders?
	stippled_borders = 3,

-- border margins
--border_margin = '9',

-- border width
	border_width = 10,

-- Default colors and also border colors, grey90 == #e5e5e5
	default_color = '#cbcbcb',
	color1  = '#505454', 
	own_window_colour = 'brown',
	own_window_transparent = true,

-- Text alignment, other possible values are commented
--alignment top_right
--alignment top_left
alignment = 'top_right',
--alignment bottom_left
--alignment bottom_right

-- Gap between borders of screen and text
	gap_x = 50,
	gap_y = 50,

	imlib_cache_size = 0,

};

conky.text = [[
${voffset -15}${execi 600 bash $HOME/2_Wunderground_API/2_wun}\
${image $HOME/2_Wunderground_API/HTCimages/base.png -p -12,30 -s 260x145}\
${image $HOME/2_Wunderground_API/HTCimages/base.png -p -12,168 -s 260x70}
${image $HOME/2_Wunderground_API/HTCimages/flip_bg.png -p 18,9 -s 100x110}\
${image $HOME/2_Wunderground_API/HTCimages/flip_bg.png -p 118,9 -s 100x110}\
${image $HOME/2_Wunderground_API/Now.png -p 55,98 -s 125x75}
${image $HOME/2_Wunderground_API/HTCimages/base.png -p -12,250 -s 260x70}
${font LED_Mono:size=60}${color1}${goto 24}${time %H}${goto 124}${time %M}${font}
 ${goto 28}${execi 600  sed -n '67p' $HOME/2_Wunderground_API/Conditions}°\
${goto 130}${time %a %e %b}${color}
${goto 4}Wind ${execi 600  sed -n '73p' $HOME/2_Wunderground_API/Conditions}\
${alignr 17}${execi 600  sed -n '63p' $HOME/2_Wunderground_API/Conditions|cut -c-13}
${goto 4}${execi 600  sed -n '74p' $HOME/2_Wunderground_API/Hourly} km/h\
${alignr 17}${execi 600  sed -n '69p' $HOME/2_Wunderground_API/Conditions} Hum
${goto 4}UVI ${execi 600  sed -n '121p' $HOME/2_Wunderground_API/Conditions}\
${alignr 17}${execi 600  sed -n '57p' $HOME/2_Wunderground_API/Simple_Forecast}mm Prec
${goto 4}${execi 600  sed -n '85p' $HOME/2_Wunderground_API/Conditions}mb\
${alignr 17}${execi 600  sed -n '117p' $HOME/2_Wunderground_API/Conditions} Vis${color}

##--bloc heures##
${goto 12}${execi 600 echo `date --date "2 hour" +%H:%M|sed -e 's/\(.\{1\}\)/\U\1/'`}\
${goto 58}${execi 600 echo `date --date "4 hour" +%H:%M|sed -e 's/\(.\{1\}\)/\U\1/'`}\
${goto 105}${execi 600 echo `date --date "6 hour" +%H:%M|sed -e 's/\(.\{1\}\)/\U\1/'`}\
${goto 150}${execi 600 echo `date --date "8 hour" +%H:%M|sed -e 's/\(.\{1\}\)/\U\1/'`}\
${goto 196}${execi 600 echo `date --date "10 hour" +%H:%M|sed -e 's/\(.\{1\}\)/\U\1/'`}\
${voffset 15}${color8}${goto 6}${execi 600  sed -n '172p' $HOME/2_Wunderground_API/Hourly}°\
${goto 52}${execi 600  sed -n '406p' $HOME/2_Wunderground_API/Hourly}°\
${goto 99}${execi 600  sed -n '640p' $HOME/2_Wunderground_API/Hourly}°\
${goto 144}${execi 600  sed -n '874p' $HOME/2_Wunderground_API/Hourly}°\
${goto 190}${execi 600  sed -n '1108' $HOME/2_Wunderground_API/Hourly}°\
${image $HOME/2_Wunderground_API/h2.png -p 5,195 -s 50x30}\
${image $HOME/2_Wunderground_API/h4.png -p 51,195 -s 50x30}\
${image $HOME/2_Wunderground_API/h6.png -p 97,195 -s 50x30}\
${image $HOME/2_Wunderground_API/h8.png -p 143,195 -s 50x30}\
${image $HOME/2_Wunderground_API/h10.png -p 188,195 -s 50x30}${color}\
##--bloc heures##

${voffset 52}${goto 12}${execi 600 echo `date --date "1 day" +%a|sed -e 's/\(.\{1\}\)/\U\1/'`}\
${goto 58}${execi 600 echo `date --date "2 day" +%a|sed -e 's/\(.\{1\}\)/\U\1/'`}\
${goto 105}${execi 600 echo `date --date "3 day" +%a|sed -e 's/\(.\{1\}\)/\U\1/'`}\
${goto 150}${execi 600 echo `date --date "4 day" +%a|sed -e 's/\(.\{1\}\)/\U\1/'`}\
${goto 196}${execi 600 echo `date --date "5 day" +%a|sed -e 's/\(.\{1\}\)/\U\1/'`}\

${color8}${goto 6}${execi 600  sed -n '145p' $HOME/2_Wunderground_API/Simple_Forecast}°\
${goto 52}${execi 600  sed -n '251p' $HOME/2_Wunderground_API/Simple_Forecast}°\
${goto 99}${execi 600  sed -n '357p' $HOME/2_Wunderground_API/Simple_Forecast}°\
${goto 144}${execi 600  sed -n '463p' $HOME/2_Wunderground_API/Simple_Forecast}°\
${goto 190}${execi 600  sed -n '569p' $HOME/2_Wunderground_API/Simple_Forecast}°\
${image $HOME/2_Wunderground_API/d2.png -p 5,273 -s 50x30}\
${image $HOME/2_Wunderground_API/d3.png -p 51,273 -s 50x30}\
${image $HOME/2_Wunderground_API/d4.png -p 97,273 -s 50x30}\
${image $HOME/2_Wunderground_API/d5.png -p 143,273 -s 50x30}\
${image $HOME/2_Wunderground_API/d6.png -p 188,273 -s 50x30}\
${voffset 15}${color3}${goto 6}    ${execi 600  sed -n '150p' $HOME/2_Wunderground_API/Simple_Forecast}°\
${goto 52}    ${execi 600  sed -n '256p' $HOME/2_Wunderground_API/Simple_Forecast}°\
${goto 99}    ${execi 600  sed -n '362p' $HOME/2_Wunderground_API/Simple_Forecast}°\
${goto 144}   ${execi 600  sed -n '468p' $HOME/2_Wunderground_API/Simple_Forecast}°\
${goto 190}   ${execi 600  sed -n '574p' $HOME/2_Wunderground_API/Simple_Forecast}°${color}\
]];

Offline

#1679 2017-06-16 16:04:25

Sector11
Conky 1.9er Mod Squid
From: Upstairs
Registered: 2015-08-20
Posts: 6,046

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

@ chairman67 - that's an old trick that was on Conky Hardcore, Conky Pitstops predecessor,  that only exists on my machine these days.   Especially useful if conky is stopping you from using that space on your desktop or there is a conflict between conkys background and your background.  One of the reasons I don't like ${voffset}, but I admit at times it's necessary.

@ Teo - Old!  OH YEA!! but still working,  maybe this will jog your memory, I found the "simple weather site" - a chinese site out of Bejing: http://www.hko.gov.hk/wxinfo/worldwx/wwi.htm   smile
The "majorcities" script you wrote has this line I added:

# TeoBigusGeekus - 20130915

-- a few months shy of 4 years now.

Habitual - who doesn't do conkys anymore - had the code to grab the earth image with daylight and night shadow that updates every 30 minutes.

And it was ragamatrix who had a conky that had a few cities on a small map that showed the time using ${tztime}

After asking you for help with the script** I went NUTZ! merging their ideas into one conky, adding a change in colour as the "date" changed as conky ran.  smile

= = = = =
** help as in "Hey Teo can you write a script to grab the cities/weather from ...  devil  ... and being the nice guy you are you did it almost instantly.  smile

As I look at it today though it needs a major tweak as the info, according to the map has shifted .... BsAs is a few thousand miles east of it's actual location, in the Atlantic.  Hmmmm maybe I found another Atlantis.  smile


The sun will never set if you keep walking towards it. - my son
Being positive doesn't understand physics.

Offline

#1680 2017-06-16 16:20:00

Sector11
Conky 1.9er Mod Squid
From: Upstairs
Registered: 2015-08-20
Posts: 6,046

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

ragamatrix wrote:

Hello,
I still have an update problem with the wu and acc weather scripts.

Trying this here to see if I can help.

... but first thing you need to change:

-- border margins
--border_margin = '9',

to

-- border margins
--border_inner_margin = '9',

this code is WU only though right.

Also can you post the contents of: $HOME/2_Wunderground_API/2_wun please.


The sun will never set if you keep walking towards it. - my son
Being positive doesn't understand physics.

Offline

#1681 2017-06-16 16:53:57

Sector11
Conky 1.9er Mod Squid
From: Upstairs
Registered: 2015-08-20
Posts: 6,046

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

@ ragamatrix

Are wou running the latest script:
2) WUnderground API - All users - 2_4-3-17

your "2_wun" is either: 1) old or 2) modified - in which case we need to see it.

Without your images and using your code below "conky.text = [[" in conky v1.9 I get it:
2017-06-16_135047_Scrot11.jpg


The sun will never set if you keep walking towards it. - my son
Being positive doesn't understand physics.

Offline

#1682 2017-06-16 17:14:50

Sector11
Conky 1.9er Mod Squid
From: Upstairs
Registered: 2015-08-20
Posts: 6,046

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

chairman67 wrote:
Sector11 wrote:

Yea go get some sleep ... 9:30ish in the AM is a LONG night.

Actually it was more like 0730ish being that I am currently living in China !

Well hey, I can't know everything.  Conky I know - reasonable well.
Peoples locations on the blue marble not so much.  big_smile
I see "From:" and "Australia" - how am I to know.  smile


The sun will never set if you keep walking towards it. - my son
Being positive doesn't understand physics.

Offline

#1683 2017-06-16 19:20:30

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

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

Sector11 wrote:

@ ragamatrix

Are wou running the latest script:
2) WUnderground API - All users - 2_4-3-17

your "2_wun" is either: 1) old or 2) modified - in which case we need to see it.

Without your images and using your code below "conky.text = [[" in conky v1.9 I get it:
https://cdn.scrot.moe/images/2017/06/16 … crot11.jpg

Thanks a lot as usual Sector11 wink
I don't know exactly what's the good script but I send you the one I'm running:
2_wun:

#!/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/xxxxxxxxxxxxxxxx/conditions/forecast10day/astronomy/hourly/satellite/q/Switzerland/horgen.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/2_Wunderground_API/*.png

killall -STOP conky
killall wget

wget -O $HOME/2_Wunderground_API/raw_data $address

#Conditions feature
sed -n '/,	"current_observation": {/,/,	"satellite": {/p' $HOME/2_Wunderground_API/raw_data > $HOME/2_Wunderground_API/Conditions
sed -i 's/^[ \t]*"//g' $HOME/2_Wunderground_API/Conditions
sed -i '/current_observation\|image":\|logo_\|title":\|link":\|^[ \t]*},$\|^[ \t]*}$\|temperature_string\|forecast_url\|history_url\|ob_url\|satellite":/d' $HOME/2_Wunderground_API/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/2_Wunderground_API/Conditions
sed -i -e 's/^http.*\/c\/k\///g' -e '/gif/s/_.*$//g' $HOME/2_Wunderground_API/Conditions
day_or_night=$(sed -n 137p $HOME/2_Wunderground_API/Conditions)
if [[ $day_or_night == nt ]]; then
	cp $HOME/2_Wunderground_API/Forecast_Images/$(wun_icon_to_png night $(sed -n 135p $HOME/2_Wunderground_API/Conditions)).png $HOME/2_Wunderground_API/Now.png
else 
	cp $HOME/2_Wunderground_API/Forecast_Images/$(wun_icon_to_png day $(sed -n 135p $HOME/2_Wunderground_API/Conditions)).png $HOME/2_Wunderground_API/Now.png
fi

#Satellite feature, commented out by default, uncomment if you wish so
#sed -n '/,	"satellite": {/,/"forecast":{/p' $HOME/2_Wunderground_API/raw_data > $HOME/2_Wunderground_API/Satellite
#sed -i 's/^[ \t]*"//g' $HOME/2_Wunderground_API/Satellite
#sed -i -e '/image/!d' -e 's/^.*": "//g' -e 's/".*$//g' $HOME/2_Wunderground_API/Satellite
#for (( i=1; i<=3; i++ ))
#	  do
#          wget -O $HOME/2_Wunderground_API/sat_pic$i.png $(sed -n ${i}p $HOME/2_Wunderground_API/Satellite)
#	  done

#Forecast feature: Forecast
sed -n '/"forecast":{/,/"simpleforecast": {/p' $HOME/2_Wunderground_API/raw_data > $HOME/2_Wunderground_API/Forecast
sed -i -e '/"period":\|icon_url/d' $HOME/2_Wunderground_API/Forecast
sed -i 's/^[ \t]*"//g' $HOME/2_Wunderground_API/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/2_Wunderground_API/Forecast

#Forecast feature: Simple Forecast
sed -n '/"simpleforecast": {/,/"hourly_forecast": \[/p' $HOME/2_Wunderground_API/raw_data > $HOME/2_Wunderground_API/Simple_Forecast
sed -i 's/^[ \t]*"//g' $HOME/2_Wunderground_API/Simple_Forecast
sed -i '/hourly_forecast\|simpleforecast\|forecastday\|{"date"\|period\|icon_url\|^[ \t]*},$\|^[ \t]*}$\|^[ \t]*,$\|^[ \t]*\]$/d' $HOME/2_Wunderground_API/Simple_Forecast
sed -i -e 's/":"/\n/g' -e 's/":/\n/g' -e 's/",$//g' -e 's/,$//g' -e 's/"$//g' $HOME/2_Wunderground_API/Simple_Forecast
sed -i '/^[ \t]*{/d' $HOME/2_Wunderground_API/Simple_Forecast
sed -i -e 's/^[ \t]*"//g' -e 's/^[ \t]*//g' $HOME/2_Wunderground_API/Simple_Forecast
for (( i=2; i<=146; i+=16 ))
    do
        cp $HOME/2_Wunderground_API/Forecast_Images/$(wun_icon_to_png day $(sed -n ${i}p $HOME/2_Wunderground_API/Forecast)).png $HOME/2_Wunderground_API/d$(( 1+(i-2)/16 )).png
        j=$(( i+8 ))
        cp $HOME/2_Wunderground_API/Forecast_Images/$(wun_icon_to_png night $(sed -n ${j}p $HOME/2_Wunderground_API/Forecast)).png $HOME/2_Wunderground_API/n$(( 1+(i-2)/16 )).png
    done

#Forecast feature: Hourly
sed -n '/"hourly_forecast": \[/,/"moon_phase": {/p' $HOME/2_Wunderground_API/raw_data > $HOME/2_Wunderground_API/Hourly
sed -i -e 's/^[ \t]*"//g' -e 's/^[ \t]*//g' $HOME/2_Wunderground_API/Hourly
sed -i '/hourly_forecast\|FCTTIME\|^{$\|^},$\|^}$\|^,$\|^]$\|moon_phase/d' $HOME/2_Wunderground_API/Hourly
sed -i -e 's/": /\n/g' -e 's/","/\n/g' -e 's/", "/\n/g' $HOME/2_Wunderground_API/Hourly
sed -i -e 's/^""//g' -e 's/^"//g' -e 's/^{"//g' -e 's/"},$//g' -e 's/",$//g' $HOME/2_Wunderground_API/Hourly 
sed -i -e 's/^},//g' -e 's/"}$//g' -e 's/^,//g' $HOME/2_Wunderground_API/Hourly
sed -i -e 's/^icon_url.*\/c\/k\///g' -e '/gif/s/_.*$//g' $HOME/2_Wunderground_API/Hourly
sed -i -e '/min_unpadded\|UTCDATE/,+1d' $HOME/2_Wunderground_API/Hourly
for (( i=64; i<=4212; i+=117 ))
    do
		j=$(( i+1 ))
		day_or_night=$(sed -n ${j}p $HOME/2_Wunderground_API/Hourly)
		if [[ $day_or_night == nt ]]; then
			cp $HOME/2_Wunderground_API/Forecast_Images/$(wun_icon_to_png night $(sed -n ${i}p $HOME/2_Wunderground_API/Hourly)).png $HOME/2_Wunderground_API/h$(( 1+(i-64)/117 )).png
		else 
			cp $HOME/2_Wunderground_API/Forecast_Images/$(wun_icon_to_png day $(sed -n ${i}p $HOME/2_Wunderground_API/Hourly)).png $HOME/2_Wunderground_API/h$(( 1+(i-64)/117 )).png
		fi
    done
    
#Forecast feature: Moon_Sun
sed -n '/"moon_phase": {/,/"sun_phase": {/p' $HOME/2_Wunderground_API/raw_data > $HOME/2_Wunderground_API/Moon_Sun
sed -i 's/^[ \t]*"//g' $HOME/2_Wunderground_API/Moon_Sun
sed -i '/moon_phase\|^[ \t]*},$\|sun_phase\|^[ \t]*}$/d' $HOME/2_Wunderground_API/Moon_Sun
sed -i -e 's/":"/\n/g' -e 's/".*$//g' $HOME/2_Wunderground_API/Moon_Sun
moon_phase=$(sed -n 6p $HOME/2_Wunderground_API/Moon_Sun)
if [[ $moon_phase == "Waning Crescent" ]]; then
	cp $HOME/2_Wunderground_API/moonicons/$hemisphere"21.png" $HOME/2_Wunderground_API/Moon_phase.png
elif [[ $moon_phase == "Waxing Crescent" ]]; then
	cp $HOME/2_Wunderground_API/moonicons/$hemisphere"04.png" $HOME/2_Wunderground_API/Moon_phase.png
elif [[ $moon_phase == "Waning Gibbous" ]]; then
	cp $HOME/2_Wunderground_API/moonicons/$hemisphere"17.png" $HOME/2_Wunderground_API/Moon_phase.png
elif [[ $moon_phase == "Waxing Gibbous" ]]; then
	cp $HOME/2_Wunderground_API/moonicons/$hemisphere"09.png" $HOME/2_Wunderground_API/Moon_phase.png
elif [[ $moon_phase == "First Quarter" ]]; then
	cp $HOME/2_Wunderground_API/moonicons/$hemisphere"07.png" $HOME/2_Wunderground_API/Moon_phase.png
elif [[ $moon_phase == "Last Quarter" ]]; then
	cp $HOME/2_Wunderground_API/moonicons/$hemisphere"19.png" $HOME/2_Wunderground_API/Moon_phase.png
elif [[ $moon_phase =~ New.* ]]; then
	cp $HOME/2_Wunderground_API/moonicons/$hemisphere"24.png" $HOME/2_Wunderground_API/Moon_phase.png
elif [[ $moon_phase =~ Full.* ]]; then
	cp $HOME/2_Wunderground_API/moonicons/$hemisphere"13.png" $HOME/2_Wunderground_API/Moon_phase.png
fi

killall -CONT conky

wun.png

== MOD EDIT:  xx'ed out your API key, it's like a password ===

Last edited by Sector11 (2017-06-16 19:34:16)

Offline

#1684 2017-06-16 19:41:17

Sector11
Conky 1.9er Mod Squid
From: Upstairs
Registered: 2015-08-20
Posts: 6,046

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

Lines 141 and 142 comment out these

## killall -STOP conky
## killall wget

and line 232 the last line:

## killall -CONT conky

Do this in any of Teo's scripts "especially if you use more than one script"

if you run the wunderground script and the moon script for example and the moon script runs the "killall -STOP conky" while the wunderground script is doing something with conky OOPS!  See if that fixes your problem.

Meantime I'll compare the two scripts.

I also recommend doing this even if you run one of Teo's scripts and any other conky ... same thing could happen.  And has; to me.


The sun will never set if you keep walking towards it. - my son
Being positive doesn't understand physics.

Offline

#1685 2017-06-16 20:13:36

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

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

lol That's all me Thank-you Sector11... I'll try your advices and give you a feedback as soon as wink

Offline

#1686 2017-06-16 20:39:20

Sector11
Conky 1.9er Mod Squid
From: Upstairs
Registered: 2015-08-20
Posts: 6,046

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

Well then:  Welcome to the OOPS! club  smile

I've posted my key  for various websites on different occasions AND also my email passwords at times in a conky:  The fact is I've had to change my email passwords a few times because it wasn't just once.  mad <-- at the time

That's why today I use:

${execi 90 conkyEmail -t /media/5/Conky/email/S}

so if I post the conky I don't have to edit it.

  $ conkyEmail -h
{snip}
  -t FILE, --template=FILE
                        define a template file to generate output in one call.
                        A displayable item in the file is in the form
                        [--servertype=IMAP --ssl --servername=imap.gmail.com
                        --folder=Inbox --username=joebloggs
                        --password=letmein, --connectiontimeout=10]. Note that
                        the short forms of the options are not currently
                        supported! None of these options are applicable at
                        command line when used in templates.
{snip}

... uesd conkyEmail for years before I discovered that.   roll


The sun will never set if you keep walking towards it. - my son
Being positive doesn't understand physics.

Offline

#1687 2017-06-17 05:46:31

TeoBigusGeekus
BL DieHard
From: /Greece/Kastoria
Registered: 2015-10-04
Posts: 1,226

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

@ragamatrix
I've run your version of the script and it runs flawlessly without any sed error message.
Could you give us some more info on the latter one?
As for the killall commands, they're there to pause conky so that the script has time to update its data before conky updates itself.
If, however, you run more than one conky configurations no one can say for sure which conky will be paused and which one will keep going.
Remove the killall commands if you run more than one conkys.

@S11
I seem to remember something now, though being out of town for the moment I can't find the original script (not very sure I could find it even if I were in town to tell you the truth smile).
I'll try to fix it for you sometime after Monday.
EDIT: I might get access to a linux pc. Can you post the script here? Perhaps I'll find the time to have "a butcher's".

Last edited by TeoBigusGeekus (2017-06-17 07:26:11)


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

#1688 2017-06-17 10:42:47

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

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

Hi Sector11 and Teo;
I post you the terminal message after did what you told me and I still have this sed error and the T° of the last hour not displayed.
Thanks for your help wink

 12:38 raphix > conky -c ~/2_Wunderground_API/conky-wu-htc-v-10-hours                                                        < debian:pts/0:~
conky: desktop window (dc) is root window
conky: window type - override
conky: drawing to created window (0x1c00001)
conky: drawing to double buffer
--2017-06-17 12:38:11--  http://api.wunderground.com/api/xxxxxxxxxx/conditions/forecast10day/astronomy/hourly/satellite/q/Switzerland/horgen.json
Résolution de api.wunderground.com (api.wunderground.com)… sed: -e expression n°1, caractère 4: commande manquante
23.9.140.188
Connexion à api.wunderground.com (api.wunderground.com)|23.9.140.188|:80… connecté.
requête HTTP transmise, en attente de la réponse… 200 OK
Taille : non indiqué [application/json]
Sauvegarde en : « /home/raphix/2_Wunderground_API/raw_data »

/home/raphix/2_Wunderground_API/raw     [ <=>                                                              ]  65.65K  --.-KB/s    in 0.04s   

2017-06-17 12:38:12 (1.81 MB/s) - « /home/raphix/2_Wunderground_API/raw_data » sauvegardé [67222]

Except this little error the updates are correctly working now, after fews hours running. Thanks again for your explanations to resolve the problem. Have a nice sunny week-end  cool

Last edited by ragamatrix (2017-06-17 12:50:26)

Offline

#1689 2017-06-17 13:07:09

ector1935
Member
Registered: 2017-05-03
Posts: 194

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

@ragamatrix
Watch your hourly weather from the whunderground site, as long as you're not in the early hours of Sunday I think the last temperature will not be seen, but maybe I'm wrong

[url=http://i.imgur.com/w7cJzNF.png]
  w7cJzNFl.png
[/url]
edit

Now your conky works for me.
boh

[url=http://i.imgur.com/CcGuK9Y.png]
  CcGuK9Yl.png
[/url]

Last edited by ector1935 (2017-06-17 13:29:47)

Offline

#1690 2017-06-17 13:41:36

TeoBigusGeekus
BL DieHard
From: /Greece/Kastoria
Registered: 2015-10-04
Posts: 1,226

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

@ragamatrix
You had a typo in your conkyrc.
Change this line

${goto 190}${execi 600  sed -n '1108' $HOME/2_Wunderground_API/Hourly}°\

to this

${goto 190}${execi 600  sed -n '1108p' $HOME/2_Wunderground_API/Hourly}°\

Notice the added p after 1108.

Last edited by TeoBigusGeekus (2017-06-17 13:41:59)


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

#1691 2017-06-18 08:52:04

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

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

oh my ... what a shame... thx Teo I must wear my glasses more often...   Now you can enjoy a cleaner conky with few hours forecasting oh la la wink

Offline

#1692 2017-06-18 18:16:01

Sector11
Conky 1.9er Mod Squid
From: Upstairs
Registered: 2015-08-20
Posts: 6,046

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

TeoBigusGeekus wrote:

@S11
I seem to remember something now, though being out of town for the moment I can't find the original script (not very sure I could find it even if I were in town to tell you the truth smile).
I'll try to fix it for you sometime after Monday.
EDIT: I might get access to a linux pc. Can you post the script here? Perhaps I'll find the time to have "a butcher's".

I think you misunderstood ... I was just showing it off and how it, your script, still works because the site has not changed their format.  The spacing thing is on my end of things with the ${goto}s .  big_smile

How ho idea why that happens over time.


The sun will never set if you keep walking towards it. - my son
Being positive doesn't understand physics.

Offline

#1693 2017-06-18 18:24:29

Sector11
Conky 1.9er Mod Squid
From: Upstairs
Registered: 2015-08-20
Posts: 6,046

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

ragamatrix wrote:

oh my ... what a shame... thx Teo I must wear my glasses more often...   Now you can enjoy a cleaner conky with few hours forecasting oh la la wink

I have a student: ragamatrix: "Duc de tpyos"  lol  lol

No offence ragamatrix.  wink


The sun will never set if you keep walking towards it. - my son
Being positive doesn't understand physics.

Offline

#1694 2017-06-18 19:02:48

TeoBigusGeekus
BL DieHard
From: /Greece/Kastoria
Registered: 2015-10-04
Posts: 1,226

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

Sector11 wrote:

I think you misunderstood ... I was just showing it off and how it, your script, still works because the site has not changed their format.  The spacing thing is on my end of things with the ${goto}s .  big_smile

How ho idea why that happens over time.

It still works after 4 years? yikes
I wish Accuweather or Wunderground would do the same...


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

#1695 2017-06-18 21:50:29

Sector11
Conky 1.9er Mod Squid
From: Upstairs
Registered: 2015-08-20
Posts: 6,046

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

TeoBigusGeekus wrote:
Sector11 wrote:

How ho idea why that happens over time.

It still works after 4 years? yikes
I wish Accuweather or Wunderground would do the same...

What am I a Hawaiian?  How ho idea indeed!!!!   lol roll

What I meant to say was: Have no idea why that happens over time.

Yup, still after 4 years ...
shhhhhhhhhhhhhhh {don't tell the chinese}


The sun will never set if you keep walking towards it. - my son
Being positive doesn't understand physics.

Offline

#1696 2017-06-20 17:00:23

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

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

Sector11 wrote:
ragamatrix wrote:

oh my ... what a shame... thx Teo I must wear my glasses more often...   Now you can enjoy a cleaner conky with few hours forecasting oh la la wink

I have a student: ragamatrix: "Duc de tpyos"  lol  lol

No offence ragamatrix.  wink

Of course not ...
harry
And THE Duke (you know him?) :
images.duckduckgo.com.gif

Last edited by ragamatrix (2017-06-20 17:11:01)

Offline

#1697 2017-06-20 21:51:26

Sector11
Conky 1.9er Mod Squid
From: Upstairs
Registered: 2015-08-20
Posts: 6,046

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

lol  lol  lol If you smoke and drive and you're going to toss the butt out the window - make sure the window is OPEN, DUM DUM, scheeeeech!

No have not seen that, must get it, looks funny.  smile


The sun will never set if you keep walking towards it. - my son
Being positive doesn't understand physics.

Offline

#1698 2017-06-21 00:03:14

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

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

mhhh...mhhh... you're right I think there is a "misunderstanding" with translation... sorry I'm french...  big_smile

Last edited by ragamatrix (2017-06-21 00:17:49)

Offline

#1699 2017-06-21 00:10:52

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

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

Sector11 wrote:

lol  lol  lol If you smoke, drink and drive you're going to toss the butt out the window - make sure the window is OPEN, DUM DUM, scheeeeech!

No have not seen that, must get it, looks funny.  smile

Ooh yes ... for me a funny cult, provocative film...

Last edited by ragamatrix (2017-06-21 00:16:53)

Offline

#1700 2017-07-03 12:10:27

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

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

Hello o/
I've tweaked a conky accuweather but strangely I've got some wget-log in my /home folder and I must do a rm wget-log* to clean... I don't know how to fix it a little help please ? wink
acccwzer.th.png
the conky:

conky.config = {
-- work in background (disabled for testing)
background = false,

-- better fonts
use_xft = true,
--xftalpha = 1,

-- update interval
update_interval = 60.0,
total_run_times = 0,

-- window settings
own_window = true,
own_window_transparent = true,
own_window_type = 'desktop',
own_window_hints = 'undecorated, below, sticky, skip_taskbar, skip_pager',
--own_window_argb_visual = true,
--own_window_argb_value = 0,

-- anti-flickering
double_buffer = true,

-- size
minimum_width = 300,
minimum_height = 0,
maximum_width = 300,

 -- shadows
draw_shades = true,
default_shade_color = 'black',

--borders
draw_outline = false,
default_outline_color = 'red',
draw_graph_borders = true,

-- frame
draw_borders = false,

-- color
default_color = 'white',
color0 = '98FB98', --PaleGreen
color1 = '778899', --LightSlateGray
color2 = 'FFD700', --Gold
color3 = 'B0E0E6', --PowderBlue
color4 = 'F4A460', --SandyBrown
color5 = 'DEB887', --BurlyWood
color6 = '00BFFF', --DeepSkyBlue
color7 = '5F9EA0', --CadetBlue
color8 = 'FFA500', --Orange
color9 = 'FF4500', --OrangeRed

-- position
alignment = 'top_right',
gap_x = 15,
gap_y = 15,

-- misc
no_buffers = true,
uppercase = false,
cpu_avg_samples = 2,
if_up_strictness = 'address',

show_graph_range = false,
show_graph_scale = false,
--default_bar_height = 6,
--default_bar_width = 200,
text_buffer_size = 1000,
override_utf8_locale = true,

font = 'Liberation Sans:bold:size=9', --important for shades
template0 = 'Liberation Sans:bold:size=9',
template1 = 'Liberation Mono:bold:size=7',
lua_load = '/home/raphix/.conky/script/draw_bg.lua',
}

conky.text = [[
${execi 900 bash $HOME/1_accuweather/1_accuweather -f2016}\
${execi 900 bash  $HOME/4_Moon/moon}\
${lua conky_draw_bg 10 0 0 0 0 0x000000 0.50} \
${image ~/.conky/HeliumPics/helium06.png -p 66,10 -s 143x108}\
${font Zerotwos:size=55}$alignc${color D4D4D4}${time %H:%M}${color}${font}
${font Shimes One PERSONAL USE:size=80}${color6}${alignc}${time %A}${font}
${font Kenyan Coffee:size=25}${color3}${alignc}${time %e %B}${color}${font}

${alignc}${color5}${execi 600 python /home/raphix/.conky/gmail.py > ~/.gm}${exec tail -n 1 ~/.gm} Mail(s)${color}
${color1}${swapbar 0}${color}
${color5}${alignc}TEMPS
${goto 20}${color3}CPU${color} ${hwmon 0 temp 1}°\
${alignr 20}${color3}SDA${color} ${hddtemp /dev/sda}°
${color1}${swapbar 0}${color}
${alignc}${color5}Intel Core i5-4460  ${color3}Avg${color} ${if_match ${cpu cpu0} < 10}  ${cpu cpu0}\
${else}${if_match ${cpu cpu0} < 100} ${cpu cpu0}\
${else}${color}${cpu cpu0}${color}${endif}${endif}%
${alignc}${color3}CPU     ${color0}%${color}     MHz
${goto 96}${color3}1${color0}     \
${if_match ${cpu cpu1} < 10}  ${cpu cpu1}\
${else}${if_match ${cpu cpu1} < 100} ${cpu cpu1}\
${else}${color9}${cpu cpu1}${color}${endif}${endif}\
${alignr 75}${color}${freq 1}
${goto 96}${color3}2${color0}     \
${if_match ${cpu cpu2} < 10}  ${cpu cpu2}\
${else}${if_match ${cpu cpu2} < 100} ${cpu cpu2}\
${else}${color9}${cpu cpu2}${color}${endif}${endif}\
${alignr 75}${color}${freq 2}
${goto 96}${color3}3${color0}     \
${if_match ${cpu cpu3} < 10}  ${cpu cpu3}\
${else}${if_match ${cpu cpu3} < 100} ${cpu cpu3}\
${else}${color9}${cpu cpu3}${color}${endif}${endif}\
${alignr 75}${color}${freq 3}
${color1}${swapbar 0}${color}
${voffset 5}${color0}${font }TOP CPU ${color8}${font }${alignr 2}TOP RAM
${font }${color0}${top name 1}${top cpu 1} %  ${alignr}${font }${color8}${top_mem name 1}${top_mem mem 1} %
${color lightgrey}${top name 2}${top cpu 2} %       ${alignr}${color lightgrey}${top_mem name 2}${top_mem mem 2} %
${color lightgrey}${top name 3}${top cpu 3} %       ${alignr}${color lightgrey}${top_mem name 3}${top_mem mem 3} %
${color lightgrey}${top name 4}${top cpu 4} %       ${alignr}${color lightgrey}${top_mem name 4}${top_mem mem 4} %
${color1}${swapbar 0}${color}
${alignc}${color3}Memory${color}  Using: ${color3} ${mem} of ${memmax}:${color8} ${memperc}%${color}
${color1}${swapbar 0}${color}
#${stippled_hr 1}

${color lightgrey}${font }hdd1: $alignc ${fs_used /} / ${fs_size /} $alignr ${color8}${fs_used_perc /}%${color}
${fs_bar 3,300 /}
${color lightgrey}${if_mounted /media/stock}hdd stock:$alignc ${fs_used /media/stock} / ${fs_size /media/stock} $alignr ${color8}${fs_used_perc /media/stock}%${color}${endif}
${fs_bar 3,300 /media/stock}
${color lightgrey}${if_mounted /media/share}share:$alignc ${fs_used /media/share} / ${fs_size /media/share} $alignr ${color8}${fs_used_perc /media/share}%${color}${endif}
${fs_bar 3,300 /media/share}
${color1}${swapbar 0}${color}
 S.T.${goto 118}Currently:${alignr}Temp\

${image $HOME/1_accuweather/forecast_2016/forecast_0.png -p 23,580 -s 250x252}\
${font Fira Mono:size=30}±${execi 300 sed -n '3p' ~/1_accuweather/curr_cond}\
${alignr}${execi 300 sed -n '2p' ~/1_accuweather/curr_cond}${font}


 UVI: ${execi 300 sed -n '9p' ~/1_accuweather/curr_cond}/11\
 ${alignr}${execi 300 sed -n '8p' ~/1_accuweather/curr_cond}:Bar


Wind: ${execi 300 sed -n '5p' ~/1_accuweather/curr_cond} ${execi 300 sed -n '6p' ~/1_accuweather/curr_cond}\
 ${alignr}${execi 300 sed -n '7p' ~/1_accuweather/curr_cond} :Hum


 Cld: ${execi 300 sed -n '10p' ~/1_accuweather/curr_cond}\
 ${alignr}${execi 300 sed -n '13p' ~/1_accuweather/curr_cond} :Vis


${image /home/raphix/4_Moon/0.png -p 100,845}
${alignc}${swapbar 0,50} Current Moon & Forecast ${swapbar 0,50}

${color5}${execi 3600 echo `date --date="0 day" | awk '{print $1" "$2}'`}\
${alignr}${execi 3600 echo `date --date="1 day" | awk '{print $1" "$2}'`}${color}
${image $HOME/1_accuweather/forecast_2016/forecast_1.png -p 10,910 -s 45x45}\
${image $HOME/1_accuweather/forecast_2016/forecast_2.png -p 240,910 -s 45x45}\
${if_match "${execpi 300 sed -n '4p' /home/raphix/1_accuweather/first_days}" == "Lo"}\
${else}${execpi 300 sed -n '3p' /home/raphix/1_accuweather/first_days}${endif}\
${alignr 55}${execi 300 sed -n '8p' ~/1_accuweather/first_days}

${goto 60}${if_match "${execpi 300 sed -n '3p' /home/raphix/1_accuweather/first_days}" == "Lo"}\
${execpi 300 sed -n '4p' /home/raphix/1_accuweather/first_days}${endif}\
${alignr}${execi 300 sed -n '9p' ~/1_accuweather/first_days}

${color5}${execi 3600 echo `date --date="2 day" | awk '{print $1" "$2}'`}\
${alignr}${execi 3600 echo `date --date="3 day" | awk '{print $1" "$2}'`}${color}
${image $HOME/1_accuweather/forecast_2016/forecast_3.png -p 10,850 -s 45x45}\
${image $HOME/1_accuweather/forecast_2016/forecast_4.png -p 240,850 -s 45x45}\
${execi 300 sed -n '13p' ~/1_accuweather/first_days}\
${alignr 55}${execi 300 sed -n '18p' ~/1_accuweather/first_days}

${goto 60}${execi 300 sed -n '14p' ~/1_accuweather/first_days}\
${alignr}${execi 300 sed -n '19p' ~/1_accuweather/first_days}

${execi 600 sed -n '05p' $HOME/1_accuweather/hourly1}\
${goto 75}${execi 600 sed -n '09p' $HOME/1_accuweather/hourly1}\
${goto 135}${execi 600 sed -n '13p' $HOME/1_accuweather/hourly1}\
${goto 195}${execi 600 sed -n '17p' $HOME/1_accuweather/hourly1}\
${goto 260}${execi 600 sed -n '05p' $HOME/1_accuweather/hourly2}
${color8}${execi 600 sed -n '08p' $HOME/1_accuweather/first_days}°\
${goto 77}${execi 600 sed -n '30p' $HOME/1_accuweather/hourly1}°\
${goto 137}${execi 600 sed -n '32p' $HOME/1_accuweather/hourly1}°\
${goto 199}${execi 600 sed -n '34p' $HOME/1_accuweather/hourly1}°\
${goto 264}${execi 600 sed -n '36p' $HOME/1_accuweather/hourly2}°
${image $HOME/1_accuweather/hourly_2016/hourly_2.png -p 7,970  -s 45x45}
${image $HOME/1_accuweather/hourly_2016/hourly_4.png -p 77,970 -s 45x45}\
${image $HOME/1_accuweather/hourly_2016/hourly_6.png -p 137,970 -s 45x45}\
${image $HOME/1_accuweather/hourly_2016/hourly_8.png -p 197,970 -s 45x45}\
${image $HOME/1_accuweather/hourly_2016/hourly_10.png -p 262,970 -s 45x45}${color}
${voffset -70}
]]

Offline

Board footer

Powered by FluxBB