• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

screenshot/H03-May-2022-

AUTHORSH A D14-Sep-2021102 63

ChangeLogH A D14-Sep-20214.6 KiB17399

LICENSEH A D14-Sep-20211.3 KiB2520

README.mdH A D14-Sep-20215.6 KiB264155

ansiweatherH A D03-May-202210.8 KiB445294

ansiweather.1H A D14-Sep-20213.1 KiB133132

ansiweather.plugin.zshH A D14-Sep-202134 21

ansiweatherrc.exampleH A D14-Sep-2021921 4440

README.md

1## Description
2
3AnsiWeather is a Shell script for displaying the current weather conditions
4in your terminal, with support for ANSI colors and Unicode symbols.
5
6![AnsiWeather Screenshot][1]
7
8Weather data comes from the `OpenWeatherMap` free weather API.
9
10
11
12## Requirements
13
14AnsiWeather requires the following dependencies:
15
16- A command to fetch HTTP data such as FTP, cURL or wget
17- [jq][2] (lightweight and flexible command-line JSON processor)
18- [bc][3] (arbitrary precision numeric processing language), for doing float
19  arithmetic
20
21
22
23## Installation
24
25After cloning the repository, simply invoke the script by typing:
26
27	./ansiweather
28
29AnsiWeather packages are available for:
30
31- [OpenBSD][4]
32- [NetBSD][5]
33- [FreeBSD][6]
34- [Debian][7]
35- [Ubuntu][8]
36- [Homebrew][9]
37
38
39
40## Usage
41
42### Synopsis
43
44	ansiweather [-l location] [-u system] [-f days] [-F] [-a value]
45	            [-s value] [-k key] [-i value] [-w value] [-h value]
46	            [-H value] [-p value] [-d value] [-v]
47
48### Options
49
50	-l location
51	        Specify location.
52
53	-u system
54	        Specify unit system to use ( metric or imperial ).
55
56	-f days
57	        Toggle forecast mode for the specified number of upcoming days.
58
59	-F      Toggle forecast mode for the next five days.
60
61	-a value
62	        Toggle ANSI colors display ( true or false ).
63
64	-s value
65	        Toggle symbols display ( true or false ).
66
67	-k key  Specify OpenWeatherMap API key.
68
69	-i value
70	        Toggle UV Index display ( true or false ).
71
72	-w value
73	        Toggle wind data display ( true or false ).
74
75	-h value
76	        Toggle humidity data display ( true or false ).
77
78	-H value
79	        Toggle Feels like display ( true or false ).
80
81	-p value
82	        Toggle pressure data display ( true or false ).
83
84	-d value
85	        Toggle daylight data display ( true or false ).
86
87	-v      Display version.
88
89### Examples
90
91Display forecast using metric units for the next five days (showing symbols
92and daylight data) for Rzeszow, Poland:
93
94	ansiweather -l Rzeszow,PL -u metric -s true -f 5 -d true
95
96
97
98## Configuration
99
100The default config file is ~/.ansiweatherrc. The environment variable
101ANSIWEATHERRC can be set to override this. The following configuration
102options (detailed below) are available and should be set according to
103your location and preferences.
104
105Example: `~/.ansiweatherrc`
106
107	location:Rzeszow,PL
108	fetch_cmd:ftp -V -o -
109	units:metric
110	show_daylight:true
111
112The file `ansiweatherrc.example` contains all available configuration
113variables.
114
115### Location
116
117Location format is `city,CC` where `CC` is a two-letter ISO 3166-1 alpha-2
118country code. A list of country codes is available [here][10].
119Alternatively, it's also possible to specify locations by their ID, a city
120list is available [here][11].
121
122In case no location is specified, AnsiWeather will fallback to the default
123location.
124
125Example: `Rzeszow,PL`
126
127	location:Rzeszow,PL
128
129### Fetch Command
130
131Various tools can be used to fetch data: `curl`, `wget`, `ftp`.
132
133Please note that `ftp` flags and options might differ among implementations
134and versions, and the example provided here is known to work only on OpenBSD
135and NetBSD.
136
137Example: `curl -sf`
138
139	fetch_cmd:curl -sf
140
141Example: `wget -qO-`
142
143	fetch_cmd:wget -qO-
144
145Example: `ftp -V -o -`
146
147	fetch_cmd:ftp -V -o -
148
149Default: `curl -sf`
150
151### System of Units
152
153Both `metric` and `imperial` systems are supported.
154
155	units:metric
156
157Default: `metric`
158
159### Display ANSI sequences
160
161Toggle ANSI sequences display. Value can be either `true` (requires an ANSI
162capable display) or `false`.
163
164	ansi:true
165
166Default: `true`
167
168### Display symbols
169
170Toggle Unicode symbols display. Value can be either `true` (requires a
171Unicode capable display) or `false`.
172
173	symbols:true
174
175Default: `false`
176
177Symbols can be configured or replaced by custom text using the following
178configuration variables: `sun`, `moon`, `clouds`, `rain`, `fog`, `mist`,
179`haze`, `snow`, `thunderstorm`.
180
181### Display forecast
182
183Show upcoming forecast for the next `N` days (for 0 <= N <= 7). `0` will
184show standard output.
185
186	forecast:5
187
188Default: `0`
189
190### Display wind / humidity / pressure
191
192Toggle UV Index, wind, humidity, and/or pressure display. Values can be either
193`true` or `false`.
194
195	show_uvi:true
196	show_wind:true
197	show_humidity:true
198	show_pressure:true
199
200Default: `true`
201
202### Display sunrise / sunset
203
204Toggle daylight display. Value can be either `true` or `false`.
205
206	show_daylight:false
207
208Default: `false`
209
210### Date and Time format
211
212Configure date and time format display. See Unix date formatting docs
213for details.
214
215	dateformat:%a %b %d
216
217Default: `%a %b %d`
218
219	timeformat:%b %d %r
220
221Default: `%b %d %r`
222
223### OpenWeatherMap API key
224
225Specify an OpenWeatherMap API key. By default AnsiWeather uses its own
226key, but users can optionally get their own one by creating a free
227[OpenWeatherMap account][12].
228
229	api_key:85a4e3c55b73909f42c6a23ec35b7147
230
231
232
233## License
234
235AnsiWeather is released under the BSD 2-Clause license. See `LICENSE` file
236for details.
237
238
239
240## Author
241
242AnsiWeather is developed by Frederic Cambus.
243
244- Site: https://www.cambus.net
245
246
247
248## Resources
249
250GitHub: https://github.com/fcambus/ansiweather
251
252[1]: https://www.cambus.net/files/ansiweather/ansiweather.png
253[2]: https://stedolan.github.io/jq/
254[3]: https://www.gnu.org/software/bc/
255[4]: https://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/astro/ansiweather
256[5]: https://pkgsrc.se/misc/ansiweather
257[6]: https://www.freshports.org/misc/ansiweather
258[7]: https://packages.debian.org/search?keywords=ansiweather
259[8]: https://packages.ubuntu.com/search?keywords=ansiweather
260[9]: https://formulae.brew.sh/formula/ansiweather
261[10]: https://www.statdns.com/cctlds/
262[11]: https://bulk.openweathermap.org/sample/
263[12]: https://home.openweathermap.org/users/sign_up
264