dpms: replace format with icon
@@ -8,8 +8,8 @@ by clicking on 'DPMS' in the status bar.
Configuration parameters:
format: string to display (default '{state}')
- format_off: string to display when dpms is disabled (default 'DPMS')
- format_on: string to display when dpms is enabled (default 'DPMS')
+ icon_off: string to display when dpms is disabled (default 'DPMS')
+ icon_on: string to display when dpms is enabled (default 'DPMS')
Format placeholders:
{state} display current dpms state
@@ -29,18 +29,18 @@ class Py3status:
"""
# available configuration parameters
format = "{state}"
- format_off = "DPMS"
- format_on = "DPMS"
+ icon_off = "DPMS"
+ icon_on = "DPMS"
def dpms(self):
"""
Display a colorful state of DPMS.
"""
self.run = system('xset -q | grep -iq "DPMS is enabled"') == 0
- format_dpms = self.format_on if self.run else self.format_off
+ format_dpms = self.icon_on if self.run else self.icon_off
return {
- 'full_text': self.py3.safe_format(self.format, {'format_dpms': format_dpms}),
+ 'full_text': self.py3.safe_format(self.format, {'state': format_dpms}),
'color': self.py3.COLOR_ON or self.py3.COLOR_GOOD if self.run
else self.py3.COLOR_OFF or self.py3.COLOR_BAD
}
