diff options
author | Chris Bruce <aprofessionalemailaddress@gmail.com> | 2020-09-19 01:08:15 -0700 |
---|---|---|
committer | Chris Bruce <aprofessionalemailaddress@gmail.com> | 2020-09-19 01:08:15 -0700 |
commit | a2eddcdfcd87976866f797b5ad2b795495d2e620 (patch) | |
tree | e3498520985e33915a211389951d6c0c971b972b /net-speed-widget | |
parent | a127ffe8efc8ccb91b7a8495c23f67278609df25 (diff) |
Add widget timeouts
Diffstat (limited to 'net-speed-widget')
-rw-r--r-- | net-speed-widget/net-speed.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net-speed-widget/net-speed.lua b/net-speed-widget/net-speed.lua index 5f81a18..846898c 100644 --- a/net-speed-widget/net-speed.lua +++ b/net-speed-widget/net-speed.lua @@ -96,6 +96,7 @@ local function worker(args) local args = args or {} local interface = args.interface or '*' + local timeout = args.timeout or 1 local update_widget = function(widget, stdout, stderr) @@ -119,7 +120,7 @@ local function worker(args) prev_tx = cur_tx end - watch(string.format([[bash -c "cat /sys/class/net/%s/statistics/*_bytes"]], interface), 1, update_widget, net_speed_widget) + watch(string.format([[bash -c "cat /sys/class/net/%s/statistics/*_bytes"]], interface), timeout, update_widget, net_speed_widget) return net_speed_widget |