[modules/battery] Fix ac and unknown display
If the computer runs on AC, display that instead of showing "100%" in the status. Also, if reading the charging status fails for some reason (except the computer being on AC), go into critical state and display "n/a". see #23
This commit is contained in:
parent
2cc2cf8282
commit
d91294f010
3 changed files with 19 additions and 5 deletions
|
@ -121,8 +121,9 @@ class Theme(object):
|
|||
|
||||
state_themes = []
|
||||
# avoid infinite recursion
|
||||
if name not in widget.state():
|
||||
for state in widget.state():
|
||||
states = widget.state()
|
||||
if name not in states:
|
||||
for state in states:
|
||||
state_themes.append(self._get(widget, state, {}))
|
||||
|
||||
value = self._defaults.get(name, default)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue