polybar/modules/weather.ini 1.5 K raw
1
; Weather from the US National Weather Service, via ../scripts/weather.
2
; Nothing here needs an API key -- api.weather.gov is open -- but it is US-only,
3
; and the script wants NWS_UA pointed at a real contact address.
4
5
[module/weather]
6
type = custom/script
7
8
; scripts/ is symlinked into ~/.config/polybar the same way rofi/scripts is.
9
exec = ~/.config/polybar/scripts/weather
10
; Opens $TERMINAL (wezterm if polybar did not inherit one) on `linecast weather`.
11
click-left = ~/.config/polybar/scripts/weather detail
12
13
; The script serves a cached line until NWS_INTERVAL (15 minutes) is up, so
14
; polling this often costs a file read, not a request. It only sets how soon a
15
; refreshed line reaches the bar.
16
interval = 300
17
18
; The palette stays in colors.ini; the script prints plain text unless told
19
; otherwise, so pass the two colours it uses in from here.
20
env-NWS_ICON_COLOR = ${colors.primary}
21
env-NWS_ALERT_COLOR = ${colors.alert}
22
23
; Required: the script does no geolocation, so the module stays blank until
24
; both of these name a spot inside NWS coverage. They have to live here rather
25
; than in the shell profile -- polybar is started by the session, not by a login
26
; shell, so nothing exported from ~/.zshrc reaches it. Put a real address in
27
; NWS_UA too -- NWS asks for one it can contact about a misbehaving client.
28
env-NWS_LAT = 35.0274
29
env-NWS_LON = -85.3184
30
; env-NWS_UA = (dotfiles polybar, you@example.com)
31
32
format = <label>
33
format-background = ${colors.background}
34
format-padding = 1
35
36
label = %output%
37
38
; vim:ft=dosini