Skip to main content

Polybar Online

Polybar Online is a script for Polybar that displays an internet connection indicator in a panel with the ability to send a notification when the connection is broken and restored.

Why another one?

I've been looking for a similar module for myself and even found a couple. But they didn't run on my machine... So I decided that it would be faster to write my own than to poke around in someone else's. (and others are not able to send notifications!!!)

Requirements

The script does not use any third-party libraries, but you will need to install some Nerd fonts in order for the icons to be displayed.

It's not necessary if you're going to use your own icons from other fonts, though.

Installing

Clone the repository to a convenient location. For example, in ~/.config/polybar/:

cd ~/.config/polybar/
git clone https://github.com/Leetovskiy/polybar-online 

You can also install Polybar Online from PyPI using pip. In this case, you may want to run the script as a regular console program. To do this, make sure that the directory of installed pip packages is available in the PATH variable.

pip install polybar-online

Configuration

The script takes some arguments from the terminal to control its operation. These are, for example, enabling and disabling Internet connection status change notifications, setting icons, etc.

Use the command polybar-online -h to see the full list of available options.

  -h, --help            show this help message and exit
  -n, --notify, --no-notify
                        send a notification if the internet connection is broken (default: False)
  --online-icon ONLINE_ICON
                        icon that will be displayed when the Internet connection is available (default: 度)
  --offline-icon OFFLINE_ICON
                        icon that will be displayed when there is no Internet connection (default: ﴹ)
  -ci CHECK_INTERVAL, --check-interval CHECK_INTERVAL
                        Interval between checks (in seconds)
  -ri RETRY_INTERVAL, --retry-interval RETRY_INTERVAL
                        Interval between checks when Internet connection is unavailable (in seconds)

Using

You need to put the script path in a special custom/script section of your Polybar configuration file. You also need the tail parameter set to true. And don't forget to add the new module to your panel's module list.

Example:

[bar/mybar]
modules-right = online

[module/online]
type = custom/script
exec = python ~/.config/polybar/polybar-online/polybar_online/main.py --notify -ci 5
tail = true

License

This little project is licensed under the Apache 2.0 license, so you are free to use it according to the terms of the license.

Contribution

If you know how to improve this project or would like to contribute yourself, you are welcome. I'm open to suggestions on Telegram (@leetovskiy) and email (dev.zaitsev@gmail.com), and I'll consider pull requests from you as well.

Roadmap

  • Localization in Russian and other languages
  • Distribution as a binary (using nuitka)
  • AUR package

Metadata

Release files for polybar-online 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for polybar-online 1.0.0
File Size Uploaded
polybar_online-1.0.0.tar.gz 13.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for polybar-online 1.0.0
File Interpreter ABI Platform
polybar_online-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 26.4 kB

Release files / polybar_online-1.0.0.tar.gz

Download URL polybar_online-1.0.0.tar.gz
Size 13.3 kB
Tags Source
SHA-256 checksum
How to use checksums
d9b5128f55024979bb2dfa571f0a91850b2ef6c64785e5e6e50c2d86ed980ce4
BLAKE2b-256 checksum
How to use checksums
dd64f64139c9a6ee757739fc898127146837b0f76f3a8b31471f9fbb9612a721
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.9

Release files / polybar_online-1.0.0-py3-none-any.whl

Download URL polybar_online-1.0.0-py3-none-any.whl
Size 13.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2ba81579de08b93a5f0f61df09986986545e98a9e37602745ef709f06314c0f9
BLAKE2b-256 checksum
How to use checksums
aadf36a44c860a49e7bb07db7e93c9823dc5593731a13520e322cf9920b767d0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.9

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page