From b1b1d3567a935577e5de244611be7d027d5553dd Mon Sep 17 00:00:00 2001 From: Kolan Sh Date: Mon, 20 Feb 2017 13:09:11 +0300 Subject: [PATCH] powertop for battery widget added (right mouse button). --- wi.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wi.lua b/wi.lua index ee1a425..3a98455 100644 --- a/wi.lua +++ b/wi.lua @@ -62,7 +62,10 @@ function popup_bat() naughty.notify { text = "Charge : " .. bat_charge .. "%\nState : " .. state .. " (" .. bat_time .. ")", timeout = 5, hover_timeout = 0.5 } end -batpct:buttons(awful.util.table.join(awful.button({ }, 1, popup_bat))) +function show_powertop () + os.execute ("pgrep powertop || urxvt -e sudo powertop &") +end +batpct:buttons(awful.util.table.join(awful.button({ }, 1, popup_bat), awful.button({ }, 3, show_powertop))) baticon:buttons(batpct:buttons()) ----< Volume >--------------------------------------------------------