Skip to main content

An fast and lightweight wrapper for lemonbar

Project description

LemonSqueezer is a python wrapper for lemonbar that makes it easy to make beautiful, informative status bars using less power than most other status bars. This is achieved by only updating the bar when new output is available, without polling commands for output, (such as polybar or a custom lemonbar script would do).

Installation

  • Arch Linux

    `sh git clone https://aur.archlinux.org/python-lemonsqueezer.git cd python-lemonsqueezer makepkg -si `

  • General

    `sh sudo pip install python-lemonsqueezer `

Basics

Lemonsqueezer defines its output in terms of Modules. These are python objects which define how and when to render output on the bar. The base BarModule class has little to no behaviour attached to it and so, to create useful modules, a couple of helper subclasses are available (See CommandWatcherModule or PeriodicModule in the docs). There are also a few premade modules for things such as battery or a clock.

Creating custom modules

New modules are created by subclassing the base BarModule class and overriding the setup and get_output methods.

Lemonsqueezer uses asyncio to achieve its efficiency. Both setup and get_output are coroutine methods. When the bar starts, setup is awaited first. When it returns, its output is placed on the bar at the appropriate location (as specified by the BarModule constructor). After that, get_output is awaited repeatedly, setting the module text whenever it returns. Note that if get_output returns None, then the bar is not updated at all.

Helper subclasses

  • PeriodicModule

    Run a command every few seconds and set the output based on its output

    This is the closest to how other bars usually get output, and it’s probably the most inefficient method to create a module. However you can still have a small improvement over a traditional bar manager since you are able to return None if there are no changes to the output.

  • CommandMonitorModule

    Use this type of module when you want to have the module update whenever a command produces some output. A lot of the built-in modules are defined using this.

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

lemonsqueezer-0.1.4.tar.gz (14.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lemonsqueezer-0.1.4-py2.py3-none-any.whl (13.1 kB view details)

Uploaded Python 2Python 3

File details

Details for the file lemonsqueezer-0.1.4.tar.gz.

File metadata

  • Download URL: lemonsqueezer-0.1.4.tar.gz
  • Upload date:
  • Size: 14.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.1 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.0

File hashes

Hashes for lemonsqueezer-0.1.4.tar.gz
Algorithm Hash digest
SHA256 06cacc6f9e9c3c4b24cf83ea1bc1c26782a47de7a6e00dee564cb0ed7df8461b
MD5 892c23d85e016edba0e34c51ce8c9a86
BLAKE2b-256 50dccea539adac0dc5e556938bba9ad16f42ae10314bd912a4ed9461b7ec44fd

See more details on using hashes here.

File details

Details for the file lemonsqueezer-0.1.4-py2.py3-none-any.whl.

File metadata

  • Download URL: lemonsqueezer-0.1.4-py2.py3-none-any.whl
  • Upload date:
  • Size: 13.1 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.1 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.0

File hashes

Hashes for lemonsqueezer-0.1.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 3c850cc8a8a0309b2348bb02b09149b3bfc299c2e268d0a48b63d77201a9c9f5
MD5 1ee19915c6c39a2609476d60b3dac347
BLAKE2b-256 47e1f5e3408a9c36c57173c88b85c5930300412a0d8f84f1973e9e2bfceb6593

See more details on using hashes here.

Supported by

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