summaryrefslogtreecommitdiff
path: root/man/prognosis.1
blob: 75c276af6986c339ad6fec642e8ede1b5b7e3eb8 (plain) (blame)
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
.TH PROGNOSIS 1 "2026-08-21" "prognosis" "User Commands"
.SH NAME
prognosis \- hour-by-hour terminal forecast with official Polish warnings
.SH SYNOPSIS
.B prognosis
.RI [ options ]
.RI [ place ]
.SH DESCRIPTION
.B prognosis
prints an hourly weather table, a temperature chart, and \(em for locations in
Poland \(em the meteorological warnings IMGW has issued for that powiat.
.PP
It needs no API key and has no third-party dependencies. Which columns appear,
in what order, and in which language is set by the configuration file; columns
the program does not ship with can be declared there too, so any field the
underlying APIs expose can be displayed. See
.B CUSTOM COLUMNS .
.PP
Output is pipe-safe: colour is switched off when standard output is not a
terminal, notes and diagnostics go to standard error, and
.B \-ascii
restricts output to ASCII for onward transmission by SMS.
.SH OPTIONS
.TP
.BI \-l " PLACE"
Place to query: a name, or
.IR lat , lon .
Overrides
.B location
in the configuration file for one run.
.TP
.BI \-n " N"
Show
.I N
hours ahead.
.TP
.BI \-d " N"
Show
.I N
days ahead, of 24 hours each. Mutually exclusive with
.BR \-n .
.TP
.BI \-pick " N"
Choose the
.IR N th
candidate for an ambiguous place name, and remember it. Re-resolves rather than
reading the cache, which is how a wrongly cached name is corrected.
.TP
.BI \-columns " LIST"
Comma-separated columns to display, overriding the configuration file.
.TP
.BI \-icons " SET"
Glyph set for the
.B icon
column:
.BR nerd ,
.BR emoji ,
or
.BR none .
.TP
.BI \-pollen " LIST"
Allergens to show for one run: a comma-separated list, or
.B all
or
.BR none .
.TP
.BI \-lang " LANG"
Display language:
.B en
or
.BR pl .
.TP
.B \-weather
Forecast only: omit sun times, the day summary, pollen and the chart.
.TP
.B \-no\-warnings
Omit IMGW warnings.
.TP
.B \-no\-graph
Table only, no chart.
.TP
.B \-no\-color
Plain output, no escape sequences.
.TP
.B \-ascii
Restrict output to ASCII. Intended for SMS, where a single non-ASCII character
forces the message from GSM\-7 (160 characters per segment) into UCS\-2 (70).
The degree sign becomes the unit letter and Polish diacritics are transliterated.
.TP
.B \-svg
Produce an SVG meteogram instead of the hourly table. See
.BR METEOGRAM .
.TP
.BI \-o " PATH" ", " \-out " PATH"
Write to
.I PATH
instead of standard output.
.PP
.RS
If
.I PATH
is an existing directory, or ends in a separator (in which case it is created),
a filename is generated from the place and the date, so repeated runs on
different days do not overwrite each other:
.IR krakow-pl-2026-08-27.svg .
Otherwise
.I PATH
is a filename, gaining
.B .svg
or
.B .txt
if it has none. A single
.B -
means standard output.
.PP
Colour is omitted when writing to a file, whatever the terminal would have
shown.
.RE
.TP
.B \-config
Print the path of the configuration file and exit.
.TP
.B \-version
Print the version and exit.
.SH CONFIGURATION
The configuration file is
.I $XDG_CONFIG_HOME/prognosis/config
(by default
.IR ~/.config/prognosis/config ).
It is written with commented defaults on first run. The format is one
.I KEY=VALUE
per line;
.B #
begins a comment; values are not quoted.
.PP
Command line flags override the file, and the file overrides the built-in
defaults.
.TP
.B location
Place to query. Required: prognosis has no other way to know where you are and
will not guess.
.TP
.B hours
Default span in hours.
.TP
.B units
.BR metric ", " imperial " or " si .
Passed to the provider, so rounding is theirs. Warning thresholds are always
compared in Celsius, whatever the display units.
.TP
.B columns
Columns to display, in order.
.TP
.B icons
.BR nerd ", " emoji " or " none .
.TP
.B graph ", " graph_height
Whether to draw the temperature chart, and over how many rows.
.TP
.B warnings
Whether to check IMGW for warnings.
.TP
.B pollen
Which allergens to report, or whether to report any:
.B none
omits the line entirely,
.B all
shows every species that has a reading, and a comma-separated list shows exactly
those species \(em even at zero, since a species you named is one you react to
and "none today" is the answer you wanted. With
.B all
nobody chose, so absent species are dropped rather than printing a line of
zeroes. Species:
.BR grass ", " birch ", " alder ", " mugwort ", " ragweed ", " olive .
.TP
.B color
.BR auto ", " always " or " never .
.TP
.B display_lang
.BR en " or " pl .
Covers everything prognosis writes itself. IMGW publishes its warning text in
Polish only, so that text remains Polish in either language.
.TP
.B ascii
Restrict output to ASCII, as
.BR \-ascii .
.SH COLUMNS
Built-in columns:
.BR hour ", " icon ", " temp ", " feels ", " conditions ", " mm ", " rain ", "
.BR wind ", " gusts ", " dir ", " humidity ", " dew ", " uv ", " cloud ", "
.BR pressure ", " visibility .
.PP
Only the fields the selected columns need are requested, so a narrow table
costs a smaller response. An unknown column name is an error at startup naming
the offender, never a silently blank column.
.PP
.B mm
and
.B rain
are hidden automatically when the window is dry and no hour reaches a 20%
chance of precipitation, and the day summary says
.I dry
instead.
.SH CUSTOM COLUMNS
Any field the two Open-Meteo APIs expose can be displayed, whether or not
prognosis knows about it. Declare a short name, then use it in
.BR columns .
.PP
.in +4n
.EX
columns=hour,temp,birch,soil,conditions

column.birch = air:birch_pollen
column.soil  = forecast:soil_temperature_0cm

label.soil     = soil
suffix.soil    = \(de
decimals.soil  = 0
label.birch    = birch
decimals.birch = 1
.EE
.in
.PP
.B column.\fINAME\fB = \fISOURCE\fB:\fIFIELD\fR
is the declaration.
.I SOURCE
is
.B forecast
(the weather API) or
.B air
(the air-quality API, which carries the allergens); they are separate services
with separate field sets, which is why the source must be given. An
.B air
column costs one extra request, made only when such a column is declared.
.PP
The remaining keys are optional:
.B label.\fINAME\fR
sets the header (default: the name),
.B width.\fINAME\fR
the column width (default: derived from the label),
.B decimals.\fINAME\fR
the digits after the point (default: 0), and
.B suffix.\fINAME\fR
a string appended to each value.
.PP
A custom name may not shadow a built-in column. A value the API does not supply
renders blank rather than as zero: for an allergen, "no data" and "none" are
different claims.
.SH METEOGRAM
.B \-svg
writes a standalone SVG: three panels sharing one time axis \(em temperature
with the apparent temperature dashed, precipitation as bars with the
probability as a dashed line against its own right-hand axis, and relative
humidity \(em over shaded night bands, with dates marked at midnight.
.PP
No plotting library or external program is involved: SVG is markup, so this
works on a machine with no graphics tooling at all.
.PP
.in +4n
.EX
prognosis \-l Krakow \-d 2 \-svg meteogram.svg
firefox meteogram.svg
rsvg\-convert \-o meteogram.png meteogram.svg
.EE
.in
.PP
The meteogram requests the fields it needs regardless of
.BR columns ,
so it is complete even when the table shows none of them.
.PP
Not every viewer reads from a pipe.
.BR feh (1)
does, given
.BR - ,
and so does
.BR chafa (1);
.BR nsxiv (1)
has no standard-input mode at all and prints its usage, which does not make the
cause obvious. Write the file first with
.B \-o
for those:
.PP
.in +4n
.EX
prognosis \-l Krakow \-svg | feh -
prognosis \-l Krakow \-svg | chafa
prognosis \-l Krakow \-svg \-o ~/tmp && nsxiv ~/tmp/krakow-pl-*.svg
.EE
.in
.PP
Most viewers handle the file itself, including
.BR nsxiv (1),
.BR feh (1),
.BR display (1)
and any browser, or
.BR chafa (1)
to draw it inside the terminal.
.BR convert (1)
may fall back to ImageMagick's own SVG renderer, which drops the curves;
.BR rsvg-convert (1)
does not.
.SH WARNINGS
IMGW publishes every warning in Poland, each tagged with the TERYT codes of the
powiats it covers. The coordinates are resolved to that code through GUGiK, so
warnings are filtered to your area rather than the whole country.
.PP
Four states are kept deliberately distinct, because silence must never be
mistaken for an all-clear:
.TP
warnings printed
In force for your powiat.
.TP
nothing printed
Checked; none in force.
.TP
.I warnings: could not check IMGW
The check itself failed.
.TP
.I warnings: IMGW covers Poland only
The location is outside Poland.
.SH FILES
.TP
.I ~/.config/prognosis/config
Configuration.
.TP
.I ~/.cache/prognosis/cache.json
Cached geocoding and TERYT lookups, one entry per line. Disposable: an entry
that will not parse is skipped and the rest kept; a file that will not parse at
all is moved aside to
.I cache.json.bad
rather than overwritten.
.SH EXIT STATUS
.TP
.B 0
Success.
.TP
.B 1
The forecast could not be fetched.
.TP
.B 2
Usage error: bad flags, an invalid configuration, no location set, or an
ambiguous place name.
.SH EXAMPLES
.TP
.B prognosis
The next twelve hours where you live.
.TP
.B prognosis \-l krakow \-d 3
Three days for another place.
.TP
.B prognosis \-weather \-ascii \-no\-warnings \-n 6
A short, ASCII-only forecast suitable for sending by SMS.
.SH SEE ALSO
.BR wego (1)
.PP
Data from Open-Meteo (https://open-meteo.com/), GUGiK
(https://services.gugik.gov.pl/) and IMGW (https://danepubliczne.imgw.pl/).
.SH AUTHOR
Lukasz Kasprzak.