[modules/caffeine] Enable status change notifications

Now that multi-command callbacks work, enable caffeine status change
notifications via "notify".
This commit is contained in:
Tobi-wan Kenobi 2016-11-23 18:29:05 +01:00
parent f967eafe99
commit 027541126d

View file

@ -10,10 +10,8 @@ class Module(bumblebee.module.Module):
def __init__(self, output, config, alias):
super(Module, self).__init__(output, config, alias)
self._activated = 0
# output.add_callback(module="caffeine.activate", button=1, cmd='notify-send "Consuming caffeine"; xset s off')
# output.add_callback(module="caffeine.deactivate", button=1, cmd='notify-send "Out of coffee"; xset s 600 600')
output.add_callback(module="caffeine.activate", button=1, cmd='xset s off')
output.add_callback(module="caffeine.deactivate", button=1, cmd='xset s default')
output.add_callback(module="caffeine.activate", button=1, cmd=[ 'notify-send "Consuming caffeine"', 'xset s off' ])
output.add_callback(module="caffeine.deactivate", button=1, cmd=[ 'notify-send "Out of coffee"', 'xset s default' ])
def widgets(self):
output = subprocess.check_output(shlex.split("xset q"))