Giter Site home page Giter Site logo

qtile-widget-unitstatus's Introduction

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.

qtile-widget-unitstatus's People

Contributors

elparaguayo avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.