diff options
author | streetturtle <streetturtle@users.noreply.github.com> | 2020-09-21 20:53:22 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-21 20:53:22 -0400 |
commit | 31213af0082bef8344475dbeb84205f1a7e31c7d (patch) | |
tree | 2a8b4cad8363c5a0019466edf86d8ef99941d2f4 /cpu-widget/cpu-widget.lua | |
parent | a127ffe8efc8ccb91b7a8495c23f67278609df25 (diff) | |
parent | 21150bd640f086f617c61b32cde5e45ecfb5158f (diff) |
Merge pull request #188 from brucec5/widget-tweaks
Add customizable refresh timeouts to most widgets
Diffstat (limited to 'cpu-widget/cpu-widget.lua')
-rw-r--r-- | cpu-widget/cpu-widget.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/cpu-widget/cpu-widget.lua b/cpu-widget/cpu-widget.lua index 76f739f..8d5f497 100644 --- a/cpu-widget/cpu-widget.lua +++ b/cpu-widget/cpu-widget.lua @@ -96,6 +96,7 @@ local function worker(args) local color = args.color or beautiful.fg_normal local enable_kill_button = args.enable_kill_button or false local process_info_max_length = args.process_info_max_length or -1 + local timeout = args.timeout or 1 local cpugraph_widget = wibox.widget { max_value = 100, @@ -138,7 +139,7 @@ local function worker(args) local cpu_widget = wibox.container.margin(wibox.container.mirror(cpugraph_widget, { horizontal = true }), 0, 0, 0, 2) local cpus = {} - watch([[bash -c "cat /proc/stat | grep '^cpu.' ; ps -eo '%p|%c|%C|' -o "%mem" -o '|%a' --sort=-%cpu | head -11 | tail -n +2"]], 1, + watch([[bash -c "cat /proc/stat | grep '^cpu.' ; ps -eo '%p|%c|%C|' -o "%mem" -o '|%a' --sort=-%cpu | head -11 | tail -n +2"]], timeout, function(widget, stdout) local i = 1 local j = 1 |