You are not logged in.

#4201 2023-02-27 13:47:32

marens
Member
From: World without M$
Registered: 2023-02-02
Posts: 827

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

loutch wrote:

At worst i could remove the hourly part of the conky if we can't solve the problem.

Maybe that is the best solution.

Last attempt
Find this and replace everything until the end of the script:

From @il.harun's script

#############################################################
# HOURLY FORECAST: -h, -h2015 or -h2016 passed as arguments #
#############################################################
#function: convert_time_h
	convert_time_h ()
	{
		hours=$(echo $1|awk -F ":| " '{print $1}')
		am_or_pm=$(echo $1|awk -F ":| " '{print $2}')
		if [[ $am_or_pm == "" ]]; then
			echo $1
			return 0
		elif [[ $am_or_pm == AM ]]; then
			if (( $hours < 10 )); then
				hours_24=0$hours
			fi
			if (( $hours == 10 || $hours == 11 )); then
				hours_24=$hours
			fi
			if (( $hours == 12 )); then
				hours_24=00
			fi
		elif [[ $am_or_pm == PM ]]; then
			if (( $hours != 12 )); then
				hours_24=$((hours+12))
			fi
			if (( $hours == 12 )); then
				hours_24=12
			fi
		fi
		time_24=$hours_24:00
		echo $time_24
	}

if [[ $hourly0 == 1 || $hourly2015 == 1 || $hourly2016 == 1 ]]; then

	#Hourly: 24h

	hourly_addr1="$(echo $address|sed 's/weather-forecast.*$//')"hourly-weather-forecast/"$last_number"
	hourly_addr2="$(echo $address|sed 's/weather-forecast.*$//')"hourly-weather-forecast/"$last_number"?day=2

	curl -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' -H 'Accept-Language: en-US,en;q=0.5' --compressed -H 'Connection: keep-alive' -H 'Upgrade-Insecure-Requests: 1' -H 'Cache-Control: max-age=0' -o $HOME/Accuweather_conky_script/hourly_raw1 "$hourly_addr1"

	curl -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' -H 'Accept-Language: en-US,en;q=0.5' --compressed -H 'Connection: keep-alive' -H 'Upgrade-Insecure-Requests: 1' -H 'Cache-Control: max-age=0' -o $HOME/Accuweather_conky_script/hourly_raw2 "$hourly_addr2"

	if [[ -s $HOME/Accuweather_conky_script/hourly_raw1 && -s $HOME/Accuweather_conky_script/hourly_raw2 ]]; then

		cat $HOME/Accuweather_conky_script/hourly_raw1 $HOME/Accuweather_conky_script/hourly_raw2 > $HOME/Accuweather_conky_script/hourly_raw_temp

	sed '/<div class=\"hourly-wrapper content-module\">/,/day=/!d' $HOME/Accuweather_conky_script/hourly_raw_temp > $HOME/Accuweather_conky_script/hourly



#		#Hourly file
#
	sed -i '/div class=\"label-tooltip\" data-js=/,/-content-container/d' $HOME/Accuweather_conky_script/hourly

#remove spaces and tabs in lines 
#		sed -i -e 's/^[ \|\t]*//g' $HOME/Accuweather_conky_script/hourly

		sed -i '/div class=\"real-feel-mobile/,/<\/div>/d' $HOME/Accuweather_conky_script/hourly
	sed -i '/.*<p>RealFeel/d' $HOME/Accuweather_conky_script/hourly

#Поменять &#xAE;  на  <span class="value">space
		sed -i -e 's/&#xAE;/<span class="value">space/g' $HOME/Accuweather_conky_script/hourly
		# и  к   space присоединить следующую строку(удалив space и \n- новая строка)
		sed -i -z 's/space\n//g' $HOME/Accuweather_conky_script/hourly

		sed -i '/Indoor Humidity\|Air Quality\|RealFeel Shade\|RealFeel Guide\|Ice/d' $HOME/Accuweather_conky_script/hourly

#
	sed -i '/class="date"\|weathericons\/\|temp metric\|RealFeel<span\|"phrase"\|Max UV Index\|Wind\|Wind Gusts\|Humidity\|Dew Point\|Cloud Cover\|Visibility\|Cloud Ceiling/!d' $HOME/Accuweather_conky_script/hourly

##adding empty lines for compatibility with the old config. file
#date
		sed -i -e 's/<\/span><\/h2>/\n--/g' $HOME/Accuweather_conky_script/hourly

		sed -i -e 's/<\/span>.*$//g' -e 's/\.svg.*$//g' -e 's/<\/div>.*$//g' -e 's/<span class="value">/\n/g' $HOME/Accuweather_conky_script/hourly

		sed -i -e 's/.*weathericons\///g' -e 's/^.*>//g' -e 's/&#xB0;.*$//g' -e 's/&#xAE;//g' -e 's/^[ \|\t]*//g' $HOME/Accuweather_conky_script/hourly


		#Populate Max UV and Prec. Amount values where needed
		i=1
		while IFS= read -r line;
			do
				if [[ $(sed -n ${i}p $HOME/Accuweather_conky_script/hourly) == Wind ]]; then
					j=$((i-2))
					if [[ $(sed -n ${j}p $HOME/Accuweather_conky_script/hourly) != 'Max UV Index' ]]; then
						sed -i "${i}s/^/Max UV Index\n0\n/" $HOME/Accuweather_conky_script/hourly
						((i+=3))
					fi
				elif [[ $(sed -n ${i}p $HOME/Accuweather_conky_script/hourly) == Visibility ]]; then
					j=$((i-2))
					if [[ $(sed -n ${j}p $HOME/Accuweather_conky_script/hourly) != 'Rain' && $(sed -n ${j}p $HOME/Accuweather_conky_script/hourly) != 'Snow' ]]; then
						sed -i "${i}s/^/Prec. Amount\n-\n/" $HOME/Accuweather_conky_script/hourly
						((i+=3))
					fi
				fi
			((i+=1))
			done < $HOME/Accuweather_conky_script/hourly

		sed -i '/^$/d' $HOME/Accuweather_conky_script/hourly

##adding empty lines for compatibility with the old config. file 
	sed -i '/Dew Point/i Indoor Hum.\n0' $HOME/Accuweather_conky_script/hourly
	sed -i '/Max UV Index/i precip\n-\nNot' $HOME/Accuweather_conky_script/hourly


		sed -i '/^Further Ahead$/d' $HOME/Accuweather_conky_script/hourly
		sed -i '721,$d' $HOME/Accuweather_conky_script/hourly
		sed -i -e 's/ mph$\| km\/h$//g' -e 's/°.*$//g' $HOME/Accuweather_conky_script/hourly


##### del image hourly
	if [[ $hourly2015 == 1 ]]; then
	  if [[ -f "$HOME/Accuweather_conky_script/hourly_2015/hourly_1.png" ]]; then
		rm $HOME/Accuweather_conky_script/hourly_2015/hourly_*.png
	  fi
	fi
	if [[ $hourly2016 == 1 ]]; then
	  if [[ -f "$HOME/Accuweather_conky_script/hourly_2016/hourly_1.png" ]]; then
		rm $HOME/Accuweather_conky_script/hourly_2016/hourly_*.png
	  fi
	fi


#	# Convert number image hourly  to  Weather font letter. Copy image clouds
		for (( i=3; i<=720; i+=30 ))
		  do
		image=$(sed -n "${i}"p $HOME/Accuweather_conky_script/hourly)
		echo $(test_image $image) >> $HOME/Accuweather_conky_script/hourly
			  sed -i "$(( i+9 ))s/ .*$//" $HOME/Accuweather_conky_script/hourly
			  sed -i "$(( i+17 ))s/ .*$//" $HOME/Accuweather_conky_script/hourly
		  done
		if [[ $hourly0 == 0 ]]; then
			j=1
			for (( i=3; i<=720; i+=30 ))
			  do
		    	if [[ $hourly2015 == 1 ]]; then
					cp $HOME/Accuweather_conky_script/Forecast_Images_2015/$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly).png $HOME/Accuweather_conky_script/hourly_2015/hourly_$j.png
				fi
				if [[ $hourly2016 == 1 ]]; then
					cp $HOME/Accuweather_conky_script/Forecast_Images_2016/$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly).png $HOME/Accuweather_conky_script/hourly_2016/hourly_$j.png
				fi
		    	((j++))
			  done
		fi
	fi

	# Convert times in hourly from am/pm to freedom times
	for (( i=1; i<=720; i+=30 ))
		  do
		   h=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly)
			  sed -i ${i}s/^.*$/$(convert_time_h "$h")/ $HOME/Accuweather_conky_script/hourly
#	# Add times in hourly  :0    ru version
#		  sed -i ${i}s/^.*$/"$h":00/ $HOME/Accuweather_conky_script/hourly
		  done
sleep 0.2
	##convert Wind Direction hourly  to  Wind font letter hourly
		echo 'Font letter wind  hourly ' >> $HOME/Accuweather_conky_script/hourly
			j=1
		for (( i=14; i<=720; i+=30 ))
		  do
		   wind=$(sed -n "${i}"p $HOME/Accuweather_conky_script/hourly | awk '{print $1}')
		   echo $(test_wind $wind) >> $HOME/Accuweather_conky_script/hourly

			((j++))
		  done



##############################################################
	# Full info, next 24h - altogether24 file

#
  if [[ -f $HOME/Accuweather_conky_script/altogether24 ]]; then
#
	rm $HOME/Accuweather_conky_script/altogether24
#
  fi
#
  if [[ -f $HOME/Accuweather_conky_script/altogether24_2015 ]]; then
#
	rm $HOME/Accuweather_conky_script/altogether24_2015
#
  fi
#
  if [[ -f $HOME/Accuweather_conky_script/altogether24_2016 ]]; then
#
	rm $HOME/Accuweather_conky_script/altogether24_2016
#
  fi


	#TIME
	echo "\${color1}TIME\${goto 100}$(sed -n 1p $HOME/Accuweather_conky_script/hourly)" > $HOME/Accuweather_conky_script/altogether24
	jump_to=160
	for (( i=31; i<=360; i+=30 ))
		do
			time=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly)
			sed -i "1s/$/\${goto $jump_to}$time/" $HOME/Accuweather_conky_script/altogether24
			((jump_to+=60))
		done
	if [[ $h_24hours == 1 ]]; then
		for (( i=361; i<=720; i+=30 ))
			do
				time=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly)
				sed -i "1s/$/\${goto $jump_to}$time/" $HOME/Accuweather_conky_script/altogether24
				((jump_to+=60))
			done
	fi

	sed -i '1s/$/\n\n\n/' $HOME/Accuweather_conky_script/altogether24

	#FORECAST
	echo "\${color1}FORECAST\${color}" >> $HOME/Accuweather_conky_script/altogether24
	jump_to=100
	for (( i=7; i<=360; i+=30 ))
		do
			messg=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly|awk '{print $1}'|cut -c1-8)
			sed -i "5s/$/\${goto $jump_to}$messg/" $HOME/Accuweather_conky_script/altogether24
			((jump_to+=60))
		done
	if [[ $h_24hours == 1 ]]; then
		for (( i=367; i<=720; i+=30 ))
			do
				messg=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly|awk '{print $1}'|cut -c1-8)
				sed -i "5s/$/\${goto $jump_to}$messg/" $HOME/Accuweather_conky_script/altogether24
				((jump_to+=60))
			done
	fi
	sed -i '5s/$/\n/' $HOME/Accuweather_conky_script/altogether24
	jump_to=100
	for (( i=7; i<=360; i+=30 ))
		do
			messg=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly|awk '{print $2}'|cut -c1-8)
			sed -i "6s/$/\${goto $jump_to}$messg/" $HOME/Accuweather_conky_script/altogether24
			((jump_to+=60))
		done
	if [[ $h_24hours == 1 ]]; then
		for (( i=367; i<=720; i+=30 ))
			do
				messg=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly|awk '{print $2}'|cut -c1-8)
				sed -i "6s/$/\${goto $jump_to}$messg/" $HOME/Accuweather_conky_script/altogether24
				((jump_to+=60))
			done
	fi

	#TEMPERATURE
	echo "\${color1}\${goto 100}\${hr 1}" >> $HOME/Accuweather_conky_script/altogether24
	echo "TEMPER.\${color}" >> $HOME/Accuweather_conky_script/altogether24
	jump_to=100
	for (( i=4; i<=360; i+=30 ))
		do
			messg=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly)
			sed -i "8s/$/\${goto $jump_to}$messg°/" $HOME/Accuweather_conky_script/altogether24
			((jump_to+=60))
		done
	if [[ $h_24hours == 1 ]]; then
		for (( i=364; i<=720; i+=30 ))
			do
				messg=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly)
				sed -i "8s/$/\${goto $jump_to}$messg°/" $HOME/Accuweather_conky_script/altogether24
				((jump_to+=60))
			done
	fi

	#REAL FEEL
	echo "\${color1}\${goto 100}\${hr 1}" >> $HOME/Accuweather_conky_script/altogether24
	echo "REAL FEEL\${color}" >> $HOME/Accuweather_conky_script/altogether24
	jump_to=100
	for (( i=6; i<=360; i+=30 ))
		do
			messg=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly)
			sed -i "10s/$/\${goto $jump_to}$messg°/" $HOME/Accuweather_conky_script/altogether24
			((jump_to+=60))
		done
	if [[ $h_24hours == 1 ]]; then
		for (( i=366; i<=720; i+=30 ))
			do
				messg=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly)
				sed -i "10s/$/\${goto $jump_to}$messg°/" $HOME/Accuweather_conky_script/altogether24
				((jump_to+=60))
			done
	fi

	#CHANCE OF PRECIPITATION
	echo "\${color1}\${goto 100}\${hr 1}" >> $HOME/Accuweather_conky_script/altogether24
	echo "PRECIP. %\${color}" >> $HOME/Accuweather_conky_script/altogether24
	jump_to=100
	for (( i=9; i<=360; i+=30 ))
		do
			messg=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly)
			sed -i "12s/$/\${goto $jump_to}$messg/" $HOME/Accuweather_conky_script/altogether24
			((jump_to+=60))
		done
	if [[ $h_24hours == 1 ]]; then
		for (( i=369; i<=720; i+=30 ))
			do
				messg=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly)
				sed -i "12s/$/\${goto $jump_to}$messg/" $HOME/Accuweather_conky_script/altogether24
				((jump_to+=60))
			done
	fi

	#MAX UV INDEX
	echo "\${color1}\${goto 100}\${hr 1}" >> $HOME/Accuweather_conky_script/altogether24
	echo "UV INDEX\${color}" >> $HOME/Accuweather_conky_script/altogether24
	jump_to=100
	for (( i=12; i<=360; i+=30 ))
		do
			messg=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly)
			sed -i "14s/$/\${goto $jump_to}$messg/" $HOME/Accuweather_conky_script/altogether24
			((jump_to+=60))
		done
	if [[ $h_24hours == 1 ]]; then
		for (( i=372; i<=720; i+=30 ))
			do
				messg=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly)
				sed -i "14s/$/\${goto $jump_to}$messg/" $HOME/Accuweather_conky_script/altogether24
				((jump_to+=60))
			done
	fi

	#WIND
	echo "\${color1}\${goto 100}\${hr 1}" >> $HOME/Accuweather_conky_script/altogether24
	echo "WIND\${color}" >> $HOME/Accuweather_conky_script/altogether24
	jump_to=100
	for (( i=14; i<=360; i+=30 ))
		do
			messg=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly)
			sed -i "16s/$/\${goto $jump_to}$messg/" $HOME/Accuweather_conky_script/altogether24
			((jump_to+=60))
		done
	if [[ $h_24hours == 1 ]]; then
		for (( i=374; i<=720; i+=30 ))
			do
				messg=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly)
				sed -i "16s/$/\${goto $jump_to}$messg/" $HOME/Accuweather_conky_script/altogether24
				((jump_to+=60))
			done
	fi

	#WIND GUSTS
	echo "\${color1}\${goto 100}\${hr 1}" >> $HOME/Accuweather_conky_script/altogether24
	echo "WIND GUSTS\${color}" >> $HOME/Accuweather_conky_script/altogether24
	jump_to=100
	for (( i=16; i<=360; i+=30 ))
		do
			messg=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly)
			sed -i "18s/$/\${goto $jump_to}$messg/" $HOME/Accuweather_conky_script/altogether24
			((jump_to+=60))
		done
	if [[ $h_24hours == 1 ]]; then
		for (( i=376; i<=720; i+=30 ))
			do
				messg=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly)
				sed -i "18s/$/\${goto $jump_to}$messg/" $HOME/Accuweather_conky_script/altogether24
				((jump_to+=60))
			done
	fi

	#HUMIDITY
	echo "\${color1}\${goto 100}\${hr 1}" >> $HOME/Accuweather_conky_script/altogether24
	echo "HUMIDITY\${color}" >> $HOME/Accuweather_conky_script/altogether24
	jump_to=100
	for (( i=18; i<=360; i+=30 ))
		do
			messg=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly)
			sed -i "20s/$/\${goto $jump_to}$messg/" $HOME/Accuweather_conky_script/altogether24
			((jump_to+=60))
		done
	if [[ $h_24hours == 1 ]]; then
		for (( i=378; i<=720; i+=30 ))
			do
				messg=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly)
				sed -i "20s/$/\${goto $jump_to}$messg/" $HOME/Accuweather_conky_script/altogether24
				((jump_to+=60))
			done
	fi

	#INDOOR HUMIDITY
	echo "\${color1}\${goto 100}\${hr 1}" >> $HOME/Accuweather_conky_script/altogether24
	echo "IND. HUMID.\${color}" >> $HOME/Accuweather_conky_script/altogether24
	jump_to=100
	for (( i=20; i<=360; i+=30 ))
		do
			messg=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly)
			sed -i "22s/$/\${goto $jump_to}$messg/" $HOME/Accuweather_conky_script/altogether24
			((jump_to+=60))
		done
	if [[ $h_24hours == 1 ]]; then
		for (( i=380; i<=720; i+=30 ))
			do
				messg=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly)
				sed -i "22s/$/\${goto $jump_to}$messg/" $HOME/Accuweather_conky_script/altogether24
				((jump_to+=60))
			done
	fi

	#DEW POINT
	echo "\${color1}\${goto 100}\${hr 1}" >> $HOME/Accuweather_conky_script/altogether24
	echo "DEW POINT\${color}" >> $HOME/Accuweather_conky_script/altogether24
	jump_to=100
	for (( i=22; i<=360; i+=30 ))
		do
			messg=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly)
			sed -i "24s/$/\${goto $jump_to}$messg°/" $HOME/Accuweather_conky_script/altogether24
			((jump_to+=60))
		done
	if [[ $h_24hours == 1 ]]; then
		for (( i=382; i<=720; i+=30 ))
			do
				messg=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly)
				sed -i "24s/$/\${goto $jump_to}$messg°/" $HOME/Accuweather_conky_script/altogether24
				((jump_to+=60))
			done
	fi

	#CLOUD COVER
	echo "\${color1}\${goto 100}\${hr 1}" >> $HOME/Accuweather_conky_script/altogether24
	echo "CLOUD CVR\${color}" >> $HOME/Accuweather_conky_script/altogether24
	jump_to=100
	for (( i=24; i<=360; i+=30 ))
		do
			messg=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly)
			sed -i "26s/$/\${goto $jump_to}$messg/" $HOME/Accuweather_conky_script/altogether24
			((jump_to+=60))
		done
	if [[ $h_24hours == 1 ]]; then
		for (( i=384; i<=720; i+=30 ))
			do
				messg=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly)
				sed -i "26s/$/\${goto $jump_to}$messg/" $HOME/Accuweather_conky_script/altogether24
				((jump_to+=60))
			done
	fi

	#PRECIPITATION AMOUNT
	echo "\${color1}\${goto 100}\${hr 1}" >> $HOME/Accuweather_conky_script/altogether24
	echo "PREC. AM.\${color}" >> $HOME/Accuweather_conky_script/altogether24
	jump_to=100
	for (( i=26; i<=360; i+=30 ))
		do
			messg=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly)
			sed -i "28s/$/\${goto $jump_to}$messg/" $HOME/Accuweather_conky_script/altogether24
			((jump_to+=60))
		done
	if [[ $h_24hours == 1 ]]; then
		for (( i=386; i<=720; i+=30 ))
			do
				messg=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly)
				sed -i "28s/$/\${goto $jump_to}$messg/" $HOME/Accuweather_conky_script/altogether24
				((jump_to+=60))
			done
	fi

	#VISIBILITY
	echo "\${color1}\${goto 100}\${hr 1}" >> $HOME/Accuweather_conky_script/altogether24
	echo "VISIBILITY\${color}" >> $HOME/Accuweather_conky_script/altogether24
	jump_to=100
	for (( i=28; i<=360; i+=30 ))
		do
			messg=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly)
			sed -i "30s/$/\${goto $jump_to}$messg/" $HOME/Accuweather_conky_script/altogether24
			((jump_to+=60))
		done
	if [[ $h_24hours == 1 ]]; then
		for (( i=388; i<=720; i+=30 ))
			do
				messg=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly)
				sed -i "30s/$/\${goto $jump_to}$messg/" $HOME/Accuweather_conky_script/altogether24
				((jump_to+=60))
			done
	fi

	#CLOUD CEILING
	echo "\${color1}\${goto 100}\${hr 1}" >> $HOME/Accuweather_conky_script/altogether24
	echo "CLOUD CEIL.\${color}" >> $HOME/Accuweather_conky_script/altogether24
	jump_to=100
	for (( i=30; i<=360; i+=30 ))
		do
			messg=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly)
			sed -i "32s/$/\${goto $jump_to}$messg/" $HOME/Accuweather_conky_script/altogether24
			((jump_to+=60))
		done
	if [[ $h_24hours == 1 ]]; then
		for (( i=390; i<=720; i+=30 ))
			do
				messg=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly)
				sed -i "32s/$/\${goto $jump_to}$messg/" $HOME/Accuweather_conky_script/altogether24
				((jump_to+=60))
			done
	fi

	#IMAGES
	if [[ $hourly0 == 0 ]]; then
		if [[ $hourly2015 == 1 ]]; then
					jump_to=75
					cp $HOME/Accuweather_conky_script/altogether24 $HOME/Accuweather_conky_script/altogether24_2015
		fi
		if [[ $hourly2016 == 1 ]]; then
					jump_to=85
					cp $HOME/Accuweather_conky_script/altogether24 $HOME/Accuweather_conky_script/altogether24_2016
		fi
