dotfiles/.notion/mod_switch_or_create_ws.lua
2023-11-08 11:02:37 +01:00

18 lines
527 B
Lua

-- create ws (if not present) and switch
function ws_switch_or_create(ws)
if not WScreen.switch_nth(_, ws) then
ioncore.create_ws(_, ws)
WScreen.switch_nth(_, ws)
end
end
-- ideally, if I leave a workspace with nothing but an empty frame, it could be deleted.
-- but that's for another year.
-- later mapped to META..0-9
ioncore.defbindings("WScreen", {
kpress(META.."5", "ws_switch_or_create(5)"),
kpress(META.."6", "ws_switch_or_create(6)"),
kpress(META.."7", "ws_switch_or_create(7)"),
})