Skip to content

elParaguayo/qtile-widget-unitstatus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UnitStatus widget

UnitStatus is a basic widget for Qtile which shows the current status of systemd units.

It may not be particular useful for you and was primarily written as an exercise to familiarise myself with writing Qtile widgets and interacting with d-bus.

About

The widget is incredibly basic. It subscribes to the systemd d-bus interface, finds the relevant service and displays an icon based on the current status. The widget listens for announced changes to the service and updates the icon accordingly.

Demo

Here is a screenshot from my HTPC showing multiple instances of the widget. Green icons are active services and the white is inactive.

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 widget to your config (~/.config/qtile/config.py):

from unitstatus import UnitStatus
...
screens = [
    Screen(
        top=bar.Bar(
            [
                widget.CurrentLayout(),
                widget.GroupBox(),
                widget.Prompt(),
                widget.WindowName(),
                UnitStatus(label="Avahi",unitname="avahi-daemon.service"),
                UnitStatus(), # NetworkManager.service is default
                widget.Clock(format='%Y-%m-%d %a %I:%M %p'),
                widget.QuickExit(),
            ],
            24,
        ),
    ),
]

Customising

The widget can be customised with the following arguments:

bus_name Which bus to use. Accepts 'system' or 'session'
font Default font
fontsize Font size
unitname Name of systemd unit.
label Short text to display next to indicator.
colour_active Colour for active indicator
colour_inactive Colour for active indicator
colour_failed Colour for active indicator
colour_dead Colour for dead indicator
indicator_size Size of indicator (None = up to margin)
state_map Map of indicator colours (state: (border, fill))
{"active": ("colour_active", "colour_active"), "inactive": ("colour_inactive", "colour_inactive"), "deactivating": ("colour_inactive", "colour_active"), "activating": ("colour_active", "colour_inactive"), "failed": ("colour_failed", "colour_failed"), "not-found": ("colour_inactive", "colour_failed"), "dead": ("colour_dead", "colour_dead"), }

Contributing

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

About

Qtile widget to display status of Systemd unit

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published