#  if [[ -f $HOME/Accuweather_conky_script/altogether24 ]]; then
#		rm $HOME/Accuweather_conky_script/altogether24
#  fi
		hours=$((12+$h_24hours*12))
		for (( i=1; i<=$hours; i+=1 ))
			do
				if [[ $hourly2015 == 1 ]]; then
					sed -i "4s/$/\${image \$HOME\/Accuweather_conky_script\/hourly_2015\/hourly_$i.png -s 60x36 -p $jump_to,49}/" $HOME/Accuweather_conky_script/altogether24_2015
				fi
				if [[ $hourly2016 == 1 ]]; then
					sed -i "4s/$/\${image \$HOME\/Accuweather_conky_script\/hourly_2016\/hourly_$i.png -s 36x36 -p $jump_to,49}/" $HOME/Accuweather_conky_script/altogether24_2016
				fi
				((jump_to+=60))
			done
	fi

	#CONKYFONT
	if [[ $hourly0 == 1 ]]; then
		sed -i '4s/$/\${color}\${font conkyweather:size=35}/' $HOME/Accuweather_conky_script/altogether24
		jump_to=95
		for (( i=721; i<=732; i+=1 ))
			do
				sed -i "4s/$/\${goto $jump_to}$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly)/" $HOME/Accuweather_conky_script/altogether24
				((jump_to+=60))
			done
		if [[ $h_24hours == 1 ]]; then
			for (( i=733; i<=744; i+=1 ))
				do
					sed -i "4s/$/\${goto $jump_to}$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly)/" $HOME/Accuweather_conky_script/altogether24
					((jump_to+=60))
				done
		fi
		sed -i '4s/$/\${font}/' $HOME/Accuweather_conky_script/altogether24
		sed -i '2,3d' $HOME/Accuweather_conky_script/altogether24
	fi

	#DELETE UNWANTED VARIABLES
	if [[ $h_real == 0 ]]; then
		if [[ $hourly0 == 1 ]]; then
			sed -i '7,8s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24
		elif [[ $hourly2015 == 1 ]]; then
			sed -i '9,10s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24_2015
		elif [[ $hourly2016 == 1 ]]; then
			sed -i '9,10s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24_2016
		fi
	fi

	if [[ $h_uv == 0 ]]; then
		if [[ $hourly0 == 1 ]]; then
			sed -i '11,12s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24
		elif [[ $hourly2015 == 1 ]]; then
			sed -i '13,14s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24_2015
		elif [[ $hourly2016 == 1 ]]; then
			sed -i '13,14s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24_2016
		fi
	fi

	if [[ $h_wind == 0 ]]; then
		if [[ $hourly0 == 1 ]]; then
			sed -i '13,14s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24
		elif [[ $hourly2015 == 1 ]]; then
			sed -i '15,16s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24_2015
		elif [[ $hourly2016 == 1 ]]; then
			sed -i '15,16s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24_2016
		fi
	fi

	if [[ $h_wind_g == 0 ]]; then
		if [[ $hourly0 == 1 ]]; then
			sed -i '15,16s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24
		elif [[ $hourly2015 == 1 ]]; then
			sed -i '17,18s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24_2015
		elif [[ $hourly2016 == 1 ]]; then
			sed -i '17,18s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24_2016
		fi
	fi


	if [[ $h_hum == 0 ]]; then
		if [[ $hourly0 == 1 ]]; then
			sed -i '17,18s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24
		elif [[ $hourly2015 == 1 ]]; then
			sed -i '19,20s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24_2015
		elif [[ $hourly2016 == 1 ]]; then
			sed -i '19,20s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24_2016
		fi
	fi


	if [[ $h_ind_hum == 0 ]]; then
		if [[ $hourly0 == 1 ]]; then
			sed -i '19,20s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24
		elif [[ $hourly2015 == 1 ]]; then
			sed -i '21,22s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24_2015
		elif [[ $hourly2016 == 1 ]]; then
			sed -i '21,22s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24_2016
		fi
	fi

	if [[ $h_dew == 0 ]]; then
		if [[ $hourly0 == 1 ]]; then
			sed -i '21,22s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24
		elif [[ $hourly2015 == 1 ]]; then
			sed -i '23,24s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24_2015
		elif [[ $hourly2016 == 1 ]]; then
			sed -i '23,24s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24_2016
		fi
	fi

	if [[ $h_cl_cov == 0 ]]; then
		if [[ $hourly0 == 1 ]]; then
			sed -i '23,24s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24
		elif [[ $hourly2015 == 1 ]]; then
			sed -i '25,26s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24_2015
		elif [[ $hourly2016 == 1 ]]; then
			sed -i '25,26s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24_2016
		fi
	fi

	if [[ $h_prec_am == 0 ]]; then
		if [[ $hourly0 == 1 ]]; then
			sed -i '25,26s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24
		elif [[ $hourly2015 == 1 ]]; then
			sed -i '27,28s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24_2015
		elif [[ $hourly2016 == 1 ]]; then
			sed -i '27,28s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24_2016
		fi
	fi

	if [[ $h_visib == 0 ]]; then
		if [[ $hourly0 == 1 ]]; then
			sed -i '27,28s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24
		elif [[ $hourly2015 == 1 ]]; then
			sed -i '29,30s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24_2015
		elif [[ $hourly2016 == 1 ]]; then
			sed -i '29,30s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24_2016
		fi
	fi

	if [[ $h_cl_ceil == 0 ]]; then
		if [[ $hourly0 == 1 ]]; then
			sed -i '29,30s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24
		elif [[ $hourly2015 == 1 ]]; then
			sed -i '31,32s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24_2015
		elif [[ $hourly2016 == 1 ]]; then
			sed -i '31,32s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24_2016
		fi
	fi

  if [[ -f $HOME/Accuweather_conky_script/altogether24 ]]; then
	sed -i '/VOID/d' $HOME/Accuweather_conky_script/altogether24
  fi
  if [[ -f $HOME/Accuweather_conky_script/altogether24_2015 ]]; then
	sed -i '/VOID/d' $HOME/Accuweather_conky_script/altogether24_2015
  fi
  if [[ -f $HOME/Accuweather_conky_script/altogether24_2016 ]]; then
	sed -i '/VOID/d' $HOME/Accuweather_conky_script/altogether24_2016
  fi



