Zurück zum Ranking

fcambus/ansiweather

Shell

Weather in terminal, with ANSI colors and Unicode symbols

weatherterminalansiunicode
Sterne-Wachstum
Sterne
1.9k
Forks
146
Wochenwachstum
Issues
0
1k1.5k
Okt. 2013Jan. 2018Apr. 2022Juli 2026
README

Description

AnsiWeather is a Shell script for displaying the current weather conditions in your terminal, with support for ANSI colors and Unicode symbols.

AnsiWeather Screenshot

Weather data comes from the OpenWeatherMap free weather API.

Requirements

AnsiWeather requires the following dependencies:

  • A command to fetch HTTP data such as FTP, cURL or wget
  • jq (lightweight and flexible command-line JSON processor)
  • bc (arbitrary precision numeric processing language), for doing float arithmetic

Installation

After cloning the repository, simply invoke the script by typing:

./ansiweather

AnsiWeather packages are available for:

Usage

Synopsis

ansiweather [-l location] [-u system] [-f days] [-F] [-a value]
            [-s value] [-k key] [-i value] [-w value] [-h value]
            [-H value] [-p value] [-d value] [-v]

Options

-l location
        Specify location.

-u system
        Specify unit system to use ( metric or imperial ).

-f days
        Toggle forecast mode for the specified number of upcoming days.

-F      Toggle forecast mode for the next five days.

-a value
        Toggle ANSI colors display ( true or false ).

-s value
        Toggle symbols display ( true or false ).

-k key  Specify OpenWeatherMap API key.

-i value
        Toggle UV Index display ( true or false ).

-w value
        Toggle wind data display ( true or false ).

-h value
        Toggle humidity data display ( true or false ).

-H value
        Toggle Feels like display ( true or false ).

-p value
        Toggle pressure data display ( true or false ).

-d value
        Toggle daylight data display ( true or false ).

-v      Display version.

Examples

Display forecast using metric units for the next five days (showing symbols and daylight data) for Rzeszow, Poland:

ansiweather -l "Rzeszow,PL" -u metric -s true -f 5 -d true

Configuration

Configuration is loaded from the following locations, in order:

  1. The file specified by the ANSIWEATHERRC environment variable, if set.
  2. $XDG_CONFIG_HOME/ansiweather/config
  3. ~/.config/ansiweather/config
  4. ~/.ansiweatherrc

The following configuration options (detailed below) are available and should be set according to your location and preferences.

Example: ~/.config/ansiweather/config

location:Rzeszow,PL
fetch_cmd:ftp -V -o -
units:metric
show_daylight:true

The file ansiweatherrc.example contains all available configuration variables.

Location

Location format is city,CC where CC is a two-letter ISO 3166-1 alpha-2 country code. A list of country codes is available here. Alternatively, it's also possible to specify locations by their ID, a city list is available here.

In case no location is specified, AnsiWeather will fallback to the default location.

Example: Rzeszow,PL

location:Rzeszow,PL

Fetch Command

Various tools can be used to fetch data: curl, wget, ftp.

Please note that ftp flags and options might differ among implementations and versions, and the example provided here is known to work only on OpenBSD and NetBSD.

Example: curl -sf

fetch_cmd:curl -sf

Example: wget -qO-

fetch_cmd:wget -qO-

Example: ftp -V -o -

fetch_cmd:ftp -V -o -

Default: curl -sf

System of Units

Both metric and imperial systems are supported.

units:metric

Default: metric

Display ANSI sequences

Toggle ANSI sequences display. Value can be either true (requires an ANSI capable display) or false.

ansi:true

Default: true

Display symbols

Toggle Unicode symbols display. Value can be either true (requires a Unicode capable display) or false.

symbols:true

Default: false

Symbols can be configured or replaced by custom text using the following configuration variables: sun, moon, clouds, rain, fog, mist, haze, snow, thunderstorm.

Display forecast

Show upcoming forecast for the next N days (for 0 <= N <= 7). 0 will show standard output.

forecast:5

Default: 0

Display Feels like

Toggle "Feels like" display. Value can be either true or false.

show_feels_like:false

Default: false

Display UV Index / wind / humidity / pressure

Toggle UV Index, wind, humidity, and/or pressure display. Values can be either true or false.

The UV Index represents a single daily value rather than the UV Index at the current time.

show_uvi:true
show_wind:true
show_humidity:true
show_pressure:true

Default: true

Display sunrise / sunset

Toggle daylight display. Value can be either true or false.

show_daylight:false

Default: false

Date format

Configure the date format used for forecast entries. See Unix date formatting documentation for details.

dateformat:%a %b %d

Default: %a %b %d

Time format

Configure the time format used for sunrise and sunset. See Unix date formatting documentation for details.

timeformat:%b %d %r

Default: %b %d %r

OpenWeatherMap API key

Specify an OpenWeatherMap API key. By default AnsiWeather uses its own key, but users can optionally get their own one by creating a free OpenWeatherMap account.

api_key:85a4e3c55b73909f42c6a23ec35b7147

License

AnsiWeather is released under the BSD 2-Clause license. See LICENSE file for details.

Author

AnsiWeather is developed by Frederic Cambus.

Resources

GitHub: https://github.com/fcambus/ansiweather

Ähnliche Repositories
chubin/wttr.in

:partly_sunny: The right way to check the weather

GoGo ModulesApache License 2.0weather-informationweather-api
wttr.in
30.2k1.3k
alexanderepstein/Bash-Snippets

A collection of small bash scripts for heavy terminal users

ShellMIT Licensebashcurrency-converter
9.9k844
schachmat/wego

weather app for the terminal

GoGo ModulesISC Licensegowego
8.5k506
google-deepmind/weathernext

PythonPyPIApache License 2.0weatherweather-forecast
6.7k879
lmarzen/esp32-weather-epd

A low-power E-Paper weather display powered by an ESP32 microcontroller. Utilizes the OpenWeatherMap API.

CGNU General Public License v3.0displayeink
6.2k466
open-meteo/open-meteo

Free Weather Forecast API for non-commercial use

SwiftGNU Affero General Public License v3.0weather-apiweather
open-meteo.com
5.9k388
google-deepmind/graphcast

PythonPyPIApache License 2.0weatherweather-forecast
5.9k724
sgoudelis/ground-station

Browser-based ground station suite for satellite tracking, SDR reception, hardware control, and telemetry decoding

JavaScriptnpmGNU General Public License v3.0antennafft
4.6k815
xcc3641/SeeWeather

:partly_sunny: [@Deprecated]RxJava+RxBus+Retrofit+Glide+Material Design Weather App

JavaMavenApache License 2.0materialweather
fir.im/seeWeather
3.4k710
Veirt/weathr

a terminal weather app with ascii animation

Rustcrates.ioGNU General Public License v3.0cliterminal
2.9k115
PranshulGG/WeatherMaster

A Weather app for android with multiple sources 🌦🌞☔

KotlinGNU General Public License v3.0androidweather
2.9k120
knadh/dns.toys

A DNS server that offers useful utilities and services over the DNS protocol. Weather, world time, unit conversion etc.

GoGo ModulesMIT Licensednsdns-server
dns.toys
2.8k184