Giter Site home page Giter Site logo

yanlinaung / ansiweather Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fcambus/ansiweather

0.0 2.0 0.0 185 KB

Weather in your terminal, with ANSI colors and Unicode symbols

License: BSD 3-Clause "New" or "Revised" License

Shell 79.17% Groff 20.83%

ansiweather's Introduction

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 :

OpenBSD

pkg_add ansiweather

Pkgsrc (NetBSD, SmartOS, Mac OS X, etc.)

pkgin install ansiweather

FreeBSD

pkg install ansiweather

Debian

apt-get install ansiweather

Homebrew (Mac OS X)

brew install ansiweather

Usage

ansiweather [options]

Options are :

-l Specify location
-u Specify unit system to use (metric or imperial)
-f Toggle forecast mode for the specified number of upcoming days
-F Toggle forecast mode for the next five days
-d Toggle daylight data display
-a Toggle ANSI colors display
-s Toggle symbols display
-k OpenWeatherMap API key
-h Display usage

Command Line Options

Any configuration options may also be passed in as command line options :

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

Configuration

The default config file is ~/.ansiweatherrc. The environment variable ANSIWEATHERRC can be set to override this. The following configuration options (detailed below) are available and should be set according to your location and preferences.

Example : ~/.ansiweatherrc

location:Rzeszow,PL
fetch_cmd:ftp -V -o -
units:metric
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, NetBSD and Mac OS X.

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 an Unicode capable display) or false.

symbols:true

Default: true

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 sunrise / sunset

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

daylight:false

Default: false

Date and Time format

Configure date and time format display. See Unix date formatting documentation for details.

dateformat:%a %b %d

Default : %a %b %d

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 3-Clause license. See LICENSE file for details.

Author

AnsiWeather is developed by Frederic Cambus

Resources

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

ansiweather's People

Contributors

andreineculau avatar bszcz avatar fcambus avatar joshmoore avatar jwilk avatar krytarowski avatar livibetter avatar lornix avatar lucc avatar matthewfranglen avatar mdom avatar mfontani avatar michaelhood avatar mreinhardt avatar qbit avatar royhodgman avatar sesm avatar sorbits avatar sshaw avatar thirota avatar tomef avatar web-mech avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.