added hyprland layout switcher (#232)
* added hyprland layout switcher * fixes after plugin checking --------- Co-authored-by: Martin Goldhahn <martin@goldhahn.info>
This commit is contained in:
co-authored by
Martin Goldhahn
parent
4c8346c07c
commit
19e81f3e47
@@ -0,0 +1,29 @@
|
||||
--!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()
|
||||
|
||||
Reference in New Issue
Block a user