From 7966f52057ee110dbcaff7f6b0446b1f5cda8ede Mon Sep 17 00:00:00 2001 From: Wesley Gahr Date: Sun, 27 Sep 2020 04:16:46 +0200 Subject: Removing cat into grep, reading file directly --- cpu-widget/cpu-widget.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cpu-widget') diff --git a/cpu-widget/cpu-widget.lua b/cpu-widget/cpu-widget.lua index 8d5f497..e141065 100644 --- a/cpu-widget/cpu-widget.lua +++ b/cpu-widget/cpu-widget.lua @@ -139,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"]], timeout, + watch([[bash -c "cat /proc/stat | grep '^cpu.' /proc/stat; 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 -- cgit v1.2.3 From 80a3fbb6f9077e1c432abd0cd3392dfdbaac63df Mon Sep 17 00:00:00 2001 From: Wesley Gahr Date: Sun, 27 Sep 2020 04:32:44 +0200 Subject: Removing the cat in favour of reading the file directly from grep --- cpu-widget/cpu-widget.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cpu-widget') diff --git a/cpu-widget/cpu-widget.lua b/cpu-widget/cpu-widget.lua index e141065..317ef0a 100644 --- a/cpu-widget/cpu-widget.lua +++ b/cpu-widget/cpu-widget.lua @@ -139,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.' /proc/stat; ps -eo '%p|%c|%C|' -o "%mem" -o '|%a' --sort=-%cpu | head -11 | tail -n +2"]], timeout, + watch([[bash -c "grep '^cpu.' /proc/stat; 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 -- cgit v1.2.3