widgets: add a widget to suspend/unsuspend naughty

This commit is contained in:
Vincent Bernat 2020-08-10 10:00:09 +02:00
parent c594dbdbb5
commit 8017a5ab3f
3 changed files with 14 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 791 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 765 B

View file

@ -223,6 +223,19 @@ vicious.register(fswidget, vicious.widgets.fs,
return result return result
end, 53, "-lx fuse -x aufs") end, 53, "-lx fuse -x aufs")
local notifications = widget({ type = "imagebox" })
notifications.image = image(beautiful.icons .. "/widgets/notifications-enabled.png")
notifications:buttons(awful.util.table.join(
awful.button({ }, 1,
function()
local state = "enabled"
naughty.toggle()
if naughty.is_suspended() then
state = "disabled"
end
notifications.image = image(beautiful.icons .. "/widgets/notifications-" .. state .. ".png")
end)))
local systray = widget({ type = "systray" }) local systray = widget({ type = "systray" })
-- Wibox initialisation -- Wibox initialisation
@ -283,6 +296,7 @@ for s = 1, screen.count() do
layout = awful.widget.layout.horizontal.leftright layout = awful.widget.layout.horizontal.leftright
}, },
on(1, systray), on(1, systray),
on(1, notifications),
sepclose, datewidget, screen.count() > 1 and dateicon or "", spacer, sepclose, datewidget, screen.count() > 1 and dateicon or "", spacer,
on(2, volwidget), screen.count() > 1 and on(2, volicon) or "", on(2, spacer), on(2, volwidget), screen.count() > 1 and on(2, volicon) or "", on(2, spacer),