From 6b10daf968f0ed990a5c0a5c42ad73a97bc98d5b Mon Sep 17 00:00:00 2001 From: "J.M. Dana" Date: Wed, 1 Apr 2015 21:11:46 +0100 Subject: External processes might change DPMS so the module should check in the main loop --- py3status/modules/dpms.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'py3status/modules') diff --git a/py3status/modules/dpms.py b/py3status/modules/dpms.py index c2d9c4e..cfc7213 100644 --- a/py3status/modules/dpms.py +++ b/py3status/modules/dpms.py @@ -25,9 +25,13 @@ class Py3status: """ Display a colorful state of DPMS. """ + + self.run = system('xset -q | grep -iq "DPMS is enabled"') == 0 + response = { 'full_text': 'DPMS' } + if self.run: response['color'] = i3s_config['color_good'] else: -- cgit v1.3 From dc96298a963d821b00261af76e5bc493c31a0fab Mon Sep 17 00:00:00 2001 From: "J.M. Dana" Date: Thu, 2 Apr 2015 19:02:04 +0100 Subject: init is not needed anymore --- py3status/modules/dpms.py | 6 ------ 1 file changed, 6 deletions(-) (limited to 'py3status/modules') diff --git a/py3status/modules/dpms.py b/py3status/modules/dpms.py index cfc7213..d1967f7 100644 --- a/py3status/modules/dpms.py +++ b/py3status/modules/dpms.py @@ -15,12 +15,6 @@ from os import system class Py3status: """ """ - def __init__(self): - """ - Detect current state on start. - """ - self.run = system('xset -q | grep -iq "DPMS is enabled"') == 0 - def dpms(self, i3s_output_list, i3s_config): """ Display a colorful state of DPMS. -- cgit v1.3