add widget in local scope

This commit is contained in:
pmakhov 2017-09-28 09:42:38 -04:00
parent d9d50d7708
commit 7fab9b2959
1 changed files with 9 additions and 1 deletions

View File

@ -1,7 +1,8 @@
local awful = require("awful")
local watch = require("awful.widget.watch")
local wibox = require("wibox")
cpugraph_widget = wibox.widget {
local cpugraph_widget = wibox.widget {
max_value = 100,
color = '#74aeab',
background_color = "#1e252c",
@ -40,3 +41,10 @@ watch("cat /proc/stat | grep '^cpu '", 1,
end,
cpugraph_widget
)
cpugraph_widget:buttons(
awful.util.table.join(
awful.button({}, 1, function() awful.spawn.with_shell("echo left | xsel --clipboard") end),
awful.button({}, 3, function() awful.spawn.with_shell("echo right | xsel --clipboard") end)
)
)