Browse Source

add update_interval

add a short sleep to reduce load
Daniel Walter 10 năm trước cách đây
mục cha
commit
5295629c4f
2 tập tin đã thay đổi với 4 bổ sung0 xóa
  1. 3 0
      config.def.h
  2. 1 0
      slstatus.c

+ 3 - 0
config.def.h

@@ -17,6 +17,9 @@ static const char batteryfullfile[] = "/sys/class/power_supply/BAT0/energy_full_
 /* time */
 static const char timeformat[] = "%y-%m-%d %H:%M:%S";
 
+/* bar update interval in seconds */
+static unsigned int update_interval = 10;
+
 /* statusbar
 Possible arguments:
 - battery (battery percentage)

+ 1 - 0
slstatus.c

@@ -343,6 +343,7 @@ main()
         free(ram_usage);
         free(volume);
         free(wifi_signal);
+        sleep(update_interval);
     }
 
     /* close display */