Код: Выделить всё
conky.config = {
-------------------------------------
-- Generic Settings
-------------------------------------
background=true,
update_interval=1,
double_buffer=true,
no_buffers=true,
imlib_cache_size=10,
draw_shades=false,
draw_outline=false,
draw_borders=false,
draw_graph_borders=false,
default_graph_height=26,
default_graph_width=80,
show_graph_scale=false,
show_graph_range=false,
-------------------------------------
-- Window Specifications
-------------------------------------
gap_x=0,
gap_y=430,
minimum_height=270,
minimum_width=268,
own_window=true,
own_window_type="normal",
own_window_transparent=true,
own_window_hints="undecorated,below,sticky,skip_taskbar,skip_pager",
border_inner_margin=0,
border_outer_margin=0,
--alignment="middle_middle",
--own_window_argb_visual=true,
--own_window_argb_value=0,
-------------------------------------
-- Text Settings
-------------------------------------
use_xft=true,
xftalpha=1,
font="Droid Sans:size=10",
text_buffer_size=256,
override_utf8_locale=true,
-------------------------------------
-- Color Scheme
-------------------------------------
default_color="FFFFFF",
color1="FFFFFF",
color2="FFFFFF",
-------------------------------------
-- API Key
-------------------------------------
template6="******",
-------------------------------------
-- City ID
-------------------------------------
template7="******",
-------------------------------------
-- Temp Unit (default, metric, imperial)
-------------------------------------
template8="metric",
-------------------------------------
-- Locale (e.g. "es_ES.UTF-8")
-- Leave empty for default
-------------------------------------
template9="ru_RU.UTF-8"
}
---------------------------------------------------
---------------------------------------------------
conky.text = [[
\
\
${execi 300 l=${template9}; l=${l%%_*}; curl -s "api.openweathermap.org/data/2.5/forecast/daily?APPID=${template6}&id=${template7}&cnt=5&units=${template8}&lang=$l" -o ~/.cache/forecast.json}\
${execi 300 l=${template9}; l=${l%%_*}; curl -s "api.openweathermap.org/data/2.5/weather?APPID=${template6}&id=${template7}&cnt=5&units=${template8}&lang=$l" -o ~/.cache/weather.json}\
\
\
\
\
\
\
\
\
${color2}${voffset 149}${alignc 90}${execi 300 LANG=${template9} LC_TIME=${template9} date +%^a}
${color2}${voffset -17}${alignc}${execi 300 LANG=${template9} LC_TIME=${template9} date -d +1day +%^a}
${color2}${voffset -17}${alignc -90}${execi 300 LANG=${template9} LC_TIME=${template9} date -d +2day +%^a}
\
\
\
\
${color2}${voffset 53}${alignc 90}${execi 300 jq -r .list[0].temp.min ~/.cache/forecast.json | awk '{print int($1+0.5)}' # round num}°/${execi 300 jq -r .list[0].temp.max ~/.cache/forecast.json | awk '{print int($1+0.5)}' # round num}°
${color2}${voffset -17}${alignc}${execi 300 jq -r .list[1].temp.min ~/.cache/forecast.json | awk '{print int($1+0.5)}' # round num}°/${execi 300 jq -r .list[1].temp.max ~/.cache/forecast.json | awk '{print int($1+0.5)}' # round num}°
${color2}${voffset -17}${alignc -90}${execi 300 jq -r .list[2].temp.min ~/.cache/forecast.json | awk '{print int($1+0.5)}' # round num}°/${execi 300 jq -r .list[2].temp.max ~/.cache/forecast.json | awk '{print int($1+0.5)}' # round num}°
\
\
\
\
${color2}${alignr 54}${voffset -220}${execi 300 jq -r .main.humidity ~/.cache/weather.json | awk '{print int($1+0.5)}' # round num} %
${color2}${alignr 54}${voffset 10}${execi 300 jq -r .wind.speed ~/.cache/weather.json | awk '{print int($1+0.5)}' # round num}${if_match "$template8" == "metric"} m/s${else}${if_match "$template8" == "default"} m/s${else}${if_match "$template8" == "imperial"} mi/h${endif}${endif}${endif}
${color2}${alignr 54}${voffset 10}${execi 300 date -d "@$(jq -r .sys.sunrise ~/.cache/weather.json)" +%-H:%M\ %P}
${color2}${alignr 54}${voffset 10}${execi 300 date -d "@$(jq -r .sys.sunset ~/.cache/weather.json)" +%-H:%M\ %P}
${color1}${font LG Weather_Z:size=58}${goto 25}${voffset -80}${execi 300 jq -r .main.temp ~/.cache/weather.json | awk '{print int($1+0.5)}' # round num}°${font}\
${color1}${font Droid Sans :size=12}${goto 25}${voffset 56}${execi 300 jq -r .weather[0].description ~/.cache/weather.json | sed "s|\<.|\U&|g"}${font}\
\
\
\
\
${image ~/.harmattan-assets/misc/Transparent/Comfortable/humidity.png -p 224,0 -s 16x16}\
${image ~/.harmattan-assets/misc/Transparent/Comfortable/wind-2.png -p 224,30 -s 16x16}\
${image ~/.harmattan-assets/misc/Transparent/Comfortable/sunrise.png -p 224,53 -s 16x16}\
${image ~/.harmattan-assets/misc/Transparent/Comfortable/sunset.png -p 224,78 -s 16x16}\
${image ~/.harmattan-assets/separator-h.png -p 20,140 -s 220x2}\
${image ~/.harmattan-assets/line.png -p 165,0 -s 2x100}\
${execi 300 cp -f ~/.harmattan-assets/icons/#fff__32/$(jq .list[0].weather[0].id ~/.cache/forecast.json).png ~/.cache/weather-1.png}${image ~/.cache/weather-1.png -p 29,177 -s 32x32}\
${execi 300 cp -f ~/.harmattan-assets/icons/#fff__32/$(jq .list[1].weather[0].id ~/.cache/forecast.json).png ~/.cache/weather-2.png}${image ~/.cache/weather-2.png -p 118,177 -s 32x32}\
${execi 300 cp -f ~/.harmattan-assets/icons/#fff__32/$(jq .list[2].weather[0].id ~/.cache/forecast.json).png ~/.cache/weather-3.png}${image ~/.cache/weather-3.png -p 207,177 -s 32x32}${font}${voffset -24}\
]]