diff options
| author | Ultrabug <ultrabug@gentoo.org> | 2014-11-23 20:55:53 +0100 |
|---|---|---|
| committer | Ultrabug <ultrabug@gentoo.org> | 2014-11-23 20:55:53 +0100 |
| commit | d9747b64e1e62abee12ef0bafd365cf380ff7fe9 (patch) | |
| tree | 11a1d156c38ec96b83b4a1780719fc856cbbebad /modules/dpms.py | |
| parent | 62b2bd2251997bf8608e9620d91f688585221040 (diff) | |
move modules folder so we can install it as a module of py3status
Diffstat (limited to 'modules/dpms.py')
| -rw-r--r-- | modules/dpms.py | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/modules/dpms.py b/modules/dpms.py deleted file mode 100644 index 783c53c..0000000 --- a/modules/dpms.py +++ /dev/null @@ -1,44 +0,0 @@ -from os import system - - -class Py3status: - """ - This module allows activation and deactivation - of DPMS (Display Power Management Signaling) - by clicking on 'DPMS' in the status bar. - - Written and contributed by @tasse: - Andre Doser <dosera AT tf.uni-freiburg.de> - """ - def __init__(self): - """ - Detect current state on start. - """ - self.run = system('xset -q | grep -iq "DPMS is enabled"') == 0 - - def dpms(self, i3status_output_json, i3status_config): - """ - Display a colorful state of DPMS. - """ - result = { - 'full_text': 'DPMS', - 'name': 'dpms' - } - if self.run: - result['color'] = i3status_config['color_good'] - else: - result['color'] = i3status_config['color_bad'] - return (0, result) - - def on_click(self, json, i3status_config, event): - """ - Enable/Disable DPMS on left click. - """ - if event['button'] == 1: - if self.run: - self.run = False - system("xset -dpms") - else: - self.run = True - system("xset +dpms") - system("killall -USR1 py3status") |
