You are not logged in.
I don't know. The messy output started to show yesterday. Maybe it's a temporary thing.
If I'm understanding correctly, you need to modify your conkyrc file. With the latest update on accuweather, the line numbers in daily_forecast output have changed, i.e.
Before the update in my conkyrc file
${voffset 20}${goto 55}${image $HOME/Accuweather_conky_script/forecast_2016/forecast_1.png -p 0,230 -s 40x36}${font }${goto 55}${voffset -20}Today: ${execi 600 sed -n '4p' $HOME/Accuweather_conky_script/daily_forecast}° | ${execi 600 sed -n '5p' $HOME/Accuweather_conky_script/daily_forecast}
${goto 55}${execi 600 sed -n '6p' $HOME/Accuweather_conky_script/daily_forecast}
After update:
${voffset 20}${goto 55}${image $HOME/Accuweather_conky_script/forecast_2016/forecast_1.png -p 0,230 -s 40x36}${font }${goto 55}${voffset -20}Today: ${execi 600 sed -n '3p' $HOME/Accuweather_conky_script/daily_forecast}° | ${execi 600 sed -n '4p' $HOME/Accuweather_conky_script/daily_forecast}
${goto 55}${execi 600 sed -n '5p' $HOME/Accuweather_conky_script/daily_forecast}
As you can see with the numbers I highlighted, the output now gets sent to a different line and therefore, you need to make the adjustments in your conkyrc file (or whatever config file you use).
Cn you post a screenshot of what you are experiencing please?
Last edited by seatommyboy (2022-05-12 11:06:06)
Offline
seatommyboy
I don't know how github works. I downloaded Accuweather_conky_script-master.tar.gz, unpacked and compared the new accuweather script with my script using the meld program, changed the code in blocks:
current conditions
daily forecast
Hourly: 24h
Always 100% - workedmy changes or differences:
Accuweather_README_INFO - old README_INFO
Forecast_Images - png 149x150
StartConky_Accuw.sh menu to start conky version 1.9 or 1.10
StartConky_Accuw_and_edit.sh menu to start conky version 1.9 or 1.10 and gedit
conkyconfig - scripts, conkymy changes or differences script accuweather:
do not delete: tendency pressure line 502
added: location, time update line 506
added: curr_cond_control_point line 359
do not delete: raw, temp files line 1066 , 1231-1271 (I am not a programmer, I need these files to compare the old and new files, analyze the problem and repeatedly try to solve it using the sed text editor)Make 2 project: copy (clone) gitlab Teo, add my script accuweather.
There will be fewer questions.Correct: Accuweather_conky_script_11_05_2022.tar.gz
Only time I will alter the main script is if it's to udpate with your changes. It's the other files that I have pruned from the tree.
If you're interested:
How to git
It's quite old and a bit outdated, but the basics are there.
Offline
@il.harun Looks like accuweather changed things again. I'm no longer getting my weather icons/images
cp: cannot stat '/home/thomas/Accuweather_conky_script/Forecast_Images_2016/70.png': No such file or directory
cp: cannot stat '/home/thomas/Accuweather_conky_script/Forecast_Images_2016/Wind.png': No such file or directory
cp: cannot stat '/home/thomas/Accuweather_conky_script/Forecast_Images_2016/92.png': No such file or directory
cp: cannot stat '/home/thomas/Accuweather_conky_script/Forecast_Images_2016/71.png': No such file or directory
cp: target '/home/thomas/Accuweather_conky_script/forecast_2016/forecast_3.png' is not a directory
cp: cannot stat '/home/thomas/Accuweather_conky_script/Forecast_Images_2016/0%.png': No such file or directory
cp: cannot stat '/home/thomas/Accuweather_conky_script/Forecast_Images_2016/Tue.png': No such file or directory
cp: cannot stat '/home/thomas/Accuweather_conky_script/Forecast_Images_2016/5/18.png': No such file or directory
cp: cannot stat '/home/thomas/Accuweather_conky_script/Forecast_Images_2016/99.png': No such file or directory
cp: cannot stat '/home/thomas/Accuweather_conky_script/Forecast_Images_2016/73.png': No such file or directory
cp: target '/home/thomas/Accuweather_conky_script/forecast_2016/forecast_9.png' is not a directory
cp: cannot stat '/home/thomas/Accuweather_conky_script/Forecast_Images_2016/25%.png': No such file or directory
cp: cannot stat '/home/thomas/Accuweather_conky_script/Forecast_Images_2016/.png': No such file or directory
cp: cannot stat '/home/thomas/Accuweather_conky_script/Forecast_Images_2016/.png': No such file or directory
I just checked my script and it is not modified from yours.
Offline
I haven't tested your script, but it's definitely different from mine.
Offline
I haven't tested your script, but it's definitely different from mine.
My script shoudl've bee identical to yours since it is yourrs, but somehow I ended up with some old data in it. Fixed now, thanks for pointing it out.
Repo has been pruned and updated.
Offline
I am working on cleaning up the repo some more and organizing things a bit better. I have created a test branch for all to try.
git clone https://github.com/TeamFahQ/1_accuweather -b test
I would suggest keeping this separate from the master branch directory unless you are well versed with git and switching between branches.
The hourly script isn't working correctly. I will be investigating this as well. I tiried hourly with an unmodified version or il.harun's script and it still outputs a lot of errors. But together, I think we can get it working too. Have a great weekend everyone!
Offline
@il.harun: thank you for the latest 11 May 22 script changes.
I was testing it today and found that the weatherfont code for current weather (22p, curr_cond file) doesn't get generated. Not sure if this is just a temporary glitch or they've changed things again.
Also, I believe the sun and moon rise/setting times and durations (14-16p, 18-20p) are no longer found in the same place as before, as other data shows up in those spots in the curr_cond file.
Offline
You could also introduce a $CONKY_DIR variable (for instance CONKY_DIR="${HOME}/.conky") instead of using $HOME everywhere in the accuweather script.
Just be aware that one of $HOME in following block should stay untouched:
hours=$((12+$h_24hours*12))
for (( i=1; i<=$hours; i+=1 ))
do
if [[ $hourly2015 == 1 ]]; then
sed -i "4s/$/\${image \$HOME\/.conky\/Accuweather_conky_script\/hourly_2015\/hourly_$i.png -s 60x36 -p $jump_to,25}/" $CONKY_DIR/Accuweather_conky_script/altogether24_2015
fi
if [[ $hourly2016 == 1 ]]; then
sed -i "4s/$/\${image \$HOME\/.conky\/Accuweather_conky_script\/hourly_2016\/hourly_$i.png -s 36x36 -p $jump_to,25}/" $CONKY_DIR/Accuweather_conky_script/altogether24_2016
fi
((jump_to+=60))
done
Last edited by morfik (2022-05-15 08:39:04)
Offline
@asqwerth
thanks for testing
accuweather script: line 375
sed '/sunrise-sunset card-module content-module/,/temp-history content-module/!d' $HOME/Accuweather_conky_script/curr_cond_raw > $HOME/Accuweather_conky_script/curr_cond_temp1
replaced by:
sed '/sunrise-sunset/,/temp-history content-module/!d' $HOME/Accuweather_conky_script/curr_cond_raw > $HOME/Accuweather_conky_script/curr_cond_temp1
@morfik
I've been doing this for years:
hours=$((12+$h_24hours*12))
for (( i=1; i<=$hours; i+=1 ))
do
if [[ $hourly2015 == 1 ]]; then
# sed -i "4s/$/\${image \/tmp\/accuweather_en\/hourly_2015\/hourly_$i.png -s 60x36 -p $jump_to,49}/" $directory/altogether24_2015
#
#
sed -i "4s%$%\${image $directory\/hourly_2015\/hourly_$i.png -s 60x36 -p $jump_to,49}%" $directory/altogether24_2015
fi
if [[ $hourly2016 == 1 ]]; then
# sed -i "4s/$/\${image \/tmp\/accuweather_en\/hourly_2016\/hourly_$i.png -s 36x36 -p $jump_to,49}/" $directory/altogether24_2016
#
#
sed -i "4s%$%\${image $directory\/hourly_2016\/hourly_$i.png -s 36x36 -p $jump_to,49}%" $directory/altogether24_2016
fi
((jump_to+=60))
done
Offline
Thanks, il.harun.
The fix works.
And the weatherfont code for current weather has reappeared. So it was just temporary.
Offline
Great work all. Thanks to everyone for the effort they are putting into keeping the scripts going. It's very much appreciated.
Offline
Master and Test branches updated. I rebased both branches for a cleaner look and much cleaner commits. accuweather script in master branch is synced with the script il.harun linked in post #4090
Offline
Hello
New script work perfectly with englis adress curr_cong , daily , and hourly and forecast images are here.
In french it work great too just hourly images are not right, i have just
hourly_1 right
hourly_5 right
hourly_6 wrong
hourly_8 right.
It doesn't matter I modified my script & he done this
More tanks for updating the script.
@+
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
Helo
I have it
2 conkys & 2 script 1 in english & 1 in french.
How long the current script will work before accuweather changes again
That is the question.
@+
Last edited by loutch (2022-05-16 16:16:07)
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
Very nice work there!!
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Offline
Hi,
After a long time I finally have some time to work on my conky scripts. I almost have the weather script ready using il.harun's archive, but I'm having a problem getting the wind gauge to display the correct direction. How can I debug?
Are there any conky script tutorials anywhere?
I also wanted to find a good barometer script similar to this one minus the temperature stuff: found here
but I can't get this one to work because I can't get past getting conkyforecast to work (which this conky needs to work).
Is there a repository of conky scripts for this forum or a general repository somewhere?
@loutch I like this script
do you have it or other scripts available for download? Sorry if you posted it before, but I couldn't find it.
Thanks in advance,
Robert
Offline
Hello
Here mine baro
I modify it to use wunderground_conky-script
ATTENTION
Wiht conky 1.10 and lua it run three conky
conkyrc (i use the image.lua script for the images)
conky.config = {
background = true,
use_xft = true,
font = 'Liberation Sans:size=7',
xftalpha = 1,
update_interval = 1.0,
total_run_times = 0,
own_window = true,
own_window_transparent = true,
--own_window_color 000000
own_window_argb_visual = true,
--own_window_argb_value = 250,
own_window_type = 'normal',
own_window_hints = 'undecorated,below,skip_taskbar,skip_pager',
double_buffer = true,
minimum_width = 200, minimum_height = 200,
maximum_width = 200,
text_buffer_size = 2048,
draw_shades = false,
draw_outline = false,
draw_borders = false,
draw_graph_borders = false,
default_color = 'white',
default_outline_color = 'white',
alignment = 'top_left',
gap_x = 400,
gap_y = 230,
no_buffers = true,
uppercase = false,
cpu_avg_samples = 2,
override_utf8_locale = true,
imlib_cache_flush_interval = 60,
imlib_cache_size = 10000,
-- Taille des pointillés
stippled_borders = 5,
-- Couleurs
default_color = '#ffffff',--ffd579
default_shade_color = '#333333',
default_outline_color = 'black',
lua_load = '~/.conky/lua/image.lua',
color1 = 'D2CBC1',
color2 = 'red',
color3 = '6495ee',
color4 = 'B1ADA7',
color5 = '7B7870',
color6 = '3F3C36',
color7 = '000000',
};
conky.text = [[
${lua fDrawImage ~/.conky/baro/images/15.png 0 90 40 40}
${lua fDrawImage ~/.conky/baro/images/18.png 2 50 40 40}
${lua fDrawImage ~/.conky/baro/images/12.png 25 20 40 40}
${lua fDrawImage ~/.conky/baro/images/13.png 60 0 40 40}
${Lua fDrawImage ~/.conky/baro/images/3.png 110 0 40 40}
${Lua fDrawImage ~/.conky/baro/images/4.png 145 20 40 40}
${lua fDrawImage ~/.conky/baro/images/2.png 160 50 40 40}
${lua fDrawImage ~/.conky/baro/images/1.png 165 90 40 40}
${alignc}${execi 90 sed -n '8p' $HOME/1_accuweather/curr_cond} mb
${font Ubuntu:style=Bold:size=14}
${voffset -1}${goto 22}${color2}T${execi 90 sed -n '2p' $HOME/1_accuweather/curr_cond}° ${goto 140}${color3}R${execi 90 sed -n '3p' $HOME/1_accuweather/curr_cond}°
]];
conkyrc1 (for textwittring.lua)
conky.config = {
background = true,
use_xft = true,
font = 'Liberation Sans:size=7',
xftalpha = 1,
update_interval = 1.0,
total_run_times = 0,
own_window = true,
own_window_transparent = true,
--own_window_color 000000
own_window_argb_visual = true,
--own_window_argb_value = 250,
own_window_type = 'normal',
own_window_hints = 'undecorated,below,skip_taskbar,skip_pager',
double_buffer = true,
minimum_width = 200, minimum_height = 200,
maximum_width = 200,
text_buffer_size = 2048,
draw_shades = false,
draw_outline = false,
draw_borders = false,
draw_graph_borders = false,
default_color = 'white',
default_outline_color = 'white',
alignment = 'top_left',
gap_x = 400,
gap_y = 230,
no_buffers = true,
uppercase = false,
cpu_avg_samples = 2,
override_utf8_locale = true,
imlib_cache_flush_interval = 60,
imlib_cache_size = 10000,
-- Taille des pointillés
stippled_borders = 5,
-- Couleurs
default_color = '#ffffff',--ffd579
default_shade_color = '#333333',
default_outline_color = 'black',
lua_load = ' ~/.conky/ROGConky/baro/textwriting.lua',
lua_draw_hook_post = 'draw_text',
color1 = 'D2CBC1',
color2 = 'red',
color3 = 'blue',
color4 = 'B1ADA7',
color5 = '7B7870',
color6 = '3F3C36',
color7 = '000000',
};
conky.text = [[
]];
conkyrc2 ( for baro.lua)
conky.config = {
background = true,
use_xft = true,
font = 'Liberation Sans:size=7',
xftalpha = 1,
update_interval = 1.0,
total_run_times = 0,
own_window = true,
own_window_transparent = true,
--own_window_color 000000
own_window_argb_visual = true,
--own_window_argb_value = 250,
own_window_type = 'normal',
own_window_hints = 'undecorated,below,skip_taskbar,skip_pager',
double_buffer = true,
minimum_width = 200, minimum_height = 200,
maximum_width = 200,
text_buffer_size = 2048,
draw_shades = false,
draw_outline = false,
draw_borders = false,
draw_graph_borders = false,
default_color = 'white',
default_outline_color = 'white',
alignment = 'top_left',
gap_x = 400,
gap_y = 230,
no_buffers = true,
uppercase = false,
cpu_avg_samples = 2,
override_utf8_locale = true,
imlib_cache_flush_interval = 60,
imlib_cache_size = 10000,
-- Taille des pointillés
stippled_borders = 5,
-- Couleurs
default_color = '#ffffff',--ffd579
default_shade_color = '#333333',
default_outline_color = 'black',
lua_load = ' ~/.conky/ROGConky/baro/baro.lua',
lua_draw_hook_pre = 'main',
color1 = 'D2CBC1',
color2 = 'red',
color3 = 'blue',
color4 = 'B1ADA7',
color5 = '7B7870',
color6 = '3F3C36',
color7 = '000000',
};
conky.text = [[
]];
textwritting.lua
--[[circlewriting by mrpeachy (2010)]]
require 'cairo'
function addzero100(num)
if tonumber(num) < 10 then
return "00" .. num
elseif tonumber(num) <100 then
return "0" .. num
else
return num
end
end
function string:split(delimiter)
local result = { }
local from = 1
local delim_from, delim_to = string.find( self, delimiter, from )
while delim_from do
table.insert( result, string.sub( self, from , delim_from-1 ) )
from = delim_to + 1
delim_from, delim_to = string.find( self, delimiter, from )
end
table.insert( result, string.sub( self, from ) )
return result
end
function circlewriting(cr, text, font, fsize, radi, horiz, verti, tred, tgreen, tblue, talpha, start, finish, var1)
local inum=string.len(text)
range=finish
deg=(finish-start)/(inum-1)
degrads=1*(math.pi/180)
local textcut=string.gsub(text, ".", "%1@@@")
texttable=string.split(textcut, "@@@")
for i = 1,inum do
ival=i
interval=(degrads*(start+(deg*(i-1))))+var1
interval2=degrads*(start+(deg*(i-1)))
txs=0+radi*(math.sin(interval))
tys=0-radi*(math.cos(interval))
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fsize);
cairo_set_source_rgba (cr, tred, tgreen, tblue, talpha);
cairo_move_to (cr, txs+horiz, tys+verti);
cairo_rotate (cr, interval2)
cairo_show_text (cr, (texttable[i]))
cairo_stroke (cr)
cairo_rotate (cr, -interval2)
end
end
function circlewritingdown(cr, text, font, fsize, radi, horiz, verti, tred, tgreen, tblue, talpha, start, finish, var1)
local inum=string.len(text)
deg=(start-finish)/(inum-1)
degrads=1*(math.pi/180)
local textcut=string.gsub(text, ".", "%1@@@")
texttable=string.split(textcut, "@@@")
for i = 1,inum do
ival=i
interval=(degrads*(start-(deg*(i-1))))+var1
interval2=degrads*(start-(deg*(i-1)))
txs=0+radi*(math.sin(interval))
tys=0-radi*(math.cos(interval))
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fsize);
cairo_set_source_rgba (cr, tred, tgreen, tblue, talpha);
cairo_move_to (cr, txs+horiz, tys+verti);
cairo_rotate (cr, interval2+(180*math.pi/180))
cairo_show_text (cr, (texttable[i]))
cairo_stroke (cr)
cairo_rotate (cr, -interval2-(180*math.pi/180))
end
end
function conky_draw_text()
local updates=conky_parse('${updates}')
update_num=tonumber(updates)
if update_num > 5 then
if conky_window==nil then return end
local w=conky_window.width
local h=conky_window.height
local cs=cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, w, h)
cr=cairo_create(cs)
--circlewriting variable
cpu=tonumber(conky_parse('${cpu}'))
--text must be in quotes
text=("Tempete - Pluie - Variable - Beau - Tres Sec")
--text=("Stormy - Rain - Change - Fair - Very Dry")
--font name must be in quotes
font="DejaVuSansMono:bold"
fontsize=9
radius=56
positionx=100
positiony=100
colorred=0.24
colorgreen=0.56
colorblue=0.72
coloralpha=1
--to set start and finish values for circlewriting, if the text will cross 0 degrees then you must calculate for 360+finish degrees
--eg if you want to go from 270 to 90, then you will input 270 to 450. Finish has to be greater than start.
start=-115
finish=115
letterposition=0
circlewriting(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)
--circlewritingdown variables
--mem=tonumber(conky_parse('${memperc}'))
--text must be in quotes
text=(" 0 ")
--font name must be in quotes
font="DejaVuSansMono:bold"
fontsize=8
radius=38
positionx=100
positiony=130
colorred=0.24
colorgreen=0.56
colorblue=0.72
coloralpha=1
--to set start and finish values for circlewritingdown, if the text will cross 0 degrees then you must calculate for 0-finish degrees
--eg if you want to go from 90 to 270, then you will input 90 to -90. Start has to be greater than finish
start=150
finish=144
letterposition=0
circlewritingdown(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)
text=("50")
font="DejaVuSansMono:bold"
fontsize=8
radius=38
positionx=100
positiony=130
colorred=0.24
colorgreen=0.56
colorblue=0.72
coloralpha=1
start=268
finish=262
letterposition=0
circlewritingdown(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)
text=("40")
font="DejaVuSansMono:bold"
fontsize=8
radius=38
positionx=100
positiony=130
colorred=0.24
colorgreen=0.56
colorblue=0.72
coloralpha=1
start=245
finish=239
letterposition=0
circlewritingdown(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)
text=("30")
font="DejaVuSansMono:bold"
fontsize=8
radius=38
positionx=100
positiony=130
colorred=0.24
colorgreen=0.56
colorblue=0.72
coloralpha=1
start=222
finish=216
letterposition=0
circlewritingdown(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)
text=("20")
font="DejaVuSansMono:bold"
fontsize=8
radius=38
positionx=100
positiony=130
colorred=0.24
colorgreen=0.56
colorblue=0.72
coloralpha=1
start=199
finish=193
letterposition=0
circlewritingdown(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)
text=("10")
font="DejaVuSansMono:bold"
fontsize=8
radius=38
positionx=100
positiony=130
colorred=0.24
colorgreen=0.56
colorblue=0.72
coloralpha=1
start=176
finish=170
letterposition=0
circlewritingdown(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)
text=("-10")
font="DejaVuSansMono:bold"
fontsize=8
radius=38
positionx=100
positiony=130
colorred=1
colorgreen=0
colorblue=0
coloralpha=1
start=134
finish=124
letterposition=0
circlewritingdown(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)
text=("-20")
font="DejaVuSansMono:bold"
fontsize=8
radius=38
positionx=100
positiony=130
colorred=1
colorgreen=0
colorblue=0
coloralpha=1
start=112
finish=99
letterposition=0
circlewritingdown(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)
end
end
baro.lua
--==============================================================================
-- baro.lua
--
-- author : SLK-adapted by shamen456
-- version : v2011-06-13
-- license : Distributed under the terms of GNU GPL version 2 or later
--
--==============================================================================
require 'cairo'
--------------------------------------------------------------------------------
-- gauge DATA
gauge = {
{
name='cpu', arg='', max_value=1060, sub_value=960,
x=100, y=100,
graph_radius=60,
graph_thickness=10,
graph_start_angle=235,
graph_unit_angle=2.5, graph_unit_thickness=2.,
graph_bg_colour=0xFFFFFF, graph_bg_alpha=0.0,
graph_fg_colour=0xB1ADA7, graph_fg_alpha=0,
hand_fg_colour=0x000000, hand_fg_alpha=0.0,
txt_radius=20,
txt_weight=0, txt_size=10.0,
txt_fg_colour=0xFFFFFF, txt_fg_alpha=0,
graduation_radius=50,
graduation_thickness=8, graduation_mark_thickness=2,
graduation_unit_angle=18,
graduation_fg_colour=0x4F4B41, graduation_fg_alpha=0,
caption='',
caption_weight=1, caption_size=8.0,
caption_fg_colour=0xFFFFFF, caption_fg_alpha=0.0,
},
{
name='exec', arg='sed -n 26p $HOME/Wunderground_conky_script/curr_cond', max_value=1050, sub_value=950,
x=100, y=100,
graph_radius=25,
graph_thickness=60,
graph_start_angle=255,
graph_unit_angle=2.1, graph_unit_thickness=2.,
graph_bg_colour=0xFFFFFF, graph_bg_alpha=0.0,
graph_fg_colour=0xB1ADA7, graph_fg_alpha=0.0,
hand_fg_colour=0xffffff, hand_fg_alpha=1,
txt_radius=20,
txt_weight=0, txt_size=10.0,
txt_fg_colour=0xFFFFFF, txt_fg_alpha=0,
graduation_radius=50,
graduation_thickness=8, graduation_mark_thickness=2,
graduation_unit_angle=18,
graduation_fg_colour=0xffffff, graduation_fg_alpha=1,
caption='',
caption_weight=1, caption_size=8.0,
caption_fg_colour=0xFFFFFF, caption_fg_alpha=0,
},
{
name='exec', arg='sed -n 52p $HOME/Wunderground_conky_script/curr_cond',
max_value=60, sub_value=-30,--valeur de depart du graphe
x=100, y=130,
graph_radius=20,
graph_thickness=40,
graph_start_angle=75,
graph_unit_angle=2.33, graph_unit_thickness=1.5,
graph_bg_colour=0xFFFFFF, graph_bg_alpha=0.0,
graph_fg_colour=0xB1ADA7, graph_fg_alpha=0,
hand_fg_colour=0xff0000, hand_fg_alpha=1,
txt_radius=18,
txt_weight=1, txt_size=10.0,
txt_fg_colour=0xC0C0FF, txt_fg_alpha=0,
graduation_radius=20,
graduation_thickness=8, graduation_mark_thickness=2,
graduation_unit_angle=11.6,
graduation_fg_colour=0xffffff, graduation_fg_alpha=1,
caption='',
caption_weight=1, caption_size=8.0,
caption_fg_colour=0xFFFFFF, caption_fg_alpha=0,
},
{
name='exec', arg='sed -n 58p $HOME/Wunderground_conky_script/curr_cond', max_value=60, sub_value=-30,
x=100, y=130,
graph_radius=20,
graph_thickness=40,
graph_start_angle=75,
graph_unit_angle=2.33, graph_unit_thickness=1.5,
graph_bg_colour=0xFFFFFF, graph_bg_alpha=0.,
graph_fg_colour=0xB1ADA7, graph_fg_alpha=0,
hand_fg_colour=0x6495ee, hand_fg_alpha=1,
txt_radius=30,
txt_weight=1, txt_size=10.0,
txt_fg_colour=0xED7F77, txt_fg_alpha=0,
graduation_radius=22,
graduation_thickness=14, graduation_mark_thickness=2,
graduation_unit_angle=23.3,
graduation_fg_colour=0xffffff, graduation_fg_alpha=1,
caption='',
caption_weight=1, caption_size=8.0,
caption_fg_colour=0xFFFFFF, caption_fg_alpha=0,
},
}
-------------------------------------------------------------------------------
-- rgb_to_r_g_b
-- converts color in hexa to decimal
--
function rgb_to_r_g_b(colour, alpha)
return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end
-------------------------------------------------------------------------------
-- angle_to_position
-- convert degree to rad and rotate (0 degree is top/north)
--
function angle_to_position(start_angle, current_angle)
local pos = current_angle + start_angle
return ( ( pos * (2 * math.pi / 360) ) - (math.pi / 2) )
end
-------------------------------------------------------------------------------
-- draw_gauge_ring
-- displays gauges
--
function draw_gauge_ring(display, data, value)
local max_value = data['max_value']-data['sub_value']
local sub_value = data['sub_value']
local x, y = data['x'], data['y']
local graph_radius = data['graph_radius']
local graph_thickness, graph_unit_thickness = data['graph_thickness'], data['graph_unit_thickness']
local graph_start_angle = data['graph_start_angle']
local graph_unit_angle = data['graph_unit_angle']
local graph_bg_colour, graph_bg_alpha = data['graph_bg_colour'], data['graph_bg_alpha']
local graph_fg_colour, graph_fg_alpha = data['graph_fg_colour'], data['graph_fg_alpha']
local hand_fg_colour, hand_fg_alpha = data['hand_fg_colour'], data['hand_fg_alpha']
local graph_end_angle = (max_value * graph_unit_angle) % 360
-- background ring
cairo_arc(display, x, y, graph_radius, angle_to_position(graph_start_angle, 0), angle_to_position(graph_start_angle, graph_end_angle))
cairo_set_source_rgba(display, rgb_to_r_g_b(graph_bg_colour, graph_bg_alpha))
cairo_set_line_width(display, graph_thickness)
cairo_stroke(display)
-- arc of value
local val = (value-sub_value) % (max_value + 1)
local start_arc = 0
local stop_arc = 0
local i = 1
while i <= val do
start_arc = (graph_unit_angle * i) - graph_unit_thickness
stop_arc = (graph_unit_angle * i)
cairo_arc(display, x, y, graph_radius, angle_to_position(graph_start_angle, start_arc), angle_to_position(graph_start_angle, stop_arc))
cairo_set_source_rgba(display, rgb_to_r_g_b(graph_fg_colour, graph_fg_alpha))
cairo_stroke(display)
i = i + 1
end
local angle = start_arc
-- hand
start_arc = (graph_unit_angle * val) - (graph_unit_thickness * 2)
stop_arc = (graph_unit_angle * val)
cairo_arc(display, x, y, graph_radius, angle_to_position(graph_start_angle, start_arc), angle_to_position(graph_start_angle, stop_arc))
cairo_set_source_rgba(display, rgb_to_r_g_b(hand_fg_colour, hand_fg_alpha))
cairo_stroke(display)
-- graduations marks
local graduation_radius = data['graduation_radius']
local graduation_thickness, graduation_mark_thickness = data['graduation_thickness'], data['graduation_mark_thickness']
local graduation_unit_angle = data['graduation_unit_angle']
local graduation_fg_colour, graduation_fg_alpha = data['graduation_fg_colour'], data['graduation_fg_alpha']
if graduation_radius > 0 and graduation_thickness > 0 and graduation_unit_angle > 0 then
local nb_graduation = graph_end_angle / graduation_unit_angle
local i = 0
while i < nb_graduation do
cairo_set_line_width(display, graduation_thickness)
start_arc = (graduation_unit_angle * i) - (graduation_mark_thickness / 2)
stop_arc = (graduation_unit_angle * i) + (graduation_mark_thickness / 2)
cairo_arc(display, x, y, graduation_radius, angle_to_position(graph_start_angle, start_arc), angle_to_position(graph_start_angle, stop_arc))
cairo_set_source_rgba(display,rgb_to_r_g_b(graduation_fg_colour,graduation_fg_alpha))
cairo_stroke(display)
cairo_set_line_width(display, graph_thickness)
i = i + 1
end
end
-- text
local txt_radius = data['txt_radius']
local txt_weight, txt_size = data['txt_weight'], data['txt_size']
local txt_fg_colour, txt_fg_alpha = data['txt_fg_colour'], data['txt_fg_alpha']
local movex = txt_radius * math.cos(angle_to_position(graph_start_angle, angle))
local movey = txt_radius * math.sin(angle_to_position(graph_start_angle, angle))
cairo_select_font_face (display, "ubuntu", CAIRO_FONT_SLANT_NORMAL, txt_weight)
cairo_set_font_size (display, txt_size)
cairo_set_source_rgba (display, rgb_to_r_g_b(txt_fg_colour, txt_fg_alpha))
cairo_move_to (display, x + movex - (txt_size / 2), y + movey + 3)
cairo_show_text (display, value)
cairo_stroke (display)
-- caption
local caption = data['caption']
local caption_weight, caption_size = data['caption_weight'], data['caption_size']
local caption_fg_colour, caption_fg_alpha = data['caption_fg_colour'], data['caption_fg_alpha']
local tox = graph_radius * (math.cos((graph_start_angle * 2 * math.pi / 360)-(math.pi/2)))
local toy = graph_radius * (math.sin((graph_start_angle * 2 * math.pi / 360)-(math.pi/2)))
cairo_select_font_face (display, "ubuntu", CAIRO_FONT_SLANT_NORMAL, caption_weight);
cairo_set_font_size (display, caption_size)
cairo_set_source_rgba (display, rgb_to_r_g_b(caption_fg_colour, caption_fg_alpha))
cairo_move_to (display, x + tox + 5, y + toy + 1)
-- bad hack but not enough time !
if graph_start_angle < 105 then
cairo_move_to (display, x + tox - 30, y + toy + 1)
end
cairo_show_text (display, caption)
cairo_stroke (display)
end
-------------------------------------------------------------------------------
-- go_gauge_rings
-- loads data and displays gauges
--
function go_gauge_rings(display)
local function load_gauge_rings(display, data)
local str, value = '', 0
str = string.format('${%s %s}',data['name'], data['arg'])
str = conky_parse(str)
value = tonumber(str)
draw_gauge_ring(display, data, value)
end
for i in pairs(gauge) do
load_gauge_rings(display, gauge[i])
end
end
-------------------------------------------------------------------------------
-- MAIN
function conky_main()
if conky_window == nil then
return
end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local display = cairo_create(cs)
local updates = conky_parse('${updates}')
update_num = tonumber(updates)
if update_num > 5 then
go_gauge_rings(display)
end
end
& here the weather conky
Didiert
conky.config = {
background = true,
use_xft = true,
font = 'Liberation Sans:size=8',
xftalpha = 1,
update_interval = 1.0,
total_run_times = 0,
own_window = true,
own_window_transparent = false,
own_window_argb_visual = true,
own_window_argb_value = 0, -- 0 transparent 255 plein
own_window_type = 'normal',
own_window_hints = 'undecorated,below,skip_taskbar,skip_pager,',
double_buffer = true,
minimum_width = 450, minimum_height = 410,
maximum_width = 450,
text_buffer_size = 2048,
draw_shades = false,
draw_outline = false,
draw_borders = false,
draw_graph_borders = false,
default_color = 'white',
default_outline_color = 'white',
alignment = 'top_left',
gap_x = 50,
gap_y = 50,
no_buffers = true,
uppercase = false,
cpu_avg_samples = 2,
override_utf8_locale = true,
imlib_cache_flush_interval = 60,
imlib_cache_size = 10000,
stippled_borders = 5,
default_shade_color = '#333333',
default_outline_color = 'black',
lua_load = '~/.conky/lua/image.lua',
color1 = 'F5B800',
color2 = '00f5ff',
color3 = '828200',
color4 = '323200',
color5 = 'fdb72e',
color7 = '6495ee',
color9 = 'red',
};
conky.text = [[ ${texeci 2900 bash $HOME/Accuweather_conky_script/accuweather -h2015 -f2015} ${texeci 3600 bash $HOME/Wunderground_conky_script/wunderground}
#### Premier cadre ####
${voffset -8}${font LED_mono :style=Medium:size=52}${color 434343}${goto 27}${time %H}${goto 138}${time %M}${font LED_mono :size=20:style=Medium}${color 808080}${goto 235}${time %S}$font
#### Date ####
${voffset -60}${color white}${font GE Inspira:size=10}${alignc -108}${time %A, %d %B %Y}$font
${alignc -180}Mise @ jour : ${execpi 600 sed -n '1p' $HOME/Wunderground_conky_script/actualisation}
### vent ####
${goto 300}${font Ge Inspira:size=8}Vent : ${texeci 600 sed -n '17p' $HOME/Accuweather_conky_script/curr_cond |awk '{print $1}'} ${texeci 600 sed -n '17p' $HOME/Accuweather_conky_script/curr_cond |awk '{print $1}' > $HOME/Accuweather_conky_script/vent}
${goto 300}Vitesse : ${texeci 600 sed -n '17p' $HOME/Accuweather_conky_script/curr_cond |awk '{print $2}'} km/h
${goto 300}Préssion : $font ${execi 600 sed -n '10p' $HOME/Accuweather_conky_script/curr_cond}${font Ge Inspira:size=8}
${goto 300}Indice UV : ${execi 600 sed -n '5p' $HOME/Accuweather_conky_script/curr_cond} ${execi 600 sed -n '6p' $HOME/Accuweather_conky_script/curr_cond}
${goto 300}Visibilité : ${execi 600 sed -n '21p' $HOME/Accuweather_conky_script/curr_cond}s
${goto 300}Point de rosé : ${execi 600 sed -n '8p' $HOME/Accuweather_conky_script/curr_cond} °C
${goto 300}Couv. nuageuse : ${execi 600 sed -n '13p' $HOME/Accuweather_conky_script/curr_cond}
${goto 300}Point de rosé : ${execi 600 sed -n '8p' $HOME/Accuweather_conky_script/curr_cond} °C
#### Ville ####
${voffset -60}${goto 16}${font GE Inspira:size=14:}Sarreguemines : ${font} ${execi 600 sed -n '4p' $HOME/Accuweather_conky_script/curr_cond}
${goto 16}Temp.: ${execi 600 sed -n '2p' $HOME/Accuweather_conky_script/curr_cond} °C Res.: ${execi 600 sed -n '3p' $HOME/Accuweather_conky_script/curr_cond} °C
${goto 16}Soleil ↑ ${execi 600 sed -n '14p' $HOME/Accuweather_conky_script/curr_cond} ↓ ${execi 600 sed -n '15p' $HOME/Accuweather_conky_script/curr_cond} = ${execi 600 sed -n '16p' $HOME/Accuweather_conky_script/curr_cond}
${goto 16}Lune ↑ ${execi 600 sed -n '18p' $HOME/Accuweather_conky_script/curr_cond} ↓ ${execi 600 sed -n '19p' $HOME/Accuweather_conky_script/curr_cond} = ${execi 600 sed -n '20p' $HOME/Accuweather_conky_script/curr_cond} ${execpi 600 sed -n '1p' $HOME/Wunderground_conky_script/lune}
#### Deuxième cadre ####
##### Affichage temperatures #####
${voffset 34}
${goto 28}${color7}${texeci 600 sed -n '5p' $HOME/Accuweather_conky_script/daily_forecast}°${color}/${color9}${texeci 600 sed -n '4p' $HOME/Accuweather_conky_script/daily_forecast}°\
${goto 95}${color7}${execpi 600 sed -n '12p' $HOME/Accuweather_conky_script/daily_forecast}°${color}/${color9}${execpi 600 sed -n '11p' $HOME/Accuweather_conky_script/daily_forecast}°\
${goto 170}${color7}${execpi 600 sed -n '19p' $HOME/Accuweather_conky_script/daily_forecast}°${color}/${color9}${execpi 600 sed -n '18p' $HOME/Accuweather_conky_script/daily_forecast}°\
${goto 245}${color7}${execpi 600 sed -n '26p' $HOME/Accuweather_conky_script/daily_forecast}°${color}/${color9}${execpi 600 sed -n '25p' $HOME/Accuweather_conky_script/daily_forecast}°\
${goto 320}${color7}${execpi 600 sed -n '33p' $HOME/Accuweather_conky_script/daily_forecast}°${color}/${color9}${execpi 600 sed -n '32p' $HOME/Accuweather_conky_script/daily_forecast}°\
${goto 400}${color7}${execpi 600 sed -n '40p' $HOME/Accuweather_conky_script/daily_forecast}°${color}/${color9}${execpi 600 sed -n '39p' $HOME/Accuweather_conky_script/daily_forecast}°${color}
#### Affichage date ####
${goto 20}Aujourd'hui\
${goto 95}${execi 3600 echo `date --date="1 day" | awk '{print $1}' | cut -c1-3`}.${execi 3600 echo `date --date="1 day" | awk '{print $2}'`}\
${goto 170}${execi 3600 echo `date --date="2 day" | awk '{print $1}' | cut -c1-3`}.${execi 3600 echo `date --date="2 day" | awk '{print $2}'`}\
${goto 245}${execi 3600 echo `date --date="3 day" | awk '{print $1}' | cut -c1-3`}.${execi 3600 echo `date --date="3 day" | awk '{print $2}'`}\
${goto 320}${execi 3600 echo `date --date="4 day" | awk '{print $1}' | cut -c1-3`}.${execi 3600 echo `date --date="4 day" | awk '{print $2}'`}\
${goto 400}${execi 3600 echo `date --date="5 day" | awk '{print $1}' | cut -c1-3`}.${execi 3600 echo `date --date="5 day" | awk '{print $2}'`}
#### Conditions ####
${goto 20}${scroll 12 ${execpi 600 sed -n '6p' $HOME/Accuweather_conky_script/daily_forecast}}\
${goto 95}${scroll 12 ${execpi 600 sed -n '13p' $HOME/Accuweather_conky_script/daily_forecast}}\
${goto 170}${scroll 12 ${execpi 600 sed -n '20p' $HOME/Accuweather_conky_script/daily_forecast}}\
${goto 245}${scroll 12 ${execpi 600 sed -n '27p' $HOME/Accuweather_conky_script/daily_forecast}}\
${goto 320}${scroll 12 ${execpi 600 sed -n '34p' $HOME/Accuweather_conky_script/daily_forecast}}\
${goto 396}${scroll 10 ${execpi 600 sed -n '41p' $HOME/Accuweather_conky_script/daily_forecast}}
#### Prochaine heure ###
${goto 20}Dans une heure
${goto 28}Il y aura une température de : ${color7}${texeci 600 sed -n '4p' $HOME/Accuweather_conky_script/hourly}°C${color} avec un ressenti de : ${color9}${texeci 600 sed -n '6p' $HOME/Accuweather_conky_script/hourly}°C
${goto 28}$color Il fera : ${color7}${execpi 600 sed -n '7p' $HOME/Accuweather_conky_script/hourly}
${goto 28}$color Avec du vent de : ${color7}${execpi 600 sed -n '51p' $HOME/Wunderground_conky_script/hourly} $color soufflant à ${color9}${execpi 600 sed -n '47p' $HOME/Wunderground_conky_script/hourly} km/h $color et en rafale à ${color7}${execpi 600 sed -n '53p' $HOME/Wunderground_conky_script/hourly} km/h
#### Affichage utilisés dans le conky ####
#### premier cadre ####
${lua fDrawImage $HOME/Accuweather_conky_script/fond/flip_bg.png 22 3 100 100}
${lua fDrawImage $HOME/Accuweather_conky_script/fond/flip_bg.png 132 3 100 100}
#### icônes premier cadre ####
${lua fDrawImage $HOME/Accuweather_conky_script/forecast_2015/forecast_0.png 185 70 115 69}
${lua fDrawImage $HOME/Accuweather_conky_script/Wind1.png 400 26 45 45}
#### icônes deuxième cadre ####
${lua fDrawImage $HOME/Accuweather_conky_script/forecast_2015/forecast_1.png 10 152 70 42}
${lua fDrawImage $HOME/Accuweather_conky_script/forecast_2015/forecast_2.png 80 152 70 42}
${lua fDrawImage $HOME/Accuweather_conky_script/forecast_2015/forecast_3.png 155 152 70 42}
${lua fDrawImage $HOME/Accuweather_conky_script/forecast_2015/forecast_4.png 230 152 70 42}
${lua fDrawImage $HOME/Accuweather_conky_script/forecast_2015/forecast_5.png 305 152 70 42}
${lua fDrawImage $HOME/Accuweather_conky_script/forecast_2015/forecast_6.png 388 152 70 42}
${lua fDrawImage $HOME/Accuweather_conky_script/hourly_2015/hourly_1.png 388 262 70 42}
${voffset - 800}
]];
Voila
@+
Last edited by loutch (2022-06-22 07:35:22)
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
Nifty!!! Thank you so much.
Offline
accuweather script: line 375
sed '/sunrise-sunset/,/temp-history content-module/!d' $HOME/Accuweather_conky_script/curr_cond_raw > $HOME/Accuweather_conky_script/curr_cond_temp1
replaced by:
sed '/sunrise-sunset non-ad/,/temp-history content-module/!d' $HOME/Accuweather_conky_script/curr_cond_raw > $HOME/Accuweather_conky_script/curr_cond_temp1
Offline
Here mine baro
conkyrc (i use the image.lua script for the images)
Where is this image.lua script?
Thanks
Offline