From 220bb9bf606d9eed27404c53715fc4d7d8507bd6 Mon Sep 17 00:00:00 2001 From: Tobi-wan Kenobi Date: Sat, 17 Dec 2016 08:04:21 +0100 Subject: [PATCH] [core/input] Ugly hack for responsiveness Somehow, the fix in the previous commit didn't work, it seems that sometimes epoll() doesn't trigger, even if there is more data in sys.stdin. I'm sure I'm doing something horribly wrong here. Anyhow, as a quick fix, check for the open bracket to be sure to not buffer the first event too long. --- bumblebee/input.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bumblebee/input.py b/bumblebee/input.py index b9389c2..6bbdc3d 100644 --- a/bumblebee/input.py +++ b/bumblebee/input.py @@ -18,15 +18,17 @@ def read_input(inp): """Read i3bar input and execute callbacks""" epoll = select.epoll() epoll.register(sys.stdin.fileno(), select.EPOLLIN) + f = open("/tmp/bee.log", "a") while inp.running: for thread in threading.enumerate(): if thread.name == "MainThread" and not thread.is_alive(): return events = epoll.poll(1) - for fileno, event in events: - line = sys.stdin.readline().strip(",").strip() + line = "[" + while "[" in line: + line = sys.stdin.readline().strip(",").strip() inp.has_event = True try: event = json.loads(line)