conky.config = {
alignment = 'top_right',
background = true,
color2 = 'ffffff',
cpu_avg_samples = 2,
default_color = 'ffffff',
draw_shades = false,
double_buffer = true,
font = 'Ubuntu:size=10',
gap_x = 10,
gap_y = 60,
minimum_width = 200,
no_buffers = true,
own_window = true,
own_window_type = 'desktop',
own_window_class = 'Conky',
own_window_transparent = true,
own_window_argb_visual = true,
own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager',
update_interval = 1.0,
use_xft = true,
}
conky.text = [[
#${voffset -8}${offset 23}${goto 35}${color 16A085}${font Droid Sans:size=28}Manjaro${color}${color 89C8CB}JWM${font}
#${voffset 5}${goto 72}${color ffffff}${font Droid Sans:size=11}light and beautiful${font}
${voffset -8}${goto 35}${color 4CB2F4}${font Droid Sans:size=38}${time %e}$font
$color${voffset -30}${goto 115}$color${font Droid Sans:size=18}${time %b}$font${voffset -6} $color${font Droid Sans:size=20}${time %Y}$font
${font Liberation Mono:size=11}${execpi 10800 DJS=`date +%-d`; cal | sed 's/^/${goto 32} /' | sed '1d' | sed s/" $DJS "/" "'${font Liberation Mono:size=11}${color 4CB2F4}'"$DJS"'${color}${font}${font Liberation Mono:size=11}'" "/}${font}${font}${voffset -14}
${goto 30}$stippled_hr
# Fixed the weather parsing peice
# You can build the command here:
# https://developer.yahoo.com/yql/console/?q=select%20*%20from%20weather.forecast%20where%20woeid%20%3D%201198989&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&debug=true#h=select+*+from+weather.forecast+where+woeid%3D2502265
${execi 300 curl -s "https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20weather.forecast%20where%20woeid%3D455912%20and%20u%3D'c'&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys" -o ~/.cache/weather.xml}
\
# Weather
\
${goto 36}${voffset 0}${font Droid Sans :size=36}${color1}${execi 300 grep "yweather:condition" ~/.cache/weather.xml | grep -o "temp=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}°${font}${color}
# I had to comment out this line - was printing out and overlaying.
#${goto 46}${voffset 14}${font Droid Sans :size=12}${color1}${execi 300 grep "yweather:condition" ~/.cache/weather.xml | grep -o "text=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}${font}${color}
\
${color3}${voffset 15}${alignc 77}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1' | tr '[a-z]' '[A-Z]'}${color}
${color3}${voffset -13}${alignc}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2' | tr '[a-z]' '[A-Z]'}${color}
${color3}${voffset -13}${alignc -77}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3' | tr '[a-z]' '[A-Z]'}${color}
\
${color2}${voffset 40}${alignc 77}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1'}°/${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1'}°${color}
${color2}${voffset -13}${alignc}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2'}°/${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2'}°${color}
${color2}${voffset -13}${alignc -77}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3'}°/${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3'}°${color}
${execi 300 cp -f ~/.conky/icons/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1').png ~/.cache/weather-1.png}${image ~/.cache/weather-1.png -p 28,348 -s 32x32}\
${execi 300 cp -f ~/.conky/icons/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2').png ~/.cache/weather-2.png}${image ~/.cache/weather-2.png -p 105,349 -s 32x32}\
${execi 300 cp -f ~/.conky/icons/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3').png ~/.cache/weather-3.png}${image ~/.cache/weather-3.png -p 180,349 -s 32x32}${font}\
${goto 30}$stippled_hr
${voffset 10}${goto 30}${color}CPU$alignr$cpu%
${goto 30}${cpubar 4}
${voffset 5}${goto 30}$color2${top name 1}$alignr${top cpu 1}%
${goto 30}$color2${top name 2}$alignr${top cpu 2}%
${goto 30}$color2${top name 3}$alignr${top cpu 3}%
${goto 30}$color2${top name 4}$alignr${top cpu 4}%
#
${voffset 10}${goto 30}${color}RAM$alignr$mem$font
${goto 30}${membar 4}
${voffset 5}${goto 30}$color2${top_mem name 1}$alignr${top_mem mem_res 1}
${goto 30}$color2${top_mem name 2}$alignr${top_mem mem_res 2}
${goto 30}$color2${top_mem name 3}$alignr${top_mem mem_res 3}
${goto 30}$color2${top_mem name 4}$alignr${top_mem mem_res 4}
${goto 30}$stippled_hr
${voffset 10}${goto 30}Root$alignr${fs_size /} | ${fs_used /}
${goto 30}Dados$alignr${fs_size /run/media/nathan/DADOS} | ${fs_used /run/media/nathan/DADOS}
#${goto 30}Swap$alignr$swapmax | $swap
#
${voffset -7}${if_existing /proc/net/route wlp3s0}
${goto 30}Connection${alignr}wiriless
${goto 30}Name${alignr}${wireless_essid}
${goto 30}Signal${alignr}${wireless_link_qual wlp3s0}%
${else}
${if_existing /proc/net/route enp6s0}
${voffset -17}${goto 30}Connection${alignr}cable
${else}
${voffset -17}${goto 30}Connection${alignr}no available
${endif}${endif}
#
${goto 30}$stippled_hr
${voffset 10}$alignr${color} Manjaro Linux ${execi 10000 awk -F'=' '/DISTRIB_RELEASE=/ {printf $2" "} /CODENAME/ {print $2}' /etc/lsb-release}
#
${alignr}${color2}${font Droid Sans:size=10}Uptime ${uptime_short}
${alignr}${color2}${font Droid Sans:size=10}${alignr}Kernel ${kernel}
${alignr}${color2}${font Droid Sans:size=10}${alignr}Architecture ${machine}
${alignr}${font Droid Sans:size=10}${alignr} ${execi 1200 /usr/bin/jwm_conky_wrapper}
${voffset -15}${alignr} updates currently available ${color ffffff}${font Droid Sans:bold:size=10}${execpi 10800 checkupdates | wc -l}${font}${color}
#${alignr} Updates currently ${font Droid Sans:bold:size=10}${execpi 10800 checkupdates | wc -l}${font}${color}
${voffset 0}${offset 23}${goto 35}${color 4CB2F4}${font Droid Sans:size=28}Manjaro${color}${color 89C8CB}JWM${font}
${voffset 5}${goto 72}${color ffffff}${font Droid Sans:size=11}light and beautiful${font}
]]
nathanmaia23 escreveu:Segue o meu conky modificado que eu uso no JWM:
- Código: Selecionar todos
conky.config = {
alignment = 'top_right',
background = true,
color2 = 'ffffff',
cpu_avg_samples = 2,
default_color = 'ffffff',
draw_shades = false,
double_buffer = true,
font = 'Ubuntu:size=10',
gap_x = 10,
gap_y = 60,
minimum_width = 200,
no_buffers = true,
own_window = true,
own_window_type = 'desktop',
own_window_class = 'Conky',
own_window_transparent = true,
own_window_argb_visual = true,
own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager',
update_interval = 1.0,
use_xft = true,
}
conky.text = [[
#${voffset -8}${offset 23}${goto 35}${color 16A085}${font Droid Sans:size=28}Manjaro${color}${color 89C8CB}JWM${font}
#${voffset 5}${goto 72}${color ffffff}${font Droid Sans:size=11}light and beautiful${font}
${voffset -8}${goto 35}${color 4CB2F4}${font Droid Sans:size=38}${time %e}$font
$color${voffset -30}${goto 115}$color${font Droid Sans:size=18}${time %b}$font${voffset -6} $color${font Droid Sans:size=20}${time %Y}$font
${font Liberation Mono:size=11}${execpi 10800 DJS=`date +%-d`; cal | sed 's/^/${goto 32} /' | sed '1d' | sed s/" $DJS "/" "'${font Liberation Mono:size=11}${color 4CB2F4}'"$DJS"'${color}${font}${font Liberation Mono:size=11}'" "/}${font}${font}${voffset -14}
${goto 30}$stippled_hr
# Fixed the weather parsing peice
# You can build the command here:
# https://developer.yahoo.com/yql/console/?q=select%20*%20from%20weather.forecast%20where%20woeid%20%3D%201198989&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&debug=true#h=select+*+from+weather.forecast+where+woeid%3D2502265
${execi 300 curl -s "https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20weather.forecast%20where%20woeid%3D455912%20and%20u%3D'c'&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys" -o ~/.cache/weather.xml}
\
# Weather
\
${goto 36}${voffset 0}${font Droid Sans :size=36}${color1}${execi 300 grep "yweather:condition" ~/.cache/weather.xml | grep -o "temp=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}°${font}${color}
# I had to comment out this line - was printing out and overlaying.
#${goto 46}${voffset 14}${font Droid Sans :size=12}${color1}${execi 300 grep "yweather:condition" ~/.cache/weather.xml | grep -o "text=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}${font}${color}
\
${color3}${voffset 15}${alignc 77}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1' | tr '[a-z]' '[A-Z]'}${color}
${color3}${voffset -13}${alignc}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2' | tr '[a-z]' '[A-Z]'}${color}
${color3}${voffset -13}${alignc -77}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3' | tr '[a-z]' '[A-Z]'}${color}
\
${color2}${voffset 40}${alignc 77}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1'}°/${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1'}°${color}
${color2}${voffset -13}${alignc}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2'}°/${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2'}°${color}
${color2}${voffset -13}${alignc -77}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3'}°/${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3'}°${color}
${execi 300 cp -f ~/.conky/icons/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1').png ~/.cache/weather-1.png}${image ~/.cache/weather-1.png -p 28,348 -s 32x32}\
${execi 300 cp -f ~/.conky/icons/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2').png ~/.cache/weather-2.png}${image ~/.cache/weather-2.png -p 105,349 -s 32x32}\
${execi 300 cp -f ~/.conky/icons/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3').png ~/.cache/weather-3.png}${image ~/.cache/weather-3.png -p 180,349 -s 32x32}${font}\
${goto 30}$stippled_hr
${voffset 10}${goto 30}${color}CPU$alignr$cpu%
${goto 30}${cpubar 4}
${voffset 5}${goto 30}$color2${top name 1}$alignr${top cpu 1}%
${goto 30}$color2${top name 2}$alignr${top cpu 2}%
${goto 30}$color2${top name 3}$alignr${top cpu 3}%
${goto 30}$color2${top name 4}$alignr${top cpu 4}%
#
${voffset 10}${goto 30}${color}RAM$alignr$mem$font
${goto 30}${membar 4}
${voffset 5}${goto 30}$color2${top_mem name 1}$alignr${top_mem mem_res 1}
${goto 30}$color2${top_mem name 2}$alignr${top_mem mem_res 2}
${goto 30}$color2${top_mem name 3}$alignr${top_mem mem_res 3}
${goto 30}$color2${top_mem name 4}$alignr${top_mem mem_res 4}
${goto 30}$stippled_hr
${voffset 10}${goto 30}Root$alignr${fs_size /} | ${fs_used /}
${goto 30}Dados$alignr${fs_size /run/media/nathan/DADOS} | ${fs_used /run/media/nathan/DADOS}
#${goto 30}Swap$alignr$swapmax | $swap
#
${voffset -7}${if_existing /proc/net/route wlp3s0}
${goto 30}Connection${alignr}wiriless
${goto 30}Name${alignr}${wireless_essid}
${goto 30}Signal${alignr}${wireless_link_qual wlp3s0}%
${else}
${if_existing /proc/net/route enp6s0}
${voffset -17}${goto 30}Connection${alignr}cable
${else}
${voffset -17}${goto 30}Connection${alignr}no available
${endif}${endif}
#
${goto 30}$stippled_hr
${voffset 10}$alignr${color} Manjaro Linux ${execi 10000 awk -F'=' '/DISTRIB_RELEASE=/ {printf $2" "} /CODENAME/ {print $2}' /etc/lsb-release}
#
${alignr}${color2}${font Droid Sans:size=10}Uptime ${uptime_short}
${alignr}${color2}${font Droid Sans:size=10}${alignr}Kernel ${kernel}
${alignr}${color2}${font Droid Sans:size=10}${alignr}Architecture ${machine}
${alignr}${font Droid Sans:size=10}${alignr} ${execi 1200 /usr/bin/jwm_conky_wrapper}
${voffset -15}${alignr} updates currently available ${color ffffff}${font Droid Sans:bold:size=10}${execpi 10800 checkupdates | wc -l}${font}${color}
#${alignr} Updates currently ${font Droid Sans:bold:size=10}${execpi 10800 checkupdates | wc -l}${font}${color}
${voffset 0}${offset 23}${goto 35}${color 4CB2F4}${font Droid Sans:size=28}Manjaro${color}${color 89C8CB}JWM${font}
${voffset 5}${goto 72}${color ffffff}${font Droid Sans:size=11}light and beautiful${font}
]]
Teste e veja se funciona bem para você.
PS: Recomendável o uso de resolução FullHD (1920 x 1080). Caso seu monitor/gpu não suporte esta resolução, você terá que ajustar manualmente as coordenadas de exibição dos ícones da previsão do tempo.
# Fixed the weather parsing peice
# You can build the command here:
# https://developer.yahoo.com/yql/console/?q=select%20*%20from%20weather.forecast%20where%20woeid%20%3D%201198989&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&debug=true#h=select+*+from+weather.forecast+where+woeid%3D2502265
${execi 300 curl -s "https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20weather.forecast%20where%20woeid%3D455912%20and%20u%3D'c'&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys" -o ~/.cache/weather.xml}
\
# Weather
\
${goto 36}${voffset 0}${font Droid Sans :size=36}${color1}${execi 300 grep "yweather:condition" ~/.cache/weather.xml | grep -o "temp=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}°${font}${color}
# I had to comment out this line - was printing out and overlaying.
#${goto 46}${voffset 14}${font Droid Sans :size=12}${color1}${execi 300 grep "yweather:condition" ~/.cache/weather.xml | grep -o "text=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}${font}${color}
\
${color3}${voffset 15}${alignc 77}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1' | tr '[a-z]' '[A-Z]'}${color}
${color3}${voffset -13}${alignc}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2' | tr '[a-z]' '[A-Z]'}${color}
${color3}${voffset -13}${alignc -77}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3' | tr '[a-z]' '[A-Z]'}${color}
\
${color2}${voffset 40}${alignc 77}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1'}°/${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1'}°${color}
${color2}${voffset -13}${alignc}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2'}°/${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2'}°${color}
${color2}${voffset -13}${alignc -77}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3'}°/${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3'}°${color}
${execi 300 cp -f ~/.conky/icons/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1').png ~/.cache/weather-1.png}${image ~/.cache/weather-1.png -p 28,348 -s 32x32}\
${execi 300 cp -f ~/.conky/icons/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2').png ~/.cache/weather-2.png}${image ~/.cache/weather-2.png -p 105,349 -s 32x32}\
${execi 300 cp -f ~/.conky/icons/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3').png ~/.cache/weather-3.png}${image ~/.cache/weather-3.png -p 180,349 -s 32x32}${font}\
${execi 300 curl -s "https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20weather.forecast%20where%20woeid%3D455912%20and%20u%3D'c'&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys" -o ~/.cache/weather.xml}
${goto 36}${voffset 0}${font Droid Sans :size=36}${color1}${execi 300 grep "yweather:condition" ~/.cache/weather.xml | grep -o "temp=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}°${font}${color}
${execi 300 curl -s " " -o ~/.cache/weather.xml}
nathanmaia23 escreveu:Ah, sim. Me esqueci de enviar os icones do widget de previsão do tempo. É por isso que está dando erro. Você pode tentar exibir só o número da temperatura atual sem os ícones.
O trecho referente ao widget de temperatura é este:
- Código: Selecionar todos
# Fixed the weather parsing peice
# You can build the command here:
# https://developer.yahoo.com/yql/console/?q=select%20*%20from%20weather.forecast%20where%20woeid%20%3D%201198989&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&debug=true#h=select+*+from+weather.forecast+where+woeid%3D2502265
${execi 300 curl -s "https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20weather.forecast%20where%20woeid%3D455912%20and%20u%3D'c'&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys" -o ~/.cache/weather.xml}
\
# Weather
\
${goto 36}${voffset 0}${font Droid Sans :size=36}${color1}${execi 300 grep "yweather:condition" ~/.cache/weather.xml | grep -o "temp=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}°${font}${color}
# I had to comment out this line - was printing out and overlaying.
#${goto 46}${voffset 14}${font Droid Sans :size=12}${color1}${execi 300 grep "yweather:condition" ~/.cache/weather.xml | grep -o "text=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}${font}${color}
\
${color3}${voffset 15}${alignc 77}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1' | tr '[a-z]' '[A-Z]'}${color}
${color3}${voffset -13}${alignc}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2' | tr '[a-z]' '[A-Z]'}${color}
${color3}${voffset -13}${alignc -77}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3' | tr '[a-z]' '[A-Z]'}${color}
\
${color2}${voffset 40}${alignc 77}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1'}°/${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1'}°${color}
${color2}${voffset -13}${alignc}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2'}°/${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2'}°${color}
${color2}${voffset -13}${alignc -77}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3'}°/${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3'}°${color}
${execi 300 cp -f ~/.conky/icons/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1').png ~/.cache/weather-1.png}${image ~/.cache/weather-1.png -p 28,348 -s 32x32}\
${execi 300 cp -f ~/.conky/icons/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2').png ~/.cache/weather-2.png}${image ~/.cache/weather-2.png -p 105,349 -s 32x32}\
${execi 300 cp -f ~/.conky/icons/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3').png ~/.cache/weather-3.png}${image ~/.cache/weather-3.png -p 180,349 -s 32x32}${font}\
Para exibir somente a temperatura atual, use este trecho:
- Código: Selecionar todos
${execi 300 curl -s "https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20weather.forecast%20where%20woeid%3D455912%20and%20u%3D'c'&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys" -o ~/.cache/weather.xml}
${goto 36}${voffset 0}${font Droid Sans :size=36}${color1}${execi 300 grep "yweather:condition" ~/.cache/weather.xml | grep -o "temp=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}°${font}${color}
O meu conky:
==Editado em 31 Out 2016, 15:18 ==
Você pode usar o conky original que eu usei para retirar o trecho do script responsável pelo clima.
Conky Zenzire
==Editado em 31 Out 2016, 15:45 ==
Vou tentar fazer um passo a passo mais fácil de entender:
1- Acesse Yahoo Weather;
2- Clique em "Change Location" e busque pela região que você deseja saber as informações do clima;
3- Copie o número no final da URL na barra de endereços do seu navegador. Este número é o 'woeid';
4- Entre neste link e substitua o número do 'woeid' pelo que você copiou no passo anterior;
5- Clique em 'Test' e copie tudo que está no campo de texto abaixo de 'THE REST QUERY' ;
6- Cole este endereço dentro das aspas na linha do conky e salve o arquivo:
- Código: Selecionar todos
${execi 300 curl -s " " -o ~/.cache/weather.xml}
7- Feche e abra denovo o conky, não esquecendo de posicionar as pastas 'icons' e 'images' dentro da pasta .conky no seu sistema, senão vai dar erro denovo. Você encontra essas pastas com os icones no github do conky zenzire.
Me desculpe se minha solução parece complicada demais para usar, mas essa foi a melhor solução que eu encontrei para resolver este problema que você ta tendo com o weather.com quando eu decidi usar o JWM como sistema principal.
execi
, pois ele consome recursos do PC.Tópicos Semelhantes | Estatísticas | Última mensagem | |
---|---|---|---|
como adicionar meu repositório github no pacman?por overlock » 16 Mai 2020, 19:54 |
Respostas: 2 Exibições: 353 |
17 Mai 2020, 10:39 por overlock |
Usuários navegando neste fórum: Nenhum usuário registrado e 2 visitantes