summaryrefslogtreecommitdiff
path: root/cpu-widget
diff options
context:
space:
mode:
authorChris Bruce <aprofessionalemailaddress@gmail.com>2020-09-19 01:08:15 -0700
committerChris Bruce <aprofessionalemailaddress@gmail.com>2020-09-19 01:08:15 -0700
commita2eddcdfcd87976866f797b5ad2b795495d2e620 (patch)
treee3498520985e33915a211389951d6c0c971b972b /cpu-widget
parenta127ffe8efc8ccb91b7a8495c23f67278609df25 (diff)
Add widget timeouts
Diffstat (limited to 'cpu-widget')
-rw-r--r--cpu-widget/cpu-widget.lua3
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