qtile-widget-laptopbattery

Qtile widget to display laptop battery status

MIT License

Stars
5

Laptop Battery Widget

This module provides a simple widget showing the status of the laptop battery.

About

The module uses the UPower DBus interface to obtain information about the current power source.

The widget is drawn by the module rather than using icons from a theme. This allows more customisation of colours.

Demo

Here is a screenshot from my HTPC showing the widget in the bar.

Normal: Screenshot

Low: Screenshot

Critical: Screenshot

Charging: Screenshot

Multiple batteries: Screenshot

Showing text: Screenshot

Installation

You can clone the repository and run:

python setup.py install

or, for Arch users, just copy the PKGBUILD file to your machine and build.

Configuration

Add the code to your config (~/.config/qtile/config.py):

from laptopbattery import LaptopBatteryWidget
...
screens = [
    Screen(
        top=bar.Bar(
            [
                widget.CurrentLayout(),
                widget.GroupBox(),
                widget.Prompt(),
                widget.WindowName(),
                LaptopBatteryWidget(),
                widget.Clock(format='%Y-%m-%d %a %I:%M %p'),
                widget.QuickExit(),
            ],
            24,
        ),
    ),
]

Customising

The widget allows the battery icon to be resized and to display colours for different states.

The widget can be customised with the following arguments:

Contributing

If you've used this (great, and thank you) you will find bugs so please file an issue.