nethogs for wired/wireless widgets added (right mouse button).

This commit is contained in:
Kolan Sh 2016-09-26 17:29:32 +03:00
parent 6d2e119811
commit bfab6229c8
1 changed files with 11 additions and 8 deletions

19
rc.lua
View File

@ -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 ()