all repos — tint2 @ 7f7d0a0aa2a00eb0f4f1bc14a0d1f142ecd4924c

fork of the tint2 desktop panel for my custom setup - only minimized windows across all desktops for the taskbar

Regression tests
o9000 mrovi9000@gmail.com
commit

7f7d0a0aa2a00eb0f4f1bc14a0d1f142ecd4924c

parent

683d49bc719035aefad6fab6480f3d33964d1e50

1 files changed, 9 insertions(+), 4 deletions(-)

jump to
M test/regression.pytest/regression.py

@@ -280,12 +280,17 @@ return os.path.realpath(os.path.dirname(os.path.realpath(__file__)) + "/../")

def check_busy(): - out, _ = run("""top -bn5 | grep "Cpu(s)" | sed "s/.*, *\([0-9.]*\)%* id.*/\1/" | awk '{print 100 - $1"%"}' | tail -n +2""", True).communicate() - load = 0 + out, _ = run("top -bn5 | grep 'Cpu(s)' | grep -o '[0-9\.]* id' | cut -d ' ' -f 1", True).communicate() + load_samples = [] for line in out.split("\n"): - load = max(load, float(line.replace("%", ""))) + print(line) + line = line.strip() + if line: + load_samples.append(100. - float(line)) + load_samples.sort() + load = load_samples[len(load_samples)/2] if load > 10.0: - raise RuntimeError("The system appears busy.") + raise RuntimeError("The system appears busy. Load: %f.1%%." % (load,)) def main():