You are not logged in.

#1 2015-12-02 18:35:18

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

script and command in conky 1.10

I test conky 1.10 on my fedora rawhide and I have a problem with a line in the conky-text.
with conky 1.9 I have that for my conky-meteo :

${execi 300 cp -f ~/conky-meteo/icons/$(grep "yweather:condition" ~/.cache/meteo.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*").png ~/.cache/weather.png}${image ~/.cache/weather.png -p -1,1 -s 32x32}

And that work fine.

With conky 1.10 that don't work and I have this error :

[dominique@host-192-168-1-2 ~]$ conky -c /home/dominique/conky-meteo/conky-meteo
conky: desktop window (c00003) is subwindow of root window (284)
conky: window type - normal
conky: drawing to created window (0x4600002)
conky: drawing to double buffer
cp: impossible d'évaluer « /home/dominique/conky-meteo/icons/.png »: Aucun fichier ou dossier de ce type
cp: impossible d'évaluer « /home/dominique/conky-meteo/icons/.png »: Aucun fichier ou dossier de ce type

I think the problem is with

$(grep "yweather:condition" ~/.cache/meteo.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*").png

witch return nothing in the conky.
In console that work :

[dominique@host-192-168-1-2 ~]$ grep "yweather:condition" ~/.cache/meteo.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"
27
[dominique@host-192-168-1-2 ~]

How solve that ?

Offline

#2 2015-12-02 21:40:42

ohnonot
...again
Registered: 2015-09-29
Posts: 5,592

Re: script and command in conky 1.10

are you aware that conky 1.10 uses a lua-based syntax that is not compatible with the old conky syntax?
looks to me like your using the old syntax there.
iirc there's a script to convert to the new syntax in /usr/share/conky, but it doesn't always work.

Offline

#3 2015-12-03 01:36:43

tknomanzr
BL Die Hard
From: Around the Bend
Registered: 2015-09-29
Posts: 1,057

Re: script and command in conky 1.10

Here is a sample 1.10 conky. Key changes are the enclosing brackets for the top portion of the entry and ensuring that every line up there ends with a comma. Then the section where the text goes needs to be wrapped in [[ and ]]. I was able to do this conversion by hand in short enough time. 

conky.config=
{
background=true,
use_xft=true,
xftalpha=1,
update_interval=1.0,
total_run_times=0,
own_window=true,
own_window_transparent=false,
own_window_colour="b08f6a",
own_window_type="desktop",
own_window_argb_visual=true,
own_window_argb_value=150,
own_window_hints="undecorated,below,sticky,skip_taskbar,skip_pager",
double_buffer=true,
draw_shades=false,
draw_outline=false,
draw_borders=false,
draw_graph_borders=false,
default_shade_color="9999FF",
default_outline_color="b2b2FF",
alignment="top_left",
maximum_width=1890,
minimum_width=1890,
minimum_height=90,
gap_x=1935,
gap_y=37,
text_buffer_size=2048,
no_buffers=true,
uppercase=false,
cpu_avg_samples=2,
override_utf8_locale=false,
}
conky.text=
[[
$alignc${color 0047ab}${cpubar cpu24 4,550}${font Exo-Bold:size=11}${voffset -4} S Y S T E M    I N F O ${voffset 4}${cpubar cpu24 4,550}
${font Exo-Bold:size=11}${color 0047ab}$alignc Host:${font Open-Sans:size=9}${color FF4500}${offset 4}$nodename${font Exo-Bold:size=11}${color 0047ab}${offset 20}${voffset -4}Kernel:${font Open-Sans:size=9} \
${color FF4500}${offset 4}$kernel${font Exo-Bold:size=11}${color 0047ab}${offset 20}${voffset -4}Distro:${font Open-Sans:size=9}${color FF4500}${offset 4} \
${exec cat /etc/lsb-release.bunsen | grep DISTRIB_DESCRIPTION | cut -c 21-}${font Exo-Bold:size=11}${color 0047ab}${offset 20}${voffset -4} \
Address:${font Open-Sans:size=9}${color FF4500}${offset 4}${addr wlan1}${font Exo-Bold:size=11}${color 0047ab}${offset 20}${voffset -4}Uptime:${font Open_sans:size=9}${color FF4500}${offset 4}$uptime
${font Exo-Bold:size=11}${color 0047ab}$alignc RAM:${font Open-Sans:size=9}${color FF4500}${offset 4}$mem/$memmax${font Exo-Bold:size=11}${color 0047ab}${offset 20} \
${voffset -4}Mem buff/cache:${font Open-Sans:size=9}${color FF4500}${offset 4}$buffers/$cached}${font Exo-Bold:size=11}${color 0047ab}${offset 20}${voffset -4} \
Swap:${font Open-Sans:size=9}${color FF4500}${offset 4}$swap/$swapmax${font Exo-Bold:size=11}${color 0047ab}${offset 20}${voffset -4}Root:${font Open-Sans:size=9} \
${color FF4500}${offset 4}${fs_used /}/${fs_size /}${font Exo-Bold:size=11}${color 0047ab}${offset 20}${voffset -4}Home:${font Open-Sans:size=9}${color FF4500} \
${offset 4}${fs_used /home}/${fs_size /home}${font Exo-Bold:size=11}${color 0047ab}${offset 20}${voffset -4}CPU Temp:${font Open-Sans:size=9}${color FF4500} \
${offset 4}${acpitemp}${font Exo-Bold:size=11}${color 0047ab}${offset 20}${voffset -4}GPU Temp/Freq:${font Open-Sans:size=9}${color FF4500}${offset 4}${nvidia temp}|${nvidia gpufreq}
$alignc${color 0047ab}${cpubar cpu24 4,1300}
${font Exo-Bold:size=11}${color 0047ab}$alignc Download: ${font Open-Sans:size=9}${color FF4500}${offset 4}${downspeedgraph wlan1 10,100 cc0000 ffff33 2048KiB -l -t} \
${downspeed wlan1}${font Exo-Bold:size=11}${color 0047ab}${offset 20}${voffset -4}Upload:${font Open-Sans:size=9}${color FF4500}${offset 4}${upspeedgraph wlan1 10,100 cc0000 ffff33 128KiB -l -t} \
${upspeed wlan1}${font Exo-Bold:size=11}${color 0047ab}
]]

Offline

#4 2015-12-03 05:13:49

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

Re: script and command in conky 1.10

@ohnonot
it's not the first conky I transform to conky 1.10, I have 3 conky that work well with 1.10 version with new syntax.

The problem is just with the line I shaw.

@
tknomanzr

Here my conkyrc :

conky.config = {

background = false,
use_xft = true,
font = 'DejaVuSansMono:size=7',
update_interval = 3.0,
total_run_times = 0,
own_window = true,
own_window_type = 'normal',
own_window_transparent = true,
own_window_argb_visual = true,
own_window_hints = 'undecorated,skip_taskbar,skip_pager,below',
double_buffer = true,
draw_shades = false,
draw_outline = false,
draw_borders = false,
draw_graph_borders = true,
stippled_borders = 8,
border_inner_margin = 4,
alignment = 'top_left',
minimum_width = 73,
minimum_height = 183,
gap_x = 130,
gap_y = 50,
no_buffers = true,
uppercase = false,
cpu_avg_samples = 2,
net_avg_samples = 2,
override_utf8_locale = true,
use_spacer = right,
text_buffer_size = 1024,
imlib_cache_size = 0, 

default_outline_color = '000000',
color1 = 'FFFFFF',
color2 = 'F5B800',
color3 = 'BFBFBF',
}


conky.text = [[


${execi 300 curl -s "http://weather.yahooapis.com/forecastrss?w=576999&u=c&d=8" | sed 's/Sun/Dim/g;s/Mon/Lun/g;s/Tue/Mar/g;s/Wed/Mer/g;s/Thu/Jeu/g;s/Fri/Ven/g;s/Sat/Sam/g' > ~/.cache/meteo.xml}

${font DejaVuSansMono:bold:size=8}${voffset -13}${alignr}${color2}${execi 300 grep "yweather:condition" ~/.cache/meteo.xml | grep -o "temp=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"} °${font}${color}
${font DejaVuSansMono:bold:size=8}${voffset 0}${alignr}${color1}Actuel${color}${font}
${execi 300 cp -f ~/conky-meteo/icons/$(grep "yweather:condition" ~/.cache/meteo.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*").png ~/.cache/weather.png}${image ~/.cache/weather.png -p -1,1 -s 32x32}

${voffset -9}${alignr}${execi 300 grep "yweather:forecast" ~/.cache/meteo.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1'}°/${color2}${execi 300 grep "yweather:forecast" ~/.cache/meteo.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1'}°${color}
${font DejaVuSansMono:bold:size=8}${voffset 0}${alignr}${color1}Aujourd'hui${font}${color}
${execi 300 cp -f ~/conky-meteo/icons/$(grep "yweather:forecast" ~/.cache/meteo.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1').png ~/.cache/weather-1.png}${image ~/.cache/weather-1.png -p -1,35 -s 32x32}

${voffset -9}${alignr}${execi 300 grep "yweather:forecast" ~/.cache/meteo.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2'}°/${color2}${execi 300 grep "yweather:forecast" ~/.cache/meteo.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2'}°${color}
${font DejaVuSansMono:bold:size=8}${voffset 0}${alignr}${color1}${execi 300 grep "yweather:forecast" ~/.cache/meteo.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2' | tr '[a-z]' '[A-Z]'}, ${execi 3600 date -d +1days +%d}${font}${color}
${execi 300 cp -f ~/conky-meteo/icons/$(grep "yweather:forecast" ~/.cache/meteo.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2').png ~/.cache/weather-2.png}${image ~/.cache/weather-2.png -p -1,71 -s 32x32}

${voffset -9}${alignr}${execi 300 grep "yweather:forecast" ~/.cache/meteo.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3'}°/${color2}${execi 300 grep "yweather:forecast" ~/.cache/meteo.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3'}°${color}
${font DejaVuSansMono:bold:size=8}${voffset 0}${alignr}${color1}${execi 300 grep "yweather:forecast" ~/.cache/meteo.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3' | tr '[a-z]' '[A-Z]'}, ${execi 3600 date -d +2days +%d}${font}${color}
${execi 300 cp -f ~/conky-meteo/icons/$(grep "yweather:forecast" ~/.cache/meteo.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3').png ~/.cache/weather-3.png}${image ~/.cache/weather-3.png -p -1,107 -s 32x32}

${voffset -9}${alignr}${execi 300 grep "yweather:forecast" ~/.cache/meteo.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==4'}°/${color2}${execi 300 grep "yweather:forecast" ~/.cache/meteo.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==4'}°${color}
${font DejaVuSansMono:bold:size=8}${voffset 0}${alignr}${color1}${execi 300 grep "yweather:forecast" ~/.cache/meteo.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==4' | tr '[a-z]' '[A-Z]'}, ${execi 3600 date -d +3days +%d}${font}${color}
${execi 300 cp -f ~/conky-meteo/icons/$(grep "yweather:forecast" ~/.cache/meteo.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==4').png ~/.cache/weather-4.png}${image ~/.cache/weather-4.png -p -1,143 -s 32x32}

${voffset -9}${alignr}${execi 300 grep "yweather:forecast" ~/.cache/meteo.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==5'}°/${color2}${execi 300 grep "yweather:forecast" ~/.cache/meteo.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==5'}°${color}
${font DejaVuSansMono:bold:size=8}${voffset 0}${alignr}${color1}${execi 300 grep "yweather:forecast" ~/.cache/meteo.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==5' | tr '[a-z]' '[A-Z]'}, ${execi 3600 date -d +4days +%d}${font}${color}
${execi 300 cp -f ~/conky-meteo/icons/$(grep "yweather:forecast" ~/.cache/meteo.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==5').png ~/.cache/weather-5.png}${image ~/.cache/weather-5.png -p -1,179 -s 32x32}

${voffset -9}${alignr}${execi 300 grep "yweather:forecast" ~/.cache/meteo.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==6'}°/${color2}${execi 300 grep "yweather:forecast" ~/.cache/meteo.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==6'}°${color}
${font DejaVuSansMono:bold:size=8}${voffset 0}${alignr}${color1}${execi 300 grep "yweather:forecast" ~/.cache/meteo.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==6' | tr '[a-z]' '[A-Z]'}, ${execi 3600 date -d +5days +%d}${font}${color}
${execi 300 cp -f ~/conky-meteo/icons/$(grep "yweather:forecast" ~/.cache/meteo.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==6').png ~/.cache/weather-6.png}${image ~/.cache/weather-6.png -p -1,215 -s 32x32}

${voffset -6}${alignr}${execi 300 grep "yweather:forecast" ~/.cache/meteo.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==7'}°/${color2}${execi 300 grep "yweather:forecast" ~/.cache/meteo.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==7'}°${color}
${font DejaVuSansMono:bold:size=8}${voffset 0}${alignr}${color1}${execi 300 grep "yweather:forecast" ~/.cache/meteo.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==7' | tr '[a-z]' '[A-Z]'}, ${execi 3600 date -d +6days +%d}${font}${color}
${execi 300 cp -f ~/conky-meteo/icons/$(grep "yweather:forecast" ~/.cache/meteo.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==7').png ~/.cache/weather-7.png}${image ~/.cache/weather-7.png -p -1,251 -s 32x32}

${voffset -6}${alignr}${execi 300 grep "yweather:forecast" ~/.cache/meteo.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==8'}°/${color2}${execi 300 grep "yweather:forecast" ~/.cache/meteo.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==8'}°${color}
${font DejaVuSansMono:bold:size=8}${voffset 0}${alignr}${color1}${execi 300 grep "yweather:forecast" ~/.cache/meteo.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==8' | tr '[a-z]' '[A-Z]'}, ${execi 3600 date -d +7days +%d}${font}${color}
${execi 300 cp -f ~/conky-meteo/icons/$(grep "yweather:forecast" ~/.cache/meteo.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==7').png ~/.cache/weather-8.png}${image ~/.cache/weather-8.png -p -1,287 -s 32x32}
#${exec wget http://www.calendrier-lunaire.net -O ~/.cache/moon-phase.html}
#${font DejaVuSansMono:bold:size=8}${offset 35}${voffset 20}${exec cat ~/.cache/moon-phase.html | sed -e :a -e 's/<[^>]*>//g;/</N;//ba' | grep "Nom de la phase" | awk '{print $6,$7}'}
#${exec ~/conky-meteo/get_image.sh}
${font DejaVuSansMono:bold:size=8}${exec cat ~/.cache/meteo.xml | grep city | awk -F\" '{ print $2 }'}
Humidité${alignr}${color2}${execi 300 grep "yweather:atmosphere" ~/.cache/meteo.xml | grep -o "humidity=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}%${alignr}${color}
Vent${alignr}${color2}${execi 300 grep "yweather:wind" ~/.cache/meteo.xml | grep -o "speed=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"} km/h${alignr}${color}
Direction${alignr}${color2}${if_match "${execi 300 grep "yweather:wind" ~/.cache/meteo.xml | grep -o "direction=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}"<="11.25"}${if_match "${execi 300 grep "yweather:wind" ~/.cache/meteo.xml | grep -o "direction=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}">"348.75"}NORD $endif$endif\
${if_match "${execi 300 grep "yweather:wind" ~/.cache/meteo.xml | grep -o "direction=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}"=="0"}NORD $endif\
${if_match "${execi 300 grep "yweather:wind" ~/.cache/meteo.xml | grep -o "direction=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}"<="33.75"}${if_match "${execi 300 grep "yweather:wind" ~/.cache/meteo.xml | grep -o "direction=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}">"11.25"}N-N-E $endif$endif\
${if_match "${execi 300 grep "yweather:wind" ~/.cache/meteo.xml | grep -o "direction=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}"<="56.25"}${if_match "${execi 300 grep "yweather:wind" ~/.cache/meteo.xml | grep -o "direction=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}">"33.75"}N-E $endif$endif\
${if_match "${execi 300 grep "yweather:wind" ~/.cache/meteo.xml | grep -o "direction=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}"<="78.75"}${if_match "${execi 300 grep "yweather:wind" ~/.cache/meteo.xml | grep -o "direction=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}">"56.25"}N-E-E $endif$endif\
${if_match "${execi 300 grep "yweather:wind" ~/.cache/meteo.xml | grep -o "direction=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}"<="101.25"}${if_match "${execi 300 grep "yweather:wind" ~/.cache/meteo.xml | grep -o "direction=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}">"78.75"}EST $endif$endif\
${if_match "${execi 300 grep "yweather:wind" ~/.cache/meteo.xml | grep -o "direction=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}"<="123.75"}${if_match "${execi 300 grep "yweather:wind" ~/.cache/meteo.xml | grep -o "direction=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}">"101.25"}S-E-E $endif$endif\
${if_match "${execi 300 grep "yweather:wind" ~/.cache/meteo.xml | grep -o "direction=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}"<="146.25"}${if_match "${execi 300 grep "yweather:wind" ~/.cache/meteo.xml | grep -o "direction=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}">"123.75"}S-E $endif$endif\
${if_match "${execi 300 grep "yweather:wind" ~/.cache/meteo.xml | grep -o "direction=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}"<="168.75"}${if_match "${execi 300 grep "yweather:wind" ~/.cache/meteo.xml | grep -o "direction=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}">"146.25"}S-S-E $endif$endif\
${if_match "${execi 300 grep "yweather:wind" ~/.cache/meteo.xml | grep -o "direction=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}"<="191.25"}${if_match "${execi 300 grep "yweather:wind" ~/.cache/meteo.xml | grep -o "direction=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}">"168.75"}SUD $endif$endif\
${if_match "${execi 300 grep "yweather:wind" ~/.cache/meteo.xml | grep -o "direction=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}"<="213.75"}${if_match "${execi 300 grep "yweather:wind" ~/.cache/meteo.xml | grep -o "direction=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}">"191.25"}S-S-O $endif$endif\
${if_match "${execi 300 grep "yweather:wind" ~/.cache/meteo.xml | grep -o "direction=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}"<="236.25"}${if_match "${execi 300 grep "yweather:wind" ~/.cache/meteo.xml | grep -o "direction=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}">"213.75"}S-O $endif$endif\
${if_match "${execi 300 grep "yweather:wind" ~/.cache/meteo.xml | grep -o "direction=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}"<="258.75"}${if_match "${execi 300 grep "yweather:wind" ~/.cache/meteo.xml | grep -o "direction=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}">"236.25"}S-O-O $endif$endif\
${if_match "${execi 300 grep "yweather:wind" ~/.cache/meteo.xml | grep -o "direction=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}"<="281.75"}${if_match "${execi 300 grep "yweather:wind" ~/.cache/meteo.xml | grep -o "direction=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}">"258.75"}OUEST $endif$endif\
${if_match "${execi 300 grep "yweather:wind" ~/.cache/meteo.xml | grep -o "direction=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}"<="303.75"}${if_match "${execi 300 grep "yweather:wind" ~/.cache/meteo.xml | grep -o "direction=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}">"281.25"}N-O-O $endif$endif\
${if_match "${execi 300 grep "yweather:wind" ~/.cache/meteo.xml | grep -o "direction=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}"<="326.25"}${if_match "${execi 300 grep "yweather:wind" ~/.cache/meteo.xml | grep -o "direction=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}">"303.75"}N-O-O $endif$endif\
${if_match "${execi 300 grep "yweather:wind" ~/.cache/meteo.xml | grep -o "direction=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}"<="348.75"}${if_match "${execi 300 grep "yweather:wind" ~/.cache/meteo.xml | grep -o "direction=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}">"326.25"}N-N-O $endif$endif

]]

With conky 1.9 It look like that :

1449147114.jpg

Last edited by chepioq (2015-12-03 12:53:15)

Offline

#5 2015-12-04 04:05:24

ohnonot
...again
Registered: 2015-09-29
Posts: 5,592

Re: script and command in conky 1.10

cp: impossible d'évaluer « /home/dominique/conky-meteo/icons/.png »: Aucun fichier ou dossier de ce type

what does that mean?

also, i'm not sure if you can do things like this:

${execi 300 cp -f ~/conky-meteo/icons/27.png ~/.cache/weather.png}${image ~/.cache/weather.png -p -1,1 -s 32x32}

(i replaced the grep oneliner with '27')
... i don't know yet, but we will find it ...

ideas:
- try to use links ('ln -s ...') instead of copying.
- is the image "weather.png" actually created?
- maybe the ~/.cache folder is not the right place.

of course none of that explains why it would work with conky 1.9.

Offline

#6 2015-12-04 13:57:13

PackRat
jgmenu user Numero Uno
Registered: 2015-10-02
Posts: 2,611

Re: script and command in conky 1.10

what does that mean?

"can't evaluate, no files or folders of this type"

@chepioq -

Instead of ~/conky-meteo/ try the full path /home/<username>/conky-meteo

I've had similar issues where a conkyrc that used to work no longer does; changing to the full path typically solves the problem. I have never delved into the conky bug reports to see if there is an issue with conky interpreting the "~".


You must unlearn what you have learned.
    -- yoda

Offline

#7 2015-12-04 14:33:17

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

Re: script and command in conky 1.10

@PackRat
I change to full path with same problem.

@ohnonot
I change for other folder than /.cache, same problem.

But I can see the image is created if I launch conky command many times, but it's not regular, once it's weather.png, after weather5.png etc...

I increased imlib_cache_size to 16384, same problem.

May be conky 1.10 is not able to do that actually...

Last edited by chepioq (2015-12-04 14:36:10)

Offline

#8 2015-12-04 14:33:29

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,008

Re: script and command in conky 1.10

ohnonot wrote:

also, i'm not sure if you can do things like this:

${execi 300 cp -f ~/conky-meteo/icons/27.png ~/.cache/weather.png}${image ~/.cache/weather.png -p -1,1 -s 32x32}

As you noted that works perfectly in v1.9:

${execi 300 cp -f /media/5/Conky/images/6.7.png ~/.cache/weather.png}${image ~/.cache/weather.png -p 10,20 -s 32x32}

2015_12_04_11_22_35_Scrot11.png
That's it just below the time.

However, and as PackRat has mentioned "changing to the full path typically solves the problem".

There are times all of these work in a conky and other times 1 or 2 will fail, 2 not so often but I have yet to see 3 fail:
1. $HOME/something
2. ~/something
3. /home/<username>/something

Somethings I have read on the net seem to indicate that v1.10 isn't 100% ready as 'some' commands aren't implimented yet.  But "${execi 300 cp -f" seems like a perfectly legal command.  sad


@chepioq
Have you considered doing most of that in a bash script similar to what Teo does with his scripts?
It could be that you are flooding yweather:forecast with the commnad to get information every 300 seconds when the sites usually update once an hour and it's choking on something.  Just a thought


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#9 2015-12-04 14:39:00

tknomanzr
BL Die Hard
From: Around the Bend
Registered: 2015-09-29
Posts: 1,057

Re: script and command in conky 1.10

Wasn't there some kind of issue with execi in conky 1.10? You might try a different execution method and see if that helps. You might also try wrapping that cp -f script into a bash script and executing it that way.

Offline

#10 2015-12-04 14:53:57

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,008

Re: script and command in conky 1.10

I was editing (adding the @chepioq part) when you added that.  So we crossed bows.
jolly_roger_100.png


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#11 2015-12-04 20:17:31

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

Re: script and command in conky 1.10

tknomanzr wrote:

Wasn't there some kind of issue with execi in conky 1.10? You might try a different execution method and see if that helps. You might also try wrapping that cp -f script into a bash script and executing it that way.

For test I made a bash script :

#!/bin/bash
cp -f /home/dominique/conky-meteo/icons/$(grep "yweather:forecast" /home/dominique/conky-meteo/meteo.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1').png /home/dominique/conky-meteo/weather-1.png
cp -f /home/dominique/conky-meteo/icons/$(grep "yweather:forecast" /home/dominique/conky-meteo/meteo.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2').png /home/dominique/conky-meteo/weather-2.png
cp -f /home/dominique/conky-meteo/icons/$(grep "yweather:forecast" /home/dominique/conky-meteo/meteo.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3').png /home/dominique/conky-meteo/weather-3.png
cp -f /home/dominique/conky-meteo/icons/$(grep "yweather:forecast" /home/dominique/conky-meteo/meteo.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==4').png /home/dominique/conky-meteo/weather-4.png
cp -f /home/dominique/conky-meteo/icons/$(grep "yweather:forecast" /home/dominique/conky-meteo/meteo.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==5').png /home/dominique/conky-meteo/weather-5.png
cp -f /home/dominique/conky-meteo/icons/$(grep "yweather:forecast" /home/dominique/conky-meteo/meteo.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==6').png /home/dominique/conky-meteo/weather-6.png
cp -f /home/dominique/conky-meteo/icons/$(grep "yweather:forecast" /home/dominique/conky-meteo/meteo.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==7').png /home/dominique/conky-meteo/weather-7.png
cp -f /home/dominique/conky-meteo/icons/$(grep "yweather:forecast" /home/dominique/conky-meteo/meteo.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==8').png /home/dominique/conky-meteo/weather-8.png
cp -f /home/dominique/conky-meteo/icons/$(grep "yweather:condition" /home/dominique/conky-meteo/meteo.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*").png /home/dominique/conky-meteo/weather.png

and launch my conky with just this setting :

conky.text = [[

${exec /home/dominique/conky-meteo/weather.sh}
${execi 300 curl -s "http://weather.yahooapis.com/forecastrss?w=576999&u=c&d=8" | sed 's/Sun/Dim/g;s/Mon/Lun/g;s/Tue/Mar/g;s/Wed/Mer/g;s/Thu/Jeu/g;s/Fri/Ven/g;s/Sat/Sam/g' > /home/dominique/conky-meteo/meteo.xml}

]]

and I have same error:

[dominique@host-192-168-1-2 ~]$ conky -c /home/dominique/conky-meteo/conky-meteo
conky: desktop window (c00003) is subwindow of root window (284)
conky: window type - normal
conky: drawing to created window (0x6e00002)
conky: drawing to double buffer
cp: impossible d'évaluer « /home/dominique/conky-meteo/icons/.png »: Aucun fichier ou dossier de ce type
cp: impossible d'évaluer « /home/dominique/conky-meteo/icons/.png »: Aucun fichier ou dossier de ce type
cp: impossible d'évaluer « /home/dominique/conky-meteo/icons/.png »: Aucun fichier ou dossier de ce type
cp: impossible d'évaluer « /home/dominique/conky-meteo/icons/.png »: Aucun fichier ou dossier de ce type
cp: impossible d'évaluer « /home/dominique/conky-meteo/icons/.png »: Aucun fichier ou dossier de ce type
cp: impossible d'évaluer « /home/dominique/conky-meteo/icons/.png »: Aucun fichier ou dossier de ce type
cp: impossible d'évaluer « /home/dominique/conky-meteo/icons/.png »: Aucun fichier ou dossier de ce type
cp: impossible d'évaluer « /home/dominique/conky-meteo/icons/.png »: Aucun fichier ou dossier de ce type
cp: impossible d'évaluer « /home/dominique/conky-meteo/icons/.png »: Aucun fichier ou dossier de ce type
^Cconky: received SIGINT or SIGTERM to terminate. bye!
[dominique@host-192-168-1-2 ~]$ 

The problem is with the cp -f command

bash script work well in console.

Last edited by chepioq (2015-12-04 20:18:25)

Offline

#12 2015-12-04 22:03:24

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,008

Re: script and command in conky 1.10

Try this:

${execpi 600 bash /home/dominique/conky-meteo/weather.sh}

And maybe put it all in the bash script with the 'curl' line first. This way the "curl" line 'creates/overwrites' the file: /home/dominique/conky-meteo/meteo.xml that none of the other lines create:

#!/bin/bash
curl -s "http://weather.yahooapis.com/forecastrss?w=576999&u=c&d=8" | sed 's/Sun/Dim/g;s/Mon/Lun/g;s/Tue/Mar/g;s/Wed/Mer/g;s/Thu/Jeu/g;s/Fri/Ven/g;s/Sat/Sam/g' > /home/dominique/conky-meteo/meteo.xml
cp -f /home/dominique/conky-meteo/icons/$(grep "yweather:forecast" /home/dominique/conky-meteo/meteo.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1').png /home/dominique/conky-meteo/weather-1.png
cp -f /home/dominique/conky-meteo/icons/$(grep "yweather:forecast" /home/dominique/conky-meteo/meteo.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2').png /home/dominique/conky-meteo/weather-2.png
cp -f /home/dominique/conky-meteo/icons/$(grep "yweather:forecast" /home/dominique/conky-meteo/meteo.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3').png /home/dominique/conky-meteo/weather-3.png
cp -f /home/dominique/conky-meteo/icons/$(grep "yweather:forecast" /home/dominique/conky-meteo/meteo.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==4').png /home/dominique/conky-meteo/weather-4.png
cp -f /home/dominique/conky-meteo/icons/$(grep "yweather:forecast" /home/dominique/conky-meteo/meteo.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==5').png /home/dominique/conky-meteo/weather-5.png
cp -f /home/dominique/conky-meteo/icons/$(grep "yweather:forecast" /home/dominique/conky-meteo/meteo.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==6').png /home/dominique/conky-meteo/weather-6.png
cp -f /home/dominique/conky-meteo/icons/$(grep "yweather:forecast" /home/dominique/conky-meteo/meteo.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==7').png /home/dominique/conky-meteo/weather-7.png
cp -f /home/dominique/conky-meteo/icons/$(grep "yweather:forecast" /home/dominique/conky-meteo/meteo.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==8').png /home/dominique/conky-meteo/weather-8.png
cp -f /home/dominique/conky-meteo/icons/$(grep "yweather:condition" /home/dominique/conky-meteo/meteo.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*").png /home/dominique/conky-meteo/weather.png

I only tried it in a terminal as I have v1.9 here, and like you it worked.
If that doesn't work try removing the "-f"
2015_12_04_18_40_09_Scrot11.jpg


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#13 2015-12-05 06:26:40

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

Re: script and command in conky 1.10

Ok Sector11, with your script that work without error.

I thought of another way, but I am not able to write the lua script :
create a lua script which launch the script weather.sh, and add in conkyrc two lines like this :

lua_load = 'script.lua',
lua_draw_hook_pre = 'fonction_lua',

With that, I think weather script is launch before conky start.

Offline

#14 2015-12-05 09:47:45

ohnonot
...again
Registered: 2015-09-29
Posts: 5,592

Re: script and command in conky 1.10

have you tried using "ln" instead of "cp"?
as in

${execi 300 ln -s ~/conky-meteo/icons/27.png ~/.cache/weather.png}${image ~/.cache/weather.png -p -1,1 -s 32x32}

Offline

#15 2015-12-05 11:55:52

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,008

Re: script and command in conky 1.10

@chepioq

Happy I could help.

@ohnonot

'ln' - interesting. I've never seen that before in a conky.

It didn't work for me - at first.  It uses whatever image was there last.
So I deleted the weather.png and did this:

Weather.png »»${execi 300 ln -s ~/conky-meteo/icons/27.png ~/conky-meteo/weather.png}${image ~/conky-meteo/weather.png -p 105,130 -s 32x32}\
${image ~/conky-meteo/icons/27.png -p 145,130 -s 32x32}${alignr 10}27



${image ~/conky-meteo/icons/27.png -p 5,175 -s 32x32}\
${image ~/conky-meteo/icons/28.png -p 45,175 -s 32x32}\
${image ~/conky-meteo/icons/29.png -p 85,175 -s 32x32}\
${image ~/conky-meteo/icons/30.png -p 125,175 -s 32x32}\
${image ~/conky-meteo/icons/31.png -p 164,175 -s 32x32}
 27    28    29    30    31

weather.png and 27.png look good.

Killed the conky and made a change:

Weather.png »»${execi 300 ln -s ~/conky-meteo/icons/30.png ~/.cache/weather.png}${image ~/.cache/weather.png -p 105,130 -s 32x32}\
${image ~/conky-meteo/icons/30.png -p 145,130 -s 32x32}${alignr 10}30

weather.png didn't change ...

Next I added the "-force" option ( ln -fs ) and  BINGO!

Weather.png »»${execi 300 ln -fs ~/conky-meteo/icons/31.png ~/conky-meteo/weather.png}${image ~/conky-meteo/weather.png -p 105,130 -s 32x32}\
${image ~/conky-meteo/icons/31.png -p 145,130 -s 32x32}${alignr 10}« 31

a composite image to show the results:
2015_12_05_08_31_15_Scrot11.jpg

Nice idea, another one for my archive.  Thank you ohnonot

Is there an advantage using 'ln' over 'cp' command other than to see if the 'cp -f' was the problem itself in v1.10?


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#16 2015-12-05 12:02:03

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,008

Re: script and command in conky 1.10

chepioq wrote:

With that, I think weather script is launch before conky start.

I'm horrible around LUA - my conky days are numbered.

But yes you are right.

lua_draw_hook_pre - before conky starts
lua_draw_hook_post - after conky starts

which means you can actually run 2 different LUA scripts - if you didn't want to merge them to 1 script

Glad your weather is working.


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#17 2015-12-05 17:42:00

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

Re: script and command in conky 1.10

Sector11 wrote:

which means you can actually run 2 different LUA scripts - if you didn't want to merge them to 1 script

I can merge two scripts lua in one with a wlourf script.

I have a calendar conky with with moon phase and two scripts lua (square_to_round.lua and calendar.lua)

The wlourf script :

--script by wlourf : http://u-scripts.blogspot.fr/2011/02/howto-run-multiple-lua-scripts-in-conky.html

package.path = "/home/dominique/.conkyrc/conky-calendrier/?.lua"
require 'calendar' --for script.lua ".lua" is not required here
require 'square_to_round'

function conky_loadAll()
     conky_calendar_box()
     conky_main('/home/dominique/.conkyrc/conky-calendrier/moon-phase/moon.jpg')
end

And I launch this script in my conky with :

lua_load = '/home/dominique/.conkyrc/conky-calendrier/loadAll.lua',
lua_draw_hook_post = 'loadAll',

And that work with conky 1.10

Offline

#18 2015-12-05 18:36:30

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

Re: script and command in conky 1.10

@ohnonot

I test your suggestion (ln -fs instead of cp -f in the script weather.sh), and that also work.

"ln -fs" is a little faster than "cp -f", for same result.

Offline

#19 2015-12-05 20:43:49

ohnonot
...again
Registered: 2015-09-29
Posts: 5,592

Re: script and command in conky 1.10

oh goody, i forgot the -f = force switch.

Sector11 wrote:

Is there an advantage using 'ln' over 'cp' command?

it should be a lot faster and thus mostly eliminate conky trying to access half-copied images.
it also saves disk space - although that is rarely a problem on a modern machine.
in the end it depends on the size of the image being copied.

but that didn't solve op's problem, either...? tbh, i lost track of what's going on.

Last edited by ohnonot (2021-07-04 08:15:24)

Offline

#20 2015-12-06 07:19:59

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

Re: script and command in conky 1.10

Hi all
I find how launch a bash script with lua.
My script is weather.sh

I create a lua script (weather.lua):

function conky_main()
  os.execute("/home/dominique/conky-meteo/weather.sh")
  end
  

and I launch this script in my conky with

lua_load = '/home/dominique/conky-meteo/weather.lua',
lua_draw_hook_pre = 'main',

If that help you.
lol

Offline

Board footer

Powered by FluxBB