3.14: Battery: add status setting
I use it like this to save a few characters status={ "DIS": "↓", "CHR": "↑", "FULL": "=", }
This commit is contained in:
parent
35b9ed6468
commit
c5153ae12a
@ -111,9 +111,15 @@ class BatteryChecker(IntervalModule):
|
|||||||
("alert", "Display a libnotify-notification on low battery"),
|
("alert", "Display a libnotify-notification on low battery"),
|
||||||
"alert_percentage", "alert_format_title", "alert_format_body", "alert_percentage",
|
"alert_percentage", "alert_format_title", "alert_format_body", "alert_percentage",
|
||||||
"path",
|
"path",
|
||||||
|
("status", "A dictionary mapping ('DIS', 'CHR', 'FULL') to alternative names"),
|
||||||
)
|
)
|
||||||
battery_ident = "BAT0"
|
battery_ident = "BAT0"
|
||||||
format = "{status} {remaining_hm}"
|
format = "{status} {remaining_hm}"
|
||||||
|
status = {
|
||||||
|
"CHR": "CHR",
|
||||||
|
"DIS": "DIS",
|
||||||
|
"FULL": "FULL",
|
||||||
|
}
|
||||||
|
|
||||||
alert = False
|
alert = False
|
||||||
alert_percentage = 10
|
alert_percentage = 10
|
||||||
@ -163,6 +169,8 @@ class BatteryChecker(IntervalModule):
|
|||||||
urgency=2,
|
urgency=2,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
fdict["status"] = self.status[fdict["status"]]
|
||||||
|
|
||||||
self.output = {
|
self.output = {
|
||||||
"full_text": self.format.format(**fdict).strip(),
|
"full_text": self.format.format(**fdict).strip(),
|
||||||
"instance": self.battery_ident,
|
"instance": self.battery_ident,
|
||||||
|
2
setup.py
2
setup.py
@ -3,7 +3,7 @@
|
|||||||
from setuptools import setup
|
from setuptools import setup
|
||||||
|
|
||||||
setup(name="i3pystatus",
|
setup(name="i3pystatus",
|
||||||
version="3.13",
|
version="3.14",
|
||||||
description="Like i3status, this generates status line for i3bar / i3wm",
|
description="Like i3status, this generates status line for i3bar / i3wm",
|
||||||
url="http://github.com/enkore/i3pystatus",
|
url="http://github.com/enkore/i3pystatus",
|
||||||
license="MIT",
|
license="MIT",
|
||||||
|
Loading…
Reference in New Issue
Block a user