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 freegeoip.net 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-0.1.1.tar.gz (8.4 kB view details)

Uploaded Source

Built Distributions

i3geoweather-0.1.1-py3.6.egg (7.4 kB view details)

Uploaded Source

i3geoweather-0.1.1-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for i3geoweather-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c805c4a32010135b35d0103cc1180651636907436b13a31fbd6632bac7cda1da
MD5 a3c930621b64e79ad5c02de3e71a60cc
BLAKE2b-256 0e2f4ae82c298a401bc5b1fee85e13a06b0a2658b4fae229698fdd18ad16e80b

See more details on using hashes here.

File details

Details for the file i3geoweather-0.1.1-py3.6.egg.

File metadata

File hashes

Hashes for i3geoweather-0.1.1-py3.6.egg
Algorithm Hash digest
SHA256 a8c482b785e73087fb8ae1dbbee08c45ed6580688062ccbab2e1bba9fe4d3877
MD5 26e115f681168d9142ffbb837a3feb30
BLAKE2b-256 2ca27ca65efe9e7b878a1f9f108dc8e3b8050d6cd62b83c8a51eb75edb6bd61c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for i3geoweather-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3a6c4480b976c4d38d030046ca9927b94e9e5857a496764c679baebd95ff2331
MD5 4df674c71f957d80671c74ffd9010cc6
BLAKE2b-256 0b9bb59628f098d62b60d28e22d638bed75f331a711639dfc4bcd3da0a88ed03

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