From d82e219ec9a8daa71a861a1b066ca9798460eb6e Mon Sep 17 00:00:00 2001 From: Felis Date: Sun, 23 Aug 2026 17:35:24 -0700 Subject: [PATCH] persist workspaces --- config/workspaces.lua | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/config/workspaces.lua b/config/workspaces.lua index 49b086e..11a82ca 100644 --- a/config/workspaces.lua +++ b/config/workspaces.lua @@ -1,6 +1,26 @@ --- Create persistent master-layout workspaces from the shared workspace list. +-- 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,