vicious.widgets.net glices with several registered widgets #1

This commit is contained in:
Kolan Sh 2018-05-09 21:39:24 +03:00
parent 4394fa73f9
commit 39d739303c
1 changed files with 13 additions and 27 deletions

40
rc.lua
View File

@ -234,18 +234,12 @@ optimus_icon:buttons(awful.util.table.join(
)) ))
-- Wi-Fi / Ethernet widgets -- Wi-Fi / Ethernet widgets
local wifi_widget_down = wibox.widget.textbox() local wifi_widget = wibox.widget.textbox()
local wifi_widget_up = wibox.widget.textbox()
local icon_wifi = wibox.widget.imagebox() local icon_wifi = wibox.widget.imagebox()
local icon_wifi_down_up = wibox.widget.imagebox()
icon_wifi:set_image (beautiful.widget_wifi) icon_wifi:set_image (beautiful.widget_wifi)
icon_wifi_down_up:set_image (beautiful.widget_wifi_down_up) local wired_widget = wibox.widget.textbox()
local wired_widget_down = wibox.widget.textbox()
local wired_widget_up = wibox.widget.textbox()
local icon_wired = wibox.widget.imagebox() local icon_wired = wibox.widget.imagebox()
local icon_wired_down_up = wibox.widget.imagebox()
icon_wired:set_image (beautiful.widget_wired) icon_wired:set_image (beautiful.widget_wired)
icon_wired_down_up:set_image (beautiful.widget_wired_down_up)
-- Network buttons -- Network buttons
function show_nload (interface) function show_nload (interface)
@ -254,14 +248,10 @@ end
function show_nethogs () function show_nethogs ()
os.execute ("pgrep nethogs || urxvt -e sudo nethogs &") os.execute ("pgrep nethogs || urxvt -e sudo nethogs &")
end end
icon_wifi:buttons(awful.util.table.join(awful.button({ }, 1, function () show_nload("wifi0") end), awful.button({ }, 3, show_nethogs))) icon_wifi:buttons(awful.util.table.join(awful.button({ }, 1, function () show_nload("wifi0") end), awful.button({ }, 1, show_nethogs)))
wifi_widget_down:buttons(icon_wifi:buttons()) wifi_widget:buttons(icon_wifi:buttons())
icon_wifi_down_up:buttons(icon_wifi:buttons()) icon_wired:buttons(awful.util.table.join(awful.button({ }, 1, function () show_nload("wan0") end), awful.button({ }, 1, show_nethogs)))
wifi_widget_up:buttons(icon_wifi:buttons()) wired_widget:buttons(icon_wired:buttons())
icon_wired:buttons(awful.util.table.join(awful.button({ }, 1, function () show_nload("wan0") end), awful.button({ }, 3, show_nethogs)))
wired_widget_down:buttons(icon_wired:buttons())
icon_wired_down_up:buttons(icon_wired:buttons())
wired_widget_up:buttons(icon_wired:buttons())
-- VOL icon -- VOL icon
vicious.cache(vicious.widgets.volume) vicious.cache(vicious.widgets.volume)
@ -317,11 +307,11 @@ disk = wibox.widget.textbox()
vicious.register(disk, vicious.widgets.fs, '<span color="#cc7c4b">${/mnt/bcache0 avail_gb}Gb </span>', 15) vicious.register(disk, vicious.widgets.fs, '<span color="#cc7c4b">${/mnt/bcache0 avail_gb}Gb </span>', 15)
disk:buttons(diskicon:buttons()) disk:buttons(diskicon:buttons())
vicious.cache(vicious.widgets.net) --vicious.cache(vicious.widgets.net)
vicious.register(wifi_widget_down, vicious.widgets.net, '<span color="#baa53f">${wifi0 down_mb}</span>', 2) --vicious.cache(wifi_widget)
vicious.register(wifi_widget_up, vicious.widgets.net, '<span color="#b165bd">${wifi0 up_mb}</span>', 2) --vicious.cache(wired_widget)
vicious.register(wired_widget_down, vicious.widgets.net, '<span color="#baa53f">${wan0 down_mb}</span>', 2) vicious.register(wifi_widget, vicious.widgets.net, '<span color="#A3D34D">${wifi0 down_mb}</span>^<span color="#DB5786">${wifi0 up_mb}</span>', 2)
vicious.register(wired_widget_up, vicious.widgets.net, '<span color="#b165bd">${wan0 up_mb}</span>', 2) vicious.register(wired_widget, vicious.widgets.net, '<span color="#A3D34D">${wan0 down_mb}</span>^<span color="#DB5786">${wan0 up_mb}</span><span color="#848484">mb/s</span>', 2)
@ -455,14 +445,10 @@ awful.screen.connect_for_each_screen(function(s)
baticon, baticon,
batpct, batpct,
icon_wifi, icon_wifi,
wifi_widget_down, wifi_widget,
icon_wifi_down_up,
wifi_widget_up,
spacer, spacer,
icon_wired, icon_wired,
wired_widget_down, wired_widget,
icon_wired_down_up,
wired_widget_up,
spacer, spacer,
volicon, volicon,
volpct, volpct,