Qtile widget to display laptop battery status
MIT License
This module provides a simple widget showing the status of the laptop battery.
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.
Here is a screenshot from my HTPC showing the widget in the bar.
Normal:
Low:
Critical:
Charging:
Multiple batteries:
Showing text:
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.
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,
),
),
]
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:
If you've used this (great, and thank you) you will find bugs so please file an issue.