Skip to main content

Provide temperature information to i3blocks based on geolocated IP address

Project description

This blocklet provides temperature information for the i3blocks status bar often used in the i3 window manager. It attempts to determine your location based on your IP address using the ipstack.com API. Based on the location it retrieves weather information from the free openweathermap.org API.

docs/i3geoweather.jpg

i3geoweather is a pure Python 3 program. No attempt to make it compatible with Python 2 has been or will be made. It is time to switch!

Installation

The easiest way to install i3geoweather is to use pip:

$ pip install i3geoweather

Depending on your system you may need to call pip3 instead of pip

Dependencies

i3geoweather depends on the Python requests library. i3geoweather output uses FontAwesome for its output. You should download the free FontAwesome zip file and copy fontawesome-webfont.ttf to your ~/.fonts/ directory.

Usage

i3geoweather runs a daemon process in the background (if started with the -d option) and periodically updates weather information by writing to ~/.i3geoweather/i3geoweather.txt.

Start i3geoweather from your i3 configuration file:

exec_always i3geoweather -d

You may need to use the full path to i3geoweather, e.g., for an installation with pip install –user …:

exec_always ~/.local/bin/i3geoweather -d

A typical i3blocks.conf entry may look like this:

[weather]
interval=repeat
command=inotifywait -qq -e delete_self ~/.i3geoweather/i3geoweather.txt && cat ~/.i3geoweather/i3geoweather.txt

Command line options:

  • -d or –daemon run as background process

  • -l or –location force a location by specifying a comma separated latitude/longitude pair, e.g., -l “50.0126, 7.996”. North and east are positive.

  • -r or –restart restart background process

  • -s or –stop stop running background process

  • -v increase verbosity of logging to ~/.i3geoweather/i3geoweather.log. Can be used up to three times. Using -v twice logs informational messages. Debugging output is produced when -v is used three times.

Author

Jörg Dietrich astro@joergdietrich.com

Contributing

Development takes place on GitHub. Please report any bugs as an issue in the GitHub issue tracker.

License

i3geoweather is released under an MIT license. See LICENCE.txt

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

i3geoweather-1.1.0.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

i3geoweather-1.1.0-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file i3geoweather-1.1.0.tar.gz.

File metadata

  • Download URL: i3geoweather-1.1.0.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

File hashes

Hashes for i3geoweather-1.1.0.tar.gz
Algorithm Hash digest
SHA256 ec62d17bfd84a788283c493c84a336d385894888ed04d9dda419f6473b2692af
MD5 a0eb26ebf097136239f4a526d6f15b05
BLAKE2b-256 d2cd2079acd867f3bfb185b702f6cf88cb7b61bbb65fbe7f28c6fdec55dd5573

See more details on using hashes here.

File details

Details for the file i3geoweather-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: i3geoweather-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

File hashes

Hashes for i3geoweather-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5159b8274ede963e36f3179d80e5b8fdc2d6c3d27b59e5f80660f4c2be7e93c3
MD5 2c44c316b2260ed39ef14439cf4b42bd
BLAKE2b-256 4ab5caf26d02d9f056e395cac498e9199c7cfaa79c0f6bafbc437b84289f175b

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