Files
2026-08-23 17:35:24 -07:00

36 lines
1.1 KiB
Lua

-- Create persistent numbered workspaces and dedicated named workspaces.
local settings = require("config.settings")
-- Number keys address workspaces 1-9 directly and the 0 key addresses
-- workspace 10. Odd-numbered workspaces live on the left/primary monitor;
-- even-numbered workspaces, including workspace 10, live on the right/secondary
-- monitor.
for workspace = 1, 10 do
local monitor = settings.monitors.primary.output
if workspace % 2 == 0 then
monitor = settings.monitors.secondary.output
end
hl.workspace_rule({
workspace = tostring(workspace),
monitor = monitor,
persistent = true,
})
end
-- Named workspaces keep their individually selected layouts and remain on the
-- right-hand monitor.
for _, workspace in ipairs(settings.named_workspaces) do
hl.workspace_rule({
workspace = workspace.selector,
layout = workspace.layout or "master",
layout_opts = {
orientation = "left",
},
persistent = true,
-- Keep communication/media workspaces on the right-hand monitor.
monitor = settings.monitors.secondary.output,
})
end