-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.conkyrc2
103 lines (84 loc) · 4.25 KB
/
.conkyrc2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
conky.config = {
background=true,
update_interval = 1,
double_buffer = true,
no_buffers = true,
imlib_cache_size = 0,
draw_shades = false,
draw_outline = false,
draw_borders = false,
draw_graph_borders = false,
own_window = true,
own_window = true,
own_window_type = 'normal',
own_window_transparent = true,
own_window_hints = 'undecorated,sticky,skip_taskbar,skip_pager,below',
own_window_argb_visual = true,
own_window_argb_value = 180,
use_xft = true,
xftalpha = 0,
-- Default font
font = 'Droid Sans:size=10',
text_buffer_size = 256,
override_utf8_locale = true,
default_color = '#FFFFFF',
minimum_width = 220,
maximum_width = 220,
minimum_height = 300,
-- Widget alignment
alignment = top_right,
gap_x = 1200,
gap_y = 1000,
-- Icons theme location
template1 = '~/.weather-assets/themes/default',
-- Text locale
template2 = 'zh_CN',
-- Location code.See https://weather.codes/
template3 = 'CHXX0015',
-- Temp Unit (m - metric, i - imperial)
template4 = "m",
}
conky.text = [[
\
${execi 300 curl -s "http://wxdata.weather.com/wxdata/weather/local/$template3?cc=*&unit=$template4&dayf=3&locale=$template2" -o ~/.cache/forecast.xml}\
\
# Сurrent weather text
${alignr 40}${voffset 15} ${execi 310 awk -F'[<|>]' '/<r/{print $3}' ~/.cache/forecast.xml}
${alignr 40}${voffset 15} ${execi 310 awk -F'[<|>]' '/<hmid/{print $3}' ~/.cache/forecast.xml | sed -n -e '1{p;q}'} %\
${if_match "$template4" == "m"}
${alignr 40}${voffset 15}${execi 310 awk -F'[<|>]' '/<s>/{printf "%d\n", $3*1000/3600}' ~/.cache/forecast.xml | sed -n -e '1{p;q}'} m/s
${endif}\
${if_match "$template4" == "i"}
${alignr 40}${voffset 15}${execi 310 awk -F'[<|>]' '/<s>/{print $3}' ~/.cache/forecast.xml | sed -n -e '1{p;q}'} mi/h
${endif}\
${alignr 40}${voffset 15} ${execi 310 awk -F'[<|>]' '/<sunr>/{print $3}' ~/.cache/forecast.xml | sed -n -e '1{p;q}'}
${alignr 40}${voffset 15} ${execi 310 awk -F'[<|>]' '/<suns>/{print $3}' ~/.cache/forecast.xml | sed -n -e '1{p;q}'}\
# Сurrent weather images
${image $template1/pressure.png -p 190,15 -s 16x16}\
${image $template1/humidity.png -p 190,45 -s 16x16}\
${image $template1/wind.png -p 190,75 -s 16x16}\
${image $template1/sunrise.png -p 190,105 -s 16x16}\
${image $template1/sunset.png -p 190,135 -s 16x16}\
\
# Current weather condition icon
${execi 310 cp -f $template1/weather-icons/$(awk -F'[<|>]' '/<icon>/{print $3}' ~/.cache/forecast.xml | sed -n -e '1{p;q}').png ~/.cache/c_weather.png}
${image ~/.cache/c_weather.png -p 0,25 -s 64x64}\
\
\
# Current weather condition
${font Droid Sans:size=48}${goto 0}${voffset -50}${execi 310 awk -F'[<|>]' '/tmp>/{print $3}' ~/.cache/forecast.xml}°${font}\
${font Droid Sans:size=12}${goto 0}${voffset 30} ${execi 310 awk -F'[<|>]' '/<t>/{print $3}' ~/.cache/forecast.xml | sed -n -e '1{p;q}'}${font}\
# Day names
${voffset 30}${alignc 70}${execi 310 LANG=${template2} LC_TIME=${template2} date +%^a}\
${alignc}${execi 310 LANG=${template2} LC_TIME=${template2} date -d +1day +%^a}\
${alignc -70}${execi 310 LANG=${template2} LC_TIME=${template2} date -d +2day +%^a}\
${execi 310 cp -f $template1/weather-icons/$(awk -F'[<|>]' '/<icon>(.+)<\/icon>/{print $3}' ~/.cache/forecast.xml | sed -n -e '3{p;q}').png ~/.cache/n1_weather.png}\
${image ~/.cache/n1_weather.png -p 0,245 -s 32x32}\
${execi 310 cp -f $template1/weather-icons/$(awk -F'[<|>]' '/<icon/{print $3}' ~/.cache/forecast.xml | sed -n -e '5{p;q}').png ~/.cache/n2_weather.png}\
${image ~/.cache/n2_weather.png -p 82,245 -s 32x32}\
${execi 310 cp -f $template1/weather-icons/$(awk -F'[<|>]' '/<icon/{print $3}' ~/.cache/forecast.xml | sed -n -e '7{p;q}').png ~/.cache/n3_weather.png}\
${image ~/.cache/n3_weather.png -p 164,245 -s 32x32}\
${voffset 5}${goto 0} ${execi 310 awk -F'[<|>]' '/<low>/{print $3}' ~/.cache/forecast.xml | sed -n -e '1{p;q}'}°/ ${execi 310 awk -F'[<|>]' '/<hi>/{print $3}' ~/.cache/forecast.xml | sed -n -e '1{p;q}'}°\
${goto 75} ${execi 310 awk -F'[<|>]' '/<low>/{print $3}' ~/.cache/forecast.xml | sed -n -e '2{p;q}'}°/ ${execi 310 awk -F'[<|>]' '/<hi>/{print $3}' ~/.cache/forecast.xml | sed -n -e '2{p;q}'}°\
${goto 160} ${execi 310 awk -F'[<|>]' '/<low>/{print $3}' ~/.cache/forecast.xml | sed -n -e '3{p;q}'}°/ ${execi 310 awk -F'[<|>]' '/<hi>/{print $3}' ~/.cache/forecast.xml | sed -n -e '3{p;q}'}°\
]];