From bf381794bd465285f9f4ed3fb95cc6e517eb1a70 Mon Sep 17 00:00:00 2001 From: Tobi-wan Kenobi Date: Tue, 29 Nov 2016 19:35:54 +0100 Subject: [PATCH] [output] Ignore empty commands When receiving a "nop" (None) command, skip it. Otherwise, an exception is thrown and input processing stops. Also, remove the "communicate()" call to *not* wait until a process has finished until resuming input processing. Otherwise, whenever an external program (pavucontrol, nautilius, ...) is started, any further input processing is stalled until the program has been closed again. fixes #24 --- bumblebee/output.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bumblebee/output.py b/bumblebee/output.py index 0840523..1f494ad 100644 --- a/bumblebee/output.py +++ b/bumblebee/output.py @@ -52,12 +52,13 @@ class Command(object): self._command = [ self._command ] for cmd in self._command: + if not cmd: continue if inspect.ismethod(cmd): cmd(self._event, self._widget) else: c = cmd.format(*args, **kwargs) DEVNULL = open(os.devnull, 'wb') - subprocess.Popen(shlex.split(c), stdout=DEVNULL, stderr=DEVNULL).communicate() + subprocess.Popen(shlex.split(c), stdout=DEVNULL, stderr=DEVNULL) class Output(object): def __init__(self, config):