powerbar

command module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 21, 2020 License: GPL-3.0 Imports: 8 Imported by: 0

README

Powerbar

GitHub tag (latest SemVer) Build Status Go Report Card GitHub go.mod Go version AUR version

Configurable battery status module for Waybar. Uses UPower and DBus.

Usage

Command line:

𝝺 powerbar --help
Usage of powerbar:
  -charging string
     format string (default "{state} {capacity}% - {usage}W - {H}h {M}m")
  -discharging string
     format string (default "{state} {capacity}% - {usage}W - {H}h {M}m")
  -full string
     format string (default "{state} {capacity}% - {usage}W - {H}h {M}m")
  -waybar
     enable waybar mode

Variables:

  • {capacity}: Percentage of the battery capacity left
  • {H}, {M}: Hour and Minutes left when state is discharging, if charging this indicates how long until 100%.
  • {usage}: How much power is used in watts when state is discharging, If charging this indicates how much the battery is receiving.
  • {state}: The state of the battery. Can be Charging, Discharging, Unknown or Fully Charged
Using with Waybar

An example waybar config:

{
    "layer": "top",
    "position": "top",
    "modules-left": [],
    "modules-center": [],
    "modules-right": [ "custom/powerbar"],

    "custom/powerbar": {
        "return-type": "json",
        "interval": 1,
        "exec": "$HOME/.config/waybar/powerbar -full 'FULL - {usage}W' -charging '{state} {capacity}% - {usage}W - {H}h {M}m' -waybar 2> /dev/null"
    },
}

Classes are lower cased, hypened variants of the possible values for state

#custom-powerbar {
    border-bottom: 0px solid rgba(0, 255, 0, 1);
}

#custom-powerbar.charging,
#custom-powerbar.fully-charged {
    border-bottom: 2px solid rgb(0, 255, 0);
}

#custom-powerbar.discharging {
    border-bottom: 2px solid rgb(255, 217, 0);
}

LICENSE

GPL-V3

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL