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_percentage", "alert_format_title", "alert_format_body", "alert_percentage",
|
||||
"path",
|
||||
("status", "A dictionary mapping ('DIS', 'CHR', 'FULL') to alternative names"),
|
||||
)
|
||||
battery_ident = "BAT0"
|
||||
format = "{status} {remaining_hm}"
|
||||
status = {
|
||||
"CHR": "CHR",
|
||||
"DIS": "DIS",
|
||||
"FULL": "FULL",
|
||||
}
|
||||
|
||||
alert = False
|
||||
alert_percentage = 10
|
||||
@ -163,6 +169,8 @@ class BatteryChecker(IntervalModule):
|
||||
urgency=2,
|
||||
)
|
||||
|
||||
fdict["status"] = self.status[fdict["status"]]
|
||||
|
||||
self.output = {
|
||||
"full_text": self.format.format(**fdict).strip(),
|
||||
"instance": self.battery_ident,
|
||||
|
Loading…
Reference in New Issue
Block a user