diff --git a/i3pystatus/load.py b/i3pystatus/load.py index 0c657f7..dc3f3d2 100644 --- a/i3pystatus/load.py +++ b/i3pystatus/load.py @@ -1,4 +1,8 @@ from i3pystatus import IntervalModule +try: + from os import cpu_count +except ImportError: + from multiprocessing import cpu_count class Load(IntervalModule): @@ -11,13 +15,13 @@ class Load(IntervalModule): ("format", "format string used for output. {avg1}, {avg5} and {avg15} are the load average of the last one, five and fifteen minutes, respectively. {tasks} is the number of tasks (i.e. 1/285, which indiciates that one out of 285 total tasks is runnable)."), ("color", "The text color"), - ("critical_limit", "Limit above which the load is considered critical"), + ("critical_limit", "Limit above which the load is considered critical, defaults to amount of cores."), ("critical_color", "The critical color"), ) file = "/proc/loadavg" color = "#ffffff" - critical_limit = 1 + critical_limit = cpu_count() critical_color = "#ff0000" def run(self):