Skip to main content

An external xmobar plugin for customizable weather info!

Project description

xmobar_wttr is a command-line program which fetches weather info from wttr.in and applies direct formatting to be used by xmobar. Different from already available plugins, it can easily be configured to use any kind of combination of numbers, icons, and colors.

In the commands list your xmobarrc, add something along the lines of

Run Com "xmobar_wttr" ["-c ~/.config/xmobar/xmobar_wttr.yml"] "wttr" 9000

Prerequisites

This program mainly uses following python3 modules

  • requests
  • pyyaml

Furthermore, the program uses weather icons from https://github.com/erikflowers/weather-icons. Install them directly from the website, using an AUR helper such as

yay -S ttf-weather-icons

or by other means.

Install

pip install xmobar-wttr

For installing from source, clone the repository, and run

cd xmobar_wttr
python setup.py install

or create a virtual environment with

pipenv install
pipenv install -e .

To activate the virtual environment run

pipenv shell

or start every command with pipenv run.

Usage

usage: xmobar_wttr [-h] [-c <path>] [-l <loc>] [-f <format>] [-o <path>] [-s <section>] [-p <par-list> [<par-list> ...]] [-v]

optional arguments:
  -h, --help            show this help message and exit
  -c <path>, --config <path>
			Path to the config file
  -l <loc>, --location <loc>
			Location for which to pull information.
  -f <format>, --format <format>
			Format template for xmobarrc
  -o <path>, --output <path>
			Path to the output file
  -s <section>, --section <section>
			Section in the yaml file to be parsed
  -p <par-list> [<par-list> ...], --pars <par-list> [<par-list> ...]
			Select parameters to be fetched from wttr.in
			excluded parameters are not available in xmobar template format
  -v, --verbose         Run program in verbose mode

Configuration

xmobar_wttr works with both command-line arguments as well as YAML configuration files (the first takes precedence over the latter). To set your desired defaults edit the configuration file xmobar_wttr.yml and place it in either

  • ~/.config/xmobar_wttr/xmobar_wttr.yml
  • ~/.config/xmobar/xmobar_wttr.yml
  • ~/.xmobar_wttr/xmobar_wttr.yml
  • ~/.xmobar_wttr.yml

Notation

Notation Description
%[par] parameter value
%g[par] render parameter only as icon
%G[par] prefix icon to parameter value
.u append units of previous parameter
Format map Result
<2:…>
{#dedede:…}
\\… \x…

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xmobar_wttr-0.0.dev4.tar.gz (23.9 kB view details)

Uploaded Source

File details

Details for the file xmobar_wttr-0.0.dev4.tar.gz.

File metadata

  • Download URL: xmobar_wttr-0.0.dev4.tar.gz
  • Upload date:
  • Size: 23.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.0.1 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for xmobar_wttr-0.0.dev4.tar.gz
Algorithm Hash digest
SHA256 8f6011d66e139c982a001063e59b44f2fc1a480d0564ad8f3bce921ada50f4b0
MD5 9a56d759adea8dfb6cb33dd100eac113
BLAKE2b-256 2722ed77fb4bc174b0b122eb7caabd045d9cb64b1b543c56cb215f2c3cf5c7f8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page