From 7fab9b29599cd4b783431b36d783a8315df1ac91 Mon Sep 17 00:00:00 2001 From: pmakhov Date: Thu, 28 Sep 2017 09:42:38 -0400 Subject: add widget in local scope --- cpu-widget/cpu-widget.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cpu-widget/cpu-widget.lua b/cpu-widget/cpu-widget.lua index e9d1264..674c33f 100644 --- a/cpu-widget/cpu-widget.lua +++ b/cpu-widget/cpu-widget.lua @@ -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) + ) +) -- cgit v1.2.3