[modules/redshift] Do not block status line

Redshift might block when no network connectivity is available (if it
tries to determine the location automatically). To avoid this blocking
the whole status line, immediately release the lock in the query thread.
This commit is contained in:
Tobias Witek 2018-01-01 08:59:21 +01:00
parent 9268d16a9f
commit 8f44a1bf63

View file

@ -29,6 +29,7 @@ def get_redshift_value(widget):
except RuntimeError: except RuntimeError:
continue continue
break break
widget.get("condition").release()
try: try:
res = bumblebee.util.execute("redshift -p") res = bumblebee.util.execute("redshift -p")
@ -48,7 +49,6 @@ def get_redshift_value(widget):
else: else:
widget.set("state", "transition") widget.set("state", "transition")
widget.set("transition", " ".join(line.split(" ")[2:])) widget.set("transition", " ".join(line.split(" ")[2:]))
widget.get("condition").release()
class Module(bumblebee.engine.Module): class Module(bumblebee.engine.Module):
def __init__(self, engine, config): def __init__(self, engine, config):