mirror of
https://github.com/vincentbernat/i3wm-configuration.git
synced 2025-06-26 19:58:35 +02:00
widgets: add a widget to suspend/unsuspend naughty
This commit is contained in:
parent
c594dbdbb5
commit
8017a5ab3f
3 changed files with 14 additions and 0 deletions
BIN
icons/widgets/notifications-disabled.png
Normal file
BIN
icons/widgets/notifications-disabled.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 791 B |
BIN
icons/widgets/notifications-enabled.png
Normal file
BIN
icons/widgets/notifications-enabled.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 765 B |
|
@ -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),
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue