Merge pull request #50 from myxo/master

Calling bash in watch command
This commit is contained in:
streetturtle 2018-09-22 18:51:54 -04:00 committed by GitHub
commit 8c623286a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -27,7 +27,7 @@ local cpu_widget = wibox.container.margin(wibox.container.mirror(cpugraph_widget
local total_prev = 0
local idle_prev = 0
watch("cat /proc/stat | grep '^cpu '", 1,
watch([[bash -c "cat /proc/stat | grep '^cpu '"]], 1,
function(widget, stdout, stderr, exitreason, exitcode)
local user, nice, system, idle, iowait, irq, softirq, steal, guest, guest_nice =
stdout:match('(%d+)%s(%d+)%s(%d+)%s(%d+)%s(%d+)%s(%d+)%s(%d+)%s(%d+)%s(%d+)%s(%d+)%s')