-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathforecast.conky
87 lines (76 loc) · 4.38 KB
/
forecast.conky
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
conky.config = {
background = false,
minimum_width = 620,
minimum_height = 280,
alignment = 'middle_middle',
gap_x = 660,
gap_y = -80,
draw_borders = false,
border_width = 0,
draw_shades = false,
draw_outline = false,
draw_graph_borders = false,
double_buffer = true,
no_buffers = true,
text_buffer_size = 256,
imlib_cache_size = 10,
max_user_text = 15000,
format_human_readable = true,
own_window = true,
own_window_type = 'dock',
own_window_transparent = true,
own_window_argb_visual = true,
own_window_argb_value = 50,
own_window_colour = '000000',
own_window_hints = 'undecorated,sticky,below,skip_taskbar,skip_pager',
own_window_title = 'Weather-Forecast',
override_utf8_locale = true,
use_xft = true,
font = 'Poiret One:size=12',
update_interval = 101,
cpu_avg_samples = 2,
net_avg_samples = 2,
diskio_avg_samples = 2,
color0 = 'ffffff',
lua_load = '~/.conky/transparent-image.lua',
-------------------------------------
-- API Key
-------------------------------------
template6="EnterYourAPIKeyHere",
-------------------------------------
-- City Lat template7 and Long template5
-------------------------------------
template7="45.4334", template5="-76.3494",
-------------------------------------
-- Temp Unit (default, metric, imperial)
-------------------------------------
template8="metric",
-------------------------------------
-- Locale (e.g. "es_ES.UTF-8")
-- Leave empty for default
-------------------------------------
template9="en_US.UTF-7" --character encoding protocol
};
conky.text = [[
${execi 300 l=${template9}; l=${l%%_*}; curl -s "api.openweathermap.org/data/3.0/onecall?lat=$template7&lon=$template5&exclude=hourly,minutely,alerts&units=metric&appid=$template6" -o ~/.conky/json/weather.json}\
${alignc}${font Poiret One:size=32}${time %A, %B %e}
#current temperature then max temps each day
${font Poiret One:size=16}
${goto 38}${execi 300 jq -r .current.temp ~/.conky/json/weather.json | awk '{printf ("%.0f\n",$1)}' # round num}°${goto 168}${execi 300 jq .daily[1].temp.max ~/.conky/json/weather.json | awk '{printf ("%.0f\n",$1)}' # round num}°${goto 298}${voffset -2}${execi 300 jq .daily[2].temp.max ~/.conky/json/weather.json | awk '{printf ("%.0f\n",$1)}' # round num}°${goto 428}${execi 300 jq .daily[3].temp.max ~/.conky/json/weather.json | awk '{printf ("%.0f\n",$1)}' # round num}°${goto 558}${execi 300 jq .daily[4].temp.max ~/.conky/json/weather.json | awk '{printf ("%.0f\n",$1)}' # round num}°
${voffset 32}
#min temps each day skipping first day
${goto 204}${execi 300 jq .daily[1].temp.min ~/.conky/json/weather.json | awk '{printf ("%.0f\n",$1)}' # round num}°${goto 334}${execi 300 jq .daily[2].temp.min ~/.conky/json/weather.json | awk '{printf ("%.0f\n",$1)}' # round num}°${goto 464}${execi 300 jq .daily[3].temp.min ~/.conky/json/weather.json | awk '{printf ("%.0f\n",$1)}' # round num}°${goto 594}${execi 300 jq .daily[4].temp.min ~/.conky/json/weather.json | awk '{printf ("%.0f\n",$1)}' # round num}°
\
${execi 300 cp -f ~/.conky/images/$(jq -r .current.weather[].id ~/.conky/json/weather.json).png ~/.conky/images/weather-1.png}${lua conky_image ./images/weather-1.png 22 62 38 38}
${execi 300 cp -f ~/.conky/images/$(jq .daily[1].weather[].id ~/.conky/json/weather.json).png ~/.conky/images/forecast-1.png}${lua conky_image ./images/forecast-1.png 82 62 38 38}\
${execi 300 cp -f ~/.conky/images/$(jq .daily[2].weather[].id ~/.conky/json/weather.json).png ~/.conky/images/forecast-2.png}${lua conky_image ./images/forecast-2.png 142 62 38 38}\
${execi 300 cp -f ~/.conky/images/$(jq .daily[3].weather[].id ~/.conky/json/weather.json).png ~/.conky/images/forecast-3.png}${lua conky_image ./images/forecast-3.png 202 62 38 38}\
${execi 300 cp -f ~/.conky/images/$(jq .daily[4].weather[].id ~/.conky/json/weather.json).png ~/.conky/images/forecast-4.png}${lua conky_image ./images/forecast-4.png 262 62 38 38}\
\
${voffset -2}${color0}\
${goto 54}${execi 300 LANG=${template9} LC_TIME=${template9} date +%^a}\
${goto 184}${execi 300 LANG=${template9} LC_TIME=${template9} date -d +1day +%^a}\
${goto 314}${execi 300 LANG=${template9} LC_TIME=${template9} date -d +2days +%^a}\
${goto 444}${execi 300 LANG=${template9} LC_TIME=${template9} date -d +3days +%^a}\
${goto 574}${execi 300 LANG=${template9} LC_TIME=${template9} date -d +4days +%^a}\
]];