Skip to content

elParaguayo/qtile-widget-laptopbattery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

font Default font
fontsize Font size
font_colour Font colour for information text
battery_height Height of battery icon
battery_width Size of battery icon
battery_name Battery name. None = all batteries
border_charge_colour Border colour when charging.
border_colour Border colour when discharging.
border_critical_colour Border colour when battery low.
fill_normal Fill when normal
fill_low Fill colour when battery low
fill_critical Fill when critically low
margin Margin on sides of widget
spacing Space between batteries
percentage_low Low level threshold.
percentage_critical Critical level threshold.
text_charging Text to display when charging.
text_discharging Text to display when on battery.
text_displaytime Time for text to remain before hiding

Contributing

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

About

Qtile widget to display laptop battery status

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published