fi

sleep 0.5

##################################################################
#del. temp files

#
  if [[ -f $HOME/Accuweather_conky_script/curr_cond_temp ]]; then
#
	rm $HOME/Accuweather_conky_script/curr_cond_temp
#
  fi
#
  if [[ -f $HOME/Accuweather_conky_script/curr_cond_temp1 ]]; then
#
	rm $HOME/Accuweather_conky_script/curr_cond_temp1
#
  fi
#  if [[ -f $HOME/Accuweather_conky_script/curr_cond_control_point1 ]]; then
#	rm $HOME/Accuweather_conky_script/curr_cond_control_point1
#  fi
#  if [[ -f $HOME/Accuweather_conky_script/curr_cond_control_point2 ]]; then
#	rm $HOME/Accuweather_conky_script/curr_cond_control_point2
#  fi

#
  if [[ -f $HOME/Accuweather_conky_script/hourly_raw_temp ]]; then
#
	rm $HOME/Accuweather_conky_script/hourly_raw_temp
#
  fi

###############################################################
#del. raw files

#  if [[ -f $HOME/Accuweather_conky_script/curr_cond_raw ]]; then
#	rm $HOME/Accuweather_conky_script/curr_cond_raw
#  fi
#  if [[ -f $HOME/Accuweather_conky_script/daily_forecast_raw ]]; then
#	rm $HOME/Accuweather_conky_script/daily_forecast_raw
#  fi
#  if [[ -f $HOME/Accuweather_conky_script/hourly_raw1 ]]; then
#	rm $HOME/Accuweather_conky_script/hourly_raw1
#  fi
#  if [[ -f $HOME/Accuweather_conky_script/hourly_raw2 ]]; then
#	rm $HOME/Accuweather_conky_script/hourly_raw2
#  fi
#

##################################################################


#Resume weather conky
pkill -CONT -xf "$weather_conky_launch_command"

Good luck!


If people would know how little brain is ruling the world, they would die of fear.

Offline

#4202 2023-02-27 15:08:19

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

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

Hello

Tanks

radically i asked the conky without the hours just with the -f2015 and there are no more errors in console.

It was radical and I'm a bit sad not to have a complete conky anymore.

it's a shame because at the beginning theo's script was really excellent.

Thanks again for all the help.

conky -c ~/Accuweather_conky_script/didiert2
conky: desktop window (e00052) is subwindow of root window (19d)
conky: window type - normal
conky: drawing to created window (0x4400002)
conky: drawing to double buffer
conky: forked to background, pid is 145108
romuald@RogStrix:~$ 
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 32074  100 32074    0     0  97865      0 --:--:-- --:--:-- --:--:-- 98085
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 34667    0 34667    0     0   132k      0 --:--:-- --:--:-- --:--:--  133k

@+


Linuxmint 22.1 Xia xfce & mageia 9 XFCE on ssd hp pavilion g7
Xubuntu 18.04 lts & 24.04 lts on ASUS Rog STRIX

Offline

#4203 2023-02-27 16:42:59

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

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

Hello

@ unklar

mit meinen bescheidenen Kodierungskenntnissen habe ich versucht, mir ein Skript mit open-meteo.com zu erstellen.

Im Moment habe ich eine Raw-Datei wie folgt


#!/usr/bin/bash

wget -O $HOME/Musique/meteo.json "https://api.open-meteo.com/v1/forecast?latitude=52.52&longitude=13.41&current_weather=true&daily=weathercode,temperature_2m_max,temperature_2m_min,sunrise,sunset,uv_index_max,uv_index_clear_sky_max,windspeed_10m_max,windgusts_10m_max,winddirection_10m_dominant&timezone=Europe%2FBerlin&hourly=temperature_2m,windspeed_10m"

jq --raw-output . $HOME/Musique/meteo.json > $HOME/Musique/rawdata

the rawdata

{
  "latitude": 52.52,
  "longitude": 13.419998,
  "generationtime_ms": 1.309037208557129,
  "utc_offset_seconds": 3600,
  "timezone": "Europe/Berlin",
  "timezone_abbreviation": "CET",
  "elevation": 38,
  "current_weather": {
    "temperature": 4,
    "windspeed": 12.2,
    "winddirection": 47,
    "weathercode": 3,
    "time": "2023-02-27T16:00"
  },
  "hourly_units": {
    "time": "iso8601",
    "temperature_2m": "°C",
    "windspeed_10m": "km/h"
  },
  "hourly": {
    "time": [
      "2023-02-27T00:00",
      "2023-02-27T01:00",
      "2023-02-27T02:00",
      "2023-02-27T03:00",
      "2023-02-27T04:00",
      "2023-02-27T05:00",
      "2023-02-27T06:00",
      "2023-02-27T07:00",
      "2023-02-27T08:00",
      "2023-02-27T09:00",
      "2023-02-27T10:00",
      "2023-02-27T11:00",
      "2023-02-27T12:00",
      "2023-02-27T13:00",
      "2023-02-27T14:00",
      "2023-02-27T15:00",
      "2023-02-27T16:00",
      "2023-02-27T17:00",
      "2023-02-27T18:00",
      "2023-02-27T19:00",
      "2023-02-27T20:00",
      "2023-02-27T21:00",
      "2023-02-27T22:00",
      "2023-02-27T23:00",
      "2023-02-28T00:00",
      "2023-02-28T01:00",
      "2023-02-28T02:00",
      "2023-02-28T03:00",
      "2023-02-28T04:00",
      "2023-02-28T05:00",
      "2023-02-28T06:00",
      "2023-02-28T07:00",
      "2023-02-28T08:00",
      "2023-02-28T09:00",
      "2023-02-28T10:00",
      "2023-02-28T11:00",
      "2023-02-28T12:00",
      "2023-02-28T13:00",
      "2023-02-28T14:00",
      "2023-02-28T15:00",
      "2023-02-28T16:00",
      "2023-02-28T17:00",
      "2023-02-28T18:00",
      "2023-02-28T19:00",
      "2023-02-28T20:00",
      "2023-02-28T21:00",
      "2023-02-28T22:00",
      "2023-02-28T23:00",
      "2023-03-01T00:00",
      "2023-03-01T01:00",
      "2023-03-01T02:00",
      "2023-03-01T03:00",
      "2023-03-01T04:00",
      "2023-03-01T05:00",
      "2023-03-01T06:00",
      "2023-03-01T07:00",
      "2023-03-01T08:00",
      "2023-03-01T09:00",
      "2023-03-01T10:00",
      "2023-03-01T11:00",
      "2023-03-01T12:00",
      "2023-03-01T13:00",
      "2023-03-01T14:00",
      "2023-03-01T15:00",
      "2023-03-01T16:00",
      "2023-03-01T17:00",
      "2023-03-01T18:00",
      "2023-03-01T19:00",
      "2023-03-01T20:00",
      "2023-03-01T21:00",
      "2023-03-01T22:00",
      "2023-03-01T23:00",
      "2023-03-02T00:00",
      "2023-03-02T01:00",
      "2023-03-02T02:00",
      "2023-03-02T03:00",
      "2023-03-02T04:00",
      "2023-03-02T05:00",
      "2023-03-02T06:00",
      "2023-03-02T07:00",
      "2023-03-02T08:00",
      "2023-03-02T09:00",
      "2023-03-02T10:00",
      "2023-03-02T11:00",
      "2023-03-02T12:00",
      "2023-03-02T13:00",
      "2023-03-02T14:00",
      "2023-03-02T15:00",
      "2023-03-02T16:00",
      "2023-03-02T17:00",
      "2023-03-02T18:00",
      "2023-03-02T19:00",
      "2023-03-02T20:00",
      "2023-03-02T21:00",
      "2023-03-02T22:00",
      "2023-03-02T23:00",
      "2023-03-03T00:00",
      "2023-03-03T01:00",
      "2023-03-03T02:00",
      "2023-03-03T03:00",
      "2023-03-03T04:00",
      "2023-03-03T05:00",
      "2023-03-03T06:00",
      "2023-03-03T07:00",
      "2023-03-03T08:00",
      "2023-03-03T09:00",
      "2023-03-03T10:00",
      "2023-03-03T11:00",
      "2023-03-03T12:00",
      "2023-03-03T13:00",
      "2023-03-03T14:00",
      "2023-03-03T15:00",
      "2023-03-03T16:00",
      "2023-03-03T17:00",
      "2023-03-03T18:00",
      "2023-03-03T19:00",
      "2023-03-03T20:00",
      "2023-03-03T21:00",
      "2023-03-03T22:00",
      "2023-03-03T23:00",
      "2023-03-04T00:00",
      "2023-03-04T01:00",
      "2023-03-04T02:00",
      "2023-03-04T03:00",
      "2023-03-04T04:00",
      "2023-03-04T05:00",
      "2023-03-04T06:00",
      "2023-03-04T07:00",
      "2023-03-04T08:00",
      "2023-03-04T09:00",
      "2023-03-04T10:00",
      "2023-03-04T11:00",
      "2023-03-04T12:00",
      "2023-03-04T13:00",
      "2023-03-04T14:00",
      "2023-03-04T15:00",
      "2023-03-04T16:00",
      "2023-03-04T17:00",
      "2023-03-04T18:00",
      "2023-03-04T19:00",
      "2023-03-04T20:00",
      "2023-03-04T21:00",
      "2023-03-04T22:00",
      "2023-03-04T23:00",
      "2023-03-05T00:00",
      "2023-03-05T01:00",
      "2023-03-05T02:00",
      "2023-03-05T03:00",
      "2023-03-05T04:00",
      "2023-03-05T05:00",
      "2023-03-05T06:00",
      "2023-03-05T07:00",
      "2023-03-05T08:00",
      "2023-03-05T09:00",
      "2023-03-05T10:00",
      "2023-03-05T11:00",
      "2023-03-05T12:00",
      "2023-03-05T13:00",
      "2023-03-05T14:00",
      "2023-03-05T15:00",
      "2023-03-05T16:00",
      "2023-03-05T17:00",
      "2023-03-05T18:00",
      "2023-03-05T19:00",
      "2023-03-05T20:00",
      "2023-03-05T21:00",
      "2023-03-05T22:00",
      "2023-03-05T23:00"
    ],
    "temperature_2m": [
      -1.3,
      -1.7,
      -2.1,
      -2.5,
      -2.6,
      -2.7,
      -2.8,
      -2.8,
      -2.6,
      -2,
      -0.8,
      1.4,
      2.6,
      3.6,
      4.1,
      4.1,
      4,
      3.5,
      2.4,
      1.4,
      0.8,
      0.6,
      0.4,
      0.2,
      0.1,
      -0.3,
      -0.5,
      -0.7,
      -0.9,
      -1,
      -1.2,
      -1.5,
      -1.6,
      -0.8,
      0.7,
      1.9,
      3,
      3.7,
      4.5,
      4.6,
      4.4,
      3.7,
      2.3,
      1.2,
      0.7,
      0.6,
      0.2,
      -0.1,
      -0.3,
      -0.5,
      -0.6,
      -0.8,
      -0.9,
      -1.2,
      -1.4,
      -1.5,
      -1.5,
      -0.8,
      1,
      2.4,
      3.5,
      4.6,
      5.4,
      6,
      6.1,
      5.7,
      4.3,
      3,
      2,
      1.3,
      0.9,
      0.6,
      0.3,
      0.1,
      -0.1,
      -0.2,
      -0.1,
      0.1,
      0.2,
      0.4,
      0.5,
      1,
      1.7,
      2.5,
      3.6,
      4.3,
      4.7,
      5.6,
      5.2,
      4.9,
      4.4,
      3.9,
      3.4,
      3,
      2.5,
      2.3,
      2.2,
      2,
      1.6,
      1.1,
      0.6,
      0.2,
      -0.1,
      -0.3,
      -0.1,
      0.3,
      1,
      1.8,
      2.8,
      4,
      4.8,
      5.4,
      5.8,
      5.4,
      4.6,
      3.6,
      2.9,
      2.2,
      1.4,
      1,
      0.8,
      0.5,
      0.2,
      -0.1,
      -0.5,
      -0.8,
      -1.2,
      -1.3,
      -0.7,
      0.1,
      1.3,
      2.1,
      2.8,
      3.6,
      3.8,
      4,
      4.2,
      4.2,
      4.1,
      3.8,
      3.1,
      2.2,
      1.2,
      0.8,
      0.5,
      0.2,
      -0,
      -0.3,
      -0.5,
      -0.7,
      -0.8,
      -0.6,
      -0.1,
      0.7,
      1.9,
      3,
      4.2,
      5.5,
      6.1,
      6.4,
      6.3,
      5.5,
      4.3,
      2.9,
      2.4,
      2.1,
      1.8,
      1.6
    ],
    "windspeed_10m": [
      5.6,
      5,
      5.1,
      5.6,
      5.9,
      5.3,
      4.2,
      4.5,
      5,
      5.1,
      4.8,
      9.4,
      9,
      7.5,
      11,
      7.5,
      12.2,
      8.8,
      6.4,
      4.6,
      5.4,
      4.3,
      4.5,
      2.6,
      3.2,
      3.7,
      3.3,
      3.3,
      3.6,
      3.3,
      3.4,
      3.4,
      3.4,
      3.6,
      4.3,
      4.3,
      5.4,
      6.8,
      7,
      6.9,
      7.4,
      6.6,
      4.9,
      4.8,
      4.3,
      3.1,
      3.1,
      3.2,
      2.7,
      2.6,
      2.2,
      2.2,
      2.5,
      1.5,
      2.5,
      2.2,
      1.8,
      1.6,
      1.9,
      2.2,
      1.3,
      2,
      4.1,
      5.7,
      5.7,
      4.7,
      4.3,
      4.3,
      5.1,
      5.6,
      5.7,
      5.4,
      5,
      4.4,
      5.1,
      4.5,
      4.7,
      4.7,
      4.3,
      3.8,
      4.2,
      4.5,
      4.3,
      5.1,
      8.9,
      9,
      8.1,
      8.7,
      7.9,
      5.6,
      4.5,
      4.6,
      4,
      3.7,
      3.4,
      3.3,
      3.4,
      3.4,
      3.8,
      4.4,
      5.1,
      5.8,
      6.5,
      7.6,
      9,
      10.8,
      12.9,
      13.4,
      13.7,
      13.8,
      12.8,
      10.7,
      8.7,
      8.4,
      8.9,
      9.5,
      9.3,
      8.5,
      7.9,
      7.4,
      7,
      6.5,
      6.4,
      6.5,
      7,
      7.1,
      6.6,
      6.8,
      7.6,
      8.8,
      10.7,
      12.3,
      13.9,
      15.5,
      16.2,
      16.3,
      16.4,
      15.6,
      14.2,
      13.4,
      14.7,
      16.6,
      18.6,
      18.1,
      16.6,
      14.8,
      14.2,
      13.7,
      13.4,
      13.2,
      13.2,
      13.2,
      13.1,
      13,
      13.1,
      13.9,
      14.8,
      16.4,
      17.1,
      17.4,
      16.7,
      14.5,
      11.4,
      8.4,
      7.6,
      7.3,
      7.8,
      9
    ]
  },
  "daily_units": {
    "time": "iso8601",
    "weathercode": "wmo code",
    "temperature_2m_max": "°C",
    "temperature_2m_min": "°C",
    "sunrise": "iso8601",
    "sunset": "iso8601",
    "uv_index_max": "",
    "uv_index_clear_sky_max": "",
    "windspeed_10m_max": "km/h",
    "windgusts_10m_max": "km/h",
    "winddirection_10m_dominant": "°"
  },
  "daily": {
    "time": [
      "2023-02-27",
      "2023-02-28",
      "2023-03-01",
      "2023-03-02",
      "2023-03-03",
      "2023-03-04",
      "2023-03-05"
    ],
    "weathercode": [
      3,
      1,
      3,
      3,
      3,
      61,
      3
    ],
    "temperature_2m_max": [
      4.1,
      4.6,
      6.1,
      5.6,
      5.8,
      4.2,
      6.4
    ],
    "temperature_2m_min": [
      -2.8,
      -1.6,
      -1.5,
      -0.2,
      -0.3,
      -1.3,
      -0.8
    ],
    "sunrise": [
      "2023-02-27T06:55",
      "2023-02-28T06:53",
      "2023-03-01T06:51",
      "2023-03-02T06:49",
      "2023-03-03T06:46",
      "2023-03-04T06:44",
      "2023-03-05T06:42"
    ],
    "sunset": [
      "2023-02-27T17:42",
      "2023-02-28T17:44",
      "2023-03-01T17:46",
      "2023-03-02T17:48",
      "2023-03-03T17:49",
      "2023-03-04T17:51",
      "2023-03-05T17:53"
    ],
    "uv_index_max": [
      2.7,
      2.95,
      2.9,
      2.95,
      2.75,
      1.75,
      1.8
    ],
    "uv_index_clear_sky_max": [
      2.85,
      2.95,
      2.9,
      2.95,
      2.95,
      2.9,
      2.9
    ],
    "windspeed_10m_max": [
      12.2,
      7.4,
      5.7,
      9,
      13.8,
      18.6,
      17.4
    ],
    "windgusts_10m_max": [
      29.2,
      18,
      15.1,
      22.7,
      36.4,
      49.3,
      39.6
    ],
    "winddirection_10m_dominant": [
      27,
      57,
      36,
      48,
      300,
      293,
      293
    ]
  }
}

conkyrc

${execi 3600 bash $HOME/Musique/meteo.sh}

Température: ${execi 3600 cat $HOME/Musique/rawdata | jq --raw-output '.current_weather.temperature' | awk '{printf("%d\n",$1)}'} °C 
Wind speed:  ${execi 3600 cat $HOME/Musique/rawdata | jq --raw-output '.current_weather.windspeed'   | awk '{printf("%d\n",$1)}'} km/h
Wind speed:  ${execi 3600 cat $HOME/Musique/rawdata | jq --raw-output '.current_weather.winddirection'} 

hourly

hours ${execi 3600 cat $HOME/Musique/rawdata | jq --raw-output '.hourly.time'[12] | cut -c12-16}
temperature ${execi 3600 cat $HOME/Musique/rawdata | jq --raw-output '.hourly.temperature_2m'[12]} °C


daily

date ${execi 3600 cat $HOME/Musique/rawdata | jq --raw-output '.daily.time'[0]}
temperature mini ${execi 3600 cat $HOME/Musique/rawdata | jq --raw-output '.daily.temperature_2m_min'[0] | awk '{printf("%d\n",$1)}'}
température max  ${execi 3600 cat $HOME/Musique/rawdata | jq --raw-output '.daily.temperature_2m_max'[0] | awk '{printf("%d\n",$1)}'}
sunrise ${execi 3600 cat $HOME/Musique/rawdata | jq --raw-output '.daily.sunrise'[0] | cut -c12-16}
sunset ${execi 3600 cat $HOME/Musique/rawdata | jq --raw-output '.daily.sunset'[0] | cut -c12-16}
]]

done this

Capture-d-cran-2023-02-27-17-39-16.png

Ich bin mir sicher, dass ein paar Conky-Großmeister eine Top-Version erstellen könnten.




with my humble level of coding I tried to make a script with open-meteo.com .

For the moment I have a raw file like this

I'm sure some of the great conky masters could make a top notch one

@+

Last edited by loutch (2023-02-27 16:43:39)


Linuxmint 22.1 Xia xfce & mageia 9 XFCE on ssd hp pavilion g7
Xubuntu 18.04 lts & 24.04 lts on ASUS Rog STRIX

Offline

#4204 2023-02-27 17:07:21

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 2,640

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

2d9Kzag.png

@loutch,
A ma grande honte, je dois avouer que j'ai passé tout mon temps avec ce Conky écrit entièrement en lua.

NtWFo5ot.png
Sorry, the link

Il y a encore des obstacles avec des paquets que lua demande. Je vous demande d'être patient  wink

To my shame I have to confess, I spent the whole time with this conky written completely in lua.
There are still obstacles with package(s) that lua asks for.

Last edited by unklar (2023-02-27 18:01:57)

Offline

#4205 2023-02-27 17:09:51

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 2,640

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

Sector11 wrote:
unklar wrote:

@loutch,

There is a workaround for this wink 
There is a European provider that does this for free and without an API registration. We don't need the Americans anymore.
If I 'copy' enough, I should be able to get it there. Actually, I'm hoping for more accurate data because openweather to my location is always 'miles' off.

Oh super!
Ce sera intéressant à voir.
Aller d'abord au petit-déjeuner.
Oh gut!
Das wird interessant zu sehen sein.
Erstmal frühstücken gehen.
Oh good!
This will be interesting to see.
Going for breakfast first.

dsfgo1o.png dsfgo1o.png dsfgo1o.png

I haven't started yet...  3BBZ8Fk.png


open-meteo.com I discovered only yesterday through the app 'omWeather' for my smartphone on FDroid.
Since @loutch was looking for something again, I thought this would be something for him. I myself have only glanced over the page and, that now @loutch is so fast, I have also not considered.   wink

Last edited by unklar (2023-02-27 18:03:20)

Offline

#4206 2023-02-27 18:43:25

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 2,640

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

@loutch,

Tu es le meilleur !  wink

Je trouve les icônes météo en partant d'ici
ici
ici,ici et ici.

Demain, nous continuerons...

Offline

#4207 2023-02-27 19:34:25

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

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

Re

Ich habe auch das Windicon integriert und die Gradzahl in Richtung geändert.

Ich konnte die aktuellen Wetterbedingungen , pression ect  nicht finden.

#!/usr/bin/bash

wget -O $HOME/Musique/meteo.json "https://api.open-meteo.com/v1/forecast?latitude=52.52&longitude=13.41&current_weather=true&daily=weathercode,temperature_2m_max,temperature_2m_min,sunrise,sunset,uv_index_max,windspeed_10m_max,windgusts_10m_max,winddirection_10m_dominant&timezone=Europe%2FBerlin"

jq --raw-output . $HOME/Musique/meteo.json > $HOME/Musique/rawdatameteo

wget -O $HOME/Musique/hourly.json "https://api.open-meteo.com/v1/forecast?latitude=52.52&longitude=13.41&hourly=temperature_2m,windspeed_10m"

jq --raw-output . $HOME/Musique/hourly.json > $HOME/Musique/rawdatahourly

wind_dir=$(jq --raw-output '.currently_weather.winddirection' $HOME/Musique/rawdatameteo)
if [[ $wind_dir -lt 12 ]]; then
echo "N" >> $HOME/Musique/direction
elif [[ $wind_dir -lt 33 ]]&&[[ $wind_dir -ge 12 ]]; then
echo "NNE" >> $HOME/Musique/direction
elif [[ $wind_dir -lt 55 ]]&&[[ $wind_dir -ge 33 ]]; then
echo "NE" >> $HOME/Musique/direction
elif [[ $wind_dir -lt 78 ]]&&[[ $wind_dir -ge 55 ]]; then
echo "ENE" >> $HOME/Musique/direction
elif [[ $wind_dir -lt 101 ]]&&[[ $wind_dir -ge 78 ]]; then
echo "E" >> $HOME/Musique/direction
elif [[ $wind_dir -lt 123 ]]&&[[ $wind_dir -ge 101 ]]; then
echo "ESE" >> $HOME/Musique/direction
elif [[ $wind_dir -lt 146 ]]&&[[ $wind_dir -ge 123 ]]; then
echo "SE" >> $HOME/Musique/direction
elif [[ $wind_dir -lt 168 ]]&&[[ $wind_dir -ge 146 ]]; then
echo "SSE" >> $HOME/Musique/direction
elif [[ $wind_dir -lt 191 ]]&&[[ $wind_dir -ge 168 ]]; then
echo "S" >> $HOME/Musique/direction
elif [[ $wind_dir -lt 213 ]]&&[[ $wind_dir -ge 191 ]]; then
echo "SSO" >> $HOME/Musique/direction
elif [[ $wind_dir -lt 236 ]]&&[[ $wind_dir -ge 213 ]]; then
echo "SO" >> $HOME/Musique/direction
elif [[ $wind_dir -lt 258 ]]&&[[ $wind_dir -ge 236 ]]; then
echo "OSO" >> $HOME/Musique/direction
elif [[ $wind_dir -lt 281 ]]&&[[ $wind_dir -ge 258 ]]; then
echo "O" >> $HOME/Musique/direction
elif [[ $wind_dir -lt 303 ]]&&[[ $wind_dir -ge 281 ]]; then
echo "ONO" >> $HOME/Musique/direction
elif [[ $wind_dir -lt 326 ]]&&[[ $wind_dir -ge 303 ]]; then
echo "NO" >> $HOME/Musique/direction
elif [[ $wind_dir -lt 348 ]]&&[[ $wind_dir -ge 326 ]]; then
echo "NNO" >> $HOME/Musique/direction
elif [[ $wind_dir -ge 348 ]]; then
echo "N" >> $HOME/Musique/direction
fi

wind_direction=$(sed -n 1p $HOME/Musique/direction)

if [[ $wind_direction == "S" ]]; then
	cp $HOME/conky-meteo-dark_sky/vent/"02.png" $HOME/MUsique/Wind1.png
elif [[ $wind_direction == "South" ]]; then
	cp $HOME/conky-meteo-dark_sky/vent/"02.png" $HOME/Musique/Wind1.png
elif [[ $wind_direction == "SSO" ]]; then
	cp $HOME/conky-meteo-dark_sky/vent/"03.png" $HOME/MusiqueW/ind1.png
elif [[ $wind_direction == "SO" ]]; then
	cp $HOME/conky-meteo-dark_sky/vent/"04.png" $HOME/Musique/Wind1.png
elif [[ $wind_direction == "OSO" ]]; then
	cp $HOME/conky-meteo-dark_sky/vent/"05.png" $HOME/Musique/Wind1.png
elif [[ $wind_direction == "O" ]]; then
	cp $HOME/conky-meteo-dark_sky/vent/"06.png" $HOME/Musique/Wind1.png
elif [[ $wind_direction == "West" ]]; then
	cp $HOME/conky-meteo-dark_sky/vent/"06.png" $HOME/Musique/Wind1.png
elif [[ $wind_direction == "ONO" ]]; then
	cp $HOME/conky-meteo-dark_sky/vent/"07.png" $HOME/Musique/Wind1.png
elif [[ $wind_direction == "NO" ]]; then
	cp $HOME/conky-meteo-dark_sky/vent/"08.png" $HOME/Musique/Wind1.png
elif [[ $wind_direction == "NNO" ]]; then
	cp $HOME/conky-meteo-dark_sky/vent/"09.png" $HOME/Musique/Wind1.png
elif [[ $wind_direction == "N" ]]; then
	cp $HOME/conky-meteo-dark_sky/vent/"10.png" $HOME/Musique/Wind1.png
elif [[ $wind_direction == "North" ]]; then
	cp $HOME/conky-meteo-dark_sky/vent/"10.png" $HOME/Musique/Wind1.png
elif [[ $wind_direction == "NNE" ]]; then
	cp $HOME/conky-meteo-dark_sky/vent/"11.png" $HOME/Musique/Wind1.png
elif [[ $wind_direction == "NE" ]]; then
	cp $HOME/conky-meteo-dark_sky/vent/"12.png" $HOME/Musique/Wind1.png
elif [[ $wind_direction == "ENE" ]]; then
	cp $HOME/conky-meteo-dark_sky/vent/"13.png" $HOME/Musique/Wind1.png
elif [[ $wind_direction == "E" ]]; then
	cp $HOME/conky-meteo-dark_sky/vent/"14.png" $HOME/Musique/Wind1.png
elif [[ $wind_direction == "East" ]]; then
	cp $HOME/conky-meteo-dark_sky/vent/"14.png" $HOME/Musique/Wind1.png
elif [[ $wind_direction == "ESE" ]]; then
	cp $HOME/conky-meteo-dark_sky/vent/"15.png" $HOME/Musique/Wind1.png
elif [[ $wind_direction == "SE" ]]; then
	cp $HOME/conky-meteo-dark_sky/vent/"16.png" $HOME/Musique/Wind1.png
elif [[ $wind_direction == "SSE" ]]; then
	cp $HOME/conky-meteo-dark_sky/vent/"17.png" $HOME/Musique/Wind1.png
elif [[ $wind_direction == "Variable" ]]; then
	cp $HOME/conky-meteo-dark_sky/vent/"00.png" $HOME/Musique/Wind1.png
fi

Capture-d-cran-2023-02-27-20-30-56.png

Capture-d-cran-2023-02-27-21-28-39.png

I also integrated the wind icon and changed the degrees in direction.
I couldn't find the current weather conditions, pression,ect

@+

Last edited by loutch (2023-02-27 20:29:30)


Linuxmint 22.1 Xia xfce & mageia 9 XFCE on ssd hp pavilion g7
Xubuntu 18.04 lts & 24.04 lts on ASUS Rog STRIX

Offline

#4208 2023-02-27 19:59:51

marens
Member
From: World without M$
Registered: 2023-02-02
Posts: 827

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

@loutch

I successfully tested your Accuweather_conky_script/temp/hourly file.
If the hourly file works properly,everything will be fine.

In Accuweather_conky_script I created a new folder loutch_hourly_images.

In Accuweather_conky_script I created a loutch_hourly_images.sh script:

#!/bin/bash

rm $HOME/Accuweather_conky_script/loutch_hourly_images/hourly_1.png
rm $HOME/Accuweather_conky_script/loutch_hourly_images/hourly_2.png
rm $HOME/Accuweather_conky_script/loutch_hourly_images/hourly_3.png
rm $HOME/Accuweather_conky_script/loutch_hourly_images/hourly_4.png
rm $HOME/Accuweather_conky_script/loutch_hourly_images/hourly_5.png
rm $HOME/Accuweather_conky_script/loutch_hourly_images/hourly_6.png
rm $HOME/Accuweather_conky_script/loutch_hourly_images/hourly_7.png
rm $HOME/Accuweather_conky_script/loutch_hourly_images/hourly_8.png

hourly_1=$(sed -n '3p' $HOME/Accuweather_conky_script/temp/hourly)
hourly_2=$(sed -n '13p' $HOME/Accuweather_conky_script/temp/hourly)
hourly_3=$(sed -n '23p' $HOME/Accuweather_conky_script/temp/hourly)
hourly_4=$(sed -n '33p' $HOME/Accuweather_conky_script/temp/hourly)
hourly_5=$(sed -n '43p' $HOME/Accuweather_conky_script/temp/hourly)
hourly_6=$(sed -n '53p' $HOME/Accuweather_conky_script/temp/hourly)
hourly_7=$(sed -n '63p' $HOME/Accuweather_conky_script/temp/hourly)
hourly_8=$(sed -n '73p' $HOME/Accuweather_conky_script/temp/hourly)

cp $HOME/Accuweather_conky_script/Forecast_Images_2015/"$hourly_1".png $HOME/Accuweather_conky_script/loutch_hourly_images/hourly_1.png
cp $HOME/Accuweather_conky_script/Forecast_Images_2015/"$hourly_2".png $HOME/Accuweather_conky_script/loutch_hourly_images/hourly_2.png
cp $HOME/Accuweather_conky_script/Forecast_Images_2015/"$hourly_3".png $HOME/Accuweather_conky_script/loutch_hourly_images/hourly_3.png
cp $HOME/Accuweather_conky_script/Forecast_Images_2015/"$hourly_4".png $HOME/Accuweather_conky_script/loutch_hourly_images/hourly_4.png
cp $HOME/Accuweather_conky_script/Forecast_Images_2015/"$hourly_5".png $HOME/Accuweather_conky_script/loutch_hourly_images/hourly_5.png
cp $HOME/Accuweather_conky_script/Forecast_Images_2015/"$hourly_6".png $HOME/Accuweather_conky_script/loutch_hourly_images/hourly_6.png
cp $HOME/Accuweather_conky_script/Forecast_Images_2015/"$hourly_7".png $HOME/Accuweather_conky_script/loutch_hourly_images/hourly_7.png
cp $HOME/Accuweather_conky_script/Forecast_Images_2015/"$hourly_8".png $HOME/Accuweather_conky_script/loutch_hourly_images/hourly_8.png

Open loutch_hourly_images.sh file.
Copy/Paste and Save.

Open Accuweather_conky_script folder.
Right click on loutch_hourly_images.sh > Properties > Permissions
Allow executing file as program.

Test from terminal:

bash $HOME/Accuweather_conky_script/loutch_hourly_images.sh

The first time an error will appear (rm command will not find anything).
Just run terminal again.

Now check new loutch_hourly_images folder.

If OK,add in conky first line:

${texeci 500 bash $HOME/Accuweather_conky_script/loutch_hourly_images.sh}

Now images hourly_1.png,hourly_2.png... will be in loutch_hourly_images folder.

Edit: added @loutch at the beginning of the post

Last edited by marens (2023-02-27 20:43:22)


If people would know how little brain is ruling the world, they would die of fear.

Offline

#4209 2023-02-27 21:03:11

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

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

Hello

@ marens

Many tanks , works great just same errors in console but the right icons are in conky.

you are also a great conkystador master .

@+

edit

i commant this lines

#if [[ $hourly2015 == 1 ]]; then
			#cp $HOME/Accuweather_conky_script_fr/Forecast_Images_2015/$(sed -n ${i}p $HOME/Accuweather_conky_script_fr/temp/hourly).png $HOME/Accuweather_conky_script_fr/temp/images_hourly/hourly_$j.png
			#fi
	

& now no errors in conky

conky -c ~/Accuweather_conky_script/didiert2
conky: desktop window (e00052) is subwindow of root window (19d)
conky: window type - normal
conky: drawing to created window (0x5800002)
conky: drawing to double buffer
conky: forked to background, pid is 387971
romuald@RogStrix:~$ 
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 28389  100 28389    0     0  87492      0 --:--:-- --:--:-- --:--:-- 87620
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
    00          00    8 9 005 0        0    0   -0- : - - : -0-   - - : - -0: - -   - - :0- --:--:--- :8-9-0 1-0-
:--:-- --:--:--     0  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 34414    0 34414    0     0   112k      0 --:--:-- --:--:-- --:--:--  113k
100 29505  100 29505    0     0  84262      0 --:--:-- --:--:-- --:--:-- 84059
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 27319  100 27319    0     0  96746      0 --:--:-- --:--:-- --:--:-- 96875
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 28390  100 28390    0     0  99770      0 --:--:-- --:--:-- --:--:-- 99614

Last edited by loutch (2023-02-27 21:08:40)


Linuxmint 22.1 Xia xfce & mageia 9 XFCE on ssd hp pavilion g7
Xubuntu 18.04 lts & 24.04 lts on ASUS Rog STRIX

Offline

#4210 2023-02-27 23:35:15

marens
Member
From: World without M$
Registered: 2023-02-02
Posts: 827

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

loutch wrote:

@ marens
Many tanks , works great just same errors in console but the right icons are in conky.
you are also a great conkystador master.

Thanks.
No, I'm not a conky expert.
I just tested your temp/hourly file and found a way to get the properly images.
I don't have that file and I don't use hourly weather,but i made it.

loutch wrote:

i commant this lines

Yes,if works that's it.

When your temp/hourly file works properly,everything should be OK.

Now,just wait new changes from accuweather developers.
When that happens,only @TeoBigusGeekus and @il.harun can help us.
I can try.


If people would know how little brain is ruling the world, they would die of fear.

Offline

#4211 2023-03-04 00:08:17

marens
Member
From: World without M$
Registered: 2023-02-02
Posts: 827

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

Accuweather Forecast_images_2015 are very nice.
But I don't like 30.png(hot) and 31.png(cold).

I replaced them last(very hot) year.
After a google search i found the usual thermometer image.
With inkscape and mtPaint I edited them in the same format with an angle of 22.5°.

Now they look like this:
https://imgur.com/a/yD8D6Q6

If you like it:

In Forecast_images_2015 folder:
Rename 30.png to 30_old.png.
Rename 31.png to 31_old.png.

Add new 30.png and 31.png images.

Testing
Example:
Daily forecast for Monday is cloudy.
Cloudy image: 7.png.
Rename 7.png to 7_old.png.
Copy/Paste new 30.png image,and rename to 7.png.

Restart conky.
Check Monday forecast image.

After testing,just delete 7.png image,and rename 7_old.png to 7.png.
Restart conky.


If people would know how little brain is ruling the world, they would die of fear.

Offline

#4212 2023-03-04 08:50:37

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 2,640

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

Here is no picture on imgur.
If you don't use BL, then you should follow the following pattern (common here):

the code at imgur: yD8D6Q6 

yD8D6Q6t.png

  [url=https://i.imgur.com/yD8D6Q6.png][img]https://i.imgur.com/yD8D6Q6t.png[/img][/url]
  

Last edited by unklar (2023-03-04 09:02:29)

Offline

#4213 2023-03-04 13:57:22

marens
Member
From: World without M$
Registered: 2023-02-02
Posts: 827

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

@unklar

Sorry.
It works in my browser.

PostImages:

30.png
31.png


If people would know how little brain is ruling the world, they would die of fear.

Offline

#4214 2023-03-05 15:09:21

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 2,640

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

marens wrote:

Thanks!  wink

Offline

#4215 2023-03-08 08:34:02

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

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

Hello

My latest accuweather conky


Capture-d-cran-2023-03-08-09-32-54.png


Work great for the moment .


@+


Linuxmint 22.1 Xia xfce & mageia 9 XFCE on ssd hp pavilion g7
Xubuntu 18.04 lts & 24.04 lts on ASUS Rog STRIX

Offline

#4216 2023-03-08 14:31:02

marens
Member
From: World without M$
Registered: 2023-02-02
Posts: 827

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

loutch wrote:

Hello

My latest accuweather conky


https://i.postimg.cc/3NPdcZbx/Capture-d-cran-2023-03-08-09-32-54.png


Work great for the moment .


@+

NICE conky and icons.

These are my working versions:
weather.png
weather-moon.png


If people would know how little brain is ruling the world, they would die of fear.

Offline

#4217 2023-03-08 16:17:30

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

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

Hello


super.png


@+


Linuxmint 22.1 Xia xfce & mageia 9 XFCE on ssd hp pavilion g7
Xubuntu 18.04 lts & 24.04 lts on ASUS Rog STRIX

Offline

#4218 2023-03-10 23:22:32

marens
Member
From: World without M$
Registered: 2023-02-02
Posts: 827

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

AccuWeather - All in one line

If the display is not large or you want a compact conky, the best solution is the scroll command.

From Conky Objects
https://conky.sourceforge.net/variables.html

scroll length (step) text

"Scroll 'text' by 'step' characters showing 'length' number of characters at the same time. The text may also contain variables. ..."

Example

From my old AccuWeather Compact Conky
Humidity,Pressure,UV Index,Cloud Cover,Dew Point,Visibility and Source - All in one line

Note: increase text_buffer_size in config to 3328 or more

My Colors:
default_color FF8080
color1 0098FF
color2 FEDF08
color3 00AD00
color4 0040FF
color5 orange
color6 magenta
color7 FF6060

All in one line - Scroll Section

${font Ubuntu:size=10:italic}${goto 15}${scroll 55 5\
${color1}Humidity:  ${color2}${texeci 600 sed -n '7p' $HOME/Accuweather_conky_script/curr_cond}\
${color1}     Pressure:  ${color2}${texeci 600 sed -n '8p' $HOME/Accuweather_conky_script/curr_cond | awk '{print substr($0,3)}'}${font Sans:size=9:italic}${color}${offset 2}${texeci 600 sed -n '8p' $HOME/Accuweather_conky_script/curr_cond | awk '{print substr($1,1)}'}${voffset -1}${font Ubuntu:size=10:italic}\
${color1}     UV Index:  ${if_match "${texeci 600 sed -n '9p' $HOME/Accuweather_conky_script/curr_cond | awk '{print $1}'}" == "-"}${color}${else}${color2}${endif}${texeci 600 sed -n '9p' $HOME/Accuweather_conky_script/curr_cond | awk '{print $1}'}\
${if_match "${texeci 600 sed -n '9p' $HOME/Accuweather_conky_script/curr_cond | awk '{for (i=2; i<NF; i++) printf $i " "; print $NF}'}" == "Low"}${color3}  ${texeci 600 sed -n '9p' $HOME/Accuweather_conky_script/curr_cond | awk '{for (i=2; i<NF; i++) printf $i " "; print $NF}'}\
${else}${if_match "${texeci 600 sed -n '9p' $HOME/Accuweather_conky_script/curr_cond | awk '{for (i=2; i<NF; i++) printf $i " "; print $NF}'}" == "Moderate"}${color2}  ${texeci 600 sed -n '9p' $HOME/Accuweather_conky_script/curr_cond | awk '{for (i=2; i<NF; i++) printf $i " "; print $NF}'}\
${else}${if_match "${texeci 600 sed -n '9p' $HOME/Accuweather_conky_script/curr_cond | awk '{for (i=2; i<NF; i++) printf $i " "; print $NF}'}" == "High"}${color5}  ${texeci 600 sed -n '9p' $HOME/Accuweather_conky_script/curr_cond | awk '{for (i=2; i<NF; i++) printf $i " "; print $NF}'}\
${else}${if_match "${texeci 600 sed -n '9p' $HOME/Accuweather_conky_script/curr_cond | awk '{for (i=2; i<NF; i++) printf $i " "; print $NF}'}" == "Very High"}${color}  ${texeci 600 sed -n '9p' $HOME/Accuweather_conky_script/curr_cond | awk '{for (i=2; i<NF; i++) printf $i " "; print $NF}'}\
${else}${if_match "${texeci 600 sed -n '9p' $HOME/Accuweather_conky_script/curr_cond | awk '{for (i=2; i<NF; i++) printf $i " "; print $NF}'}" == "Extreme"}${color6}  ${texeci 600 sed -n '9p' $HOME/Accuweather_conky_script/curr_cond | awk '{for (i=2; i<NF; i++) printf $i " "; print $NF}'}\
${else}${endif}${endif}${endif}${endif}${endif}\
${color1}     Dew Point:  ${color2}${texeci 600 sed -n '12p' $HOME/Accuweather_conky_script/curr_cond}°\
${color1}     Cloud Cover:  ${color2}${texeci 600 sed -n '10p' $HOME/Accuweather_conky_script/curr_cond}\
${color1}     Visibility:  ${color2}${texeci 600 sed -n '13p' $HOME/Accuweather_conky_script/curr_cond}\
${color1}     Source:  ${font Sans:size=9}${color2}☀${font Ubuntu:size=9:italic}${color5} AccuWeather}

accuweather.png

Edit Code

Last edited by marens (2023-03-10 23:40:08)


If people would know how little brain is ruling the world, they would die of fear.

Offline

#4219 2023-03-11 12:14:57

morfik
Member
From: Europe/Poland
Registered: 2016-09-08
Posts: 169
Website

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

Is there an easy way to add PRECIPITATION AMOUNT and CHANCE OF PRECIPITATION to the hourly output?

Offline

#4220 2023-03-11 13:36:19

morfik
Member
From: Europe/Poland
Registered: 2016-09-08
Posts: 169
Website

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

I'm not sure whether the original github repo is still active, but I forked it and try to maintain it here.

Offline

Board footer

Powered by FluxBB