diff options
| author | Ultrabug <ultrabug@gentoo.org> | 2013-11-12 17:17:04 +0100 |
|---|---|---|
| committer | Ultrabug <ultrabug@gentoo.org> | 2013-11-12 17:17:04 +0100 |
| commit | 8ce520420052eb992dc41e899261bee482b2720c (patch) | |
| tree | 603d79b972d2379b8c1026fbd2fd35d2fa2eb823 /py3status | |
| parent | f14ce52587fd89b15b7f5cb05c048e952af0e447 (diff) | |
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
Diffstat (limited to 'py3status')
| -rwxr-xr-x | py3status/__init__.py | 8 |
1 files changed, 7 insertions, 1 deletions
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}) |
