Files
community-plugins/hypr-layout-switcher/widget.luau
T
19e81f3e47 added hyprland layout switcher (#232)
* added hyprland layout switcher

* fixes after plugin checking

---------

Co-authored-by: Martin Goldhahn <martin@goldhahn.info>
2026-08-03 22:54:33 -04:00

30 lines
562 B
Luau

--!nonstrict
local glyphs = {
dwindle = "layout-grid",
master = "layout-sidebar",
monocle = "square",
scrolling = "arrows-horizontal",
}
local current = "dwindle"
local function render()
barWidget.setGlyph(glyphs[current] or "layout-grid")
barWidget.setText(current:sub(1, 1):upper() .. current:sub(2))
end
noctalia.state.watch("layout", function(value)
if value then
current = value
render()
end
end)
function onClick()
noctalia.runAsync("noctalia msg plugin maddingo/hypr-layout-switcher:poller all cycle")
end
render()