From a17cd4759c71f2b15112d1120c1ae6473f59cbc3 Mon Sep 17 00:00:00 2001 From: Tobias Witek Date: Sun, 26 Jan 2020 13:31:20 +0100 Subject: [PATCH] [core/output] Implement simple wait To pace the output lines, implement a simple wait() call for the i3 output. --- bumblebee-status | 2 +- core/output.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/bumblebee-status b/bumblebee-status index 10edfe6..75ad1b8 100755 --- a/bumblebee-status +++ b/bumblebee-status @@ -17,7 +17,7 @@ def main(): module.update() sys.stdout.write(output.draw(module)) sys.stdout.write(output.end_status_line()) - output.sleep(config.interval()) + output.wait(config.interval()) sys.stdout.write(output.stop()) diff --git a/core/output.py b/core/output.py index c0355c9..ddbb1ca 100644 --- a/core/output.py +++ b/core/output.py @@ -1,4 +1,5 @@ import json +import time class i3(object): def start(self): @@ -13,4 +14,7 @@ class i3(object): def end_status_line(self): return '],\n' + def wait(self, interval): + time.sleep(interval) + # vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4