From 8ce520420052eb992dc41e899261bee482b2720c Mon Sep 17 00:00:00 2001 From: Ultrabug Date: Tue, 12 Nov 2013 17:17:04 +0100 Subject: fix delay on py3status start waiting for i3status, this caused a useless first refresh delay of py3status of i3status interval seconds, thx to @Edholm on issue #18 --- py3status/__init__.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/py3status/__init__.py b/py3status/__init__.py index bd2295b..d454ab3 100755 --- a/py3status/__init__.py +++ b/py3status/__init__.py @@ -185,7 +185,13 @@ class I3status(Thread): while self.lock.is_set(): line = self.poller_inp.readline(timeout) if line: - if not line.startswith(','): + if line.startswith('[{'): + with jsonify(line) as (prefix, json_list): + self.last_output = json_list + self.last_output_ts = datetime.utcnow() + self.last_prefix = ',' + print_line(line) + elif not line.startswith(','): if 'version' in line: header = loads(line) header.update({'click_events': True}) -- cgit v1.3