From bfab6229c834a14c89f148bdd299076a5140565c Mon Sep 17 00:00:00 2001 From: Kolan Sh Date: Mon, 26 Sep 2016 17:29:32 +0300 Subject: [PATCH] nethogs for wired/wireless widgets added (right mouse button). --- rc.lua | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/rc.lua b/rc.lua index ce8520e..e50b9d9 100644 --- a/rc.lua +++ b/rc.lua @@ -266,14 +266,17 @@ icon_wired_down_up:set_image (beautiful.widget_wired_down_up) function show_nload (interface) os.execute ("pgrep --full --exact 'nload "..interface.."' || urxvt -e nload "..interface.." &") end -icon_wifi:buttons(awful.util.table.join(awful.button({ }, 1, function () show_nload("wifi0") end))) -wifi_widget_down:buttons(awful.util.table.join(awful.button({ }, 1, function () show_nload("wifi0") end))) -icon_wifi_down_up:buttons(awful.util.table.join(awful.button({ }, 1, function () show_nload("wifi0") end))) -wifi_widget_up:buttons(awful.util.table.join(awful.button({ }, 1, function () show_nload("wifi0") end))) -icon_wired:buttons(awful.util.table.join(awful.button({ }, 1, function () show_nload("wan0") end))) -wired_widget_down:buttons(awful.util.table.join(awful.button({ }, 1, function () show_nload("wan0") end))) -icon_wired_down_up:buttons(awful.util.table.join(awful.button({ }, 1, function () show_nload("wan0") end))) -wired_widget_up:buttons(awful.util.table.join(awful.button({ }, 1, function () show_nload("wan0") end))) +function show_nethogs () + os.execute ("pgrep nethogs || urxvt -e sudo nethogs &") +end +icon_wifi:buttons(awful.util.table.join(awful.button({ }, 1, function () show_nload("wifi0") end), awful.button({ }, 3, show_nethogs))) +wifi_widget_down:buttons(awful.util.table.join(awful.button({ }, 1, function () show_nload("wifi0") end), awful.button({ }, 3, show_nethogs))) +icon_wifi_down_up:buttons(awful.util.table.join(awful.button({ }, 1, function () show_nload("wifi0") end), awful.button({ }, 3, show_nethogs))) +wifi_widget_up:buttons(awful.util.table.join(awful.button({ }, 1, function () show_nload("wifi0") end), awful.button({ }, 3, show_nethogs))) +icon_wired:buttons(awful.util.table.join(awful.button({ }, 1, function () show_nload("wan0") end), awful.button({ }, 3, show_nethogs))) +wired_widget_down:buttons(awful.util.table.join(awful.button({ }, 1, function () show_nload("wan0") end), awful.button({ }, 3, show_nethogs))) +icon_wired_down_up:buttons(awful.util.table.join(awful.button({ }, 1, function () show_nload("wan0") end), awful.button({ }, 3, show_nethogs))) +wired_widget_up:buttons(awful.util.table.join(awful.button({ }, 1, function () show_nload("wan0") end), awful.button({ }, 3, show_nethogs))) -- CPU icon function show_htop ()