Initial commit after everything works
This commit is contained in:
+8
-3
@@ -5,14 +5,18 @@
|
||||
local function get_monitor_names()
|
||||
local names = {}
|
||||
for _, m in ipairs(hl.get_monitors()) do
|
||||
names[m.name] = true
|
||||
names[m.name] = m.name
|
||||
if m.description then
|
||||
local clean_desc = m.description:gsub(" %([^%)]+%)$", "")
|
||||
names["desc:" .. clean_desc] = m.name
|
||||
end
|
||||
end
|
||||
return names
|
||||
end
|
||||
|
||||
local function assign_workspaces()
|
||||
local monitors = get_monitor_names()
|
||||
local has_dock = monitors["DP-7"] and monitors["DP-8"]
|
||||
local has_dock = monitors["desc:Ancor Communications Inc ASUS VS228 E3LMTF071438"] and monitors["desc:Ancor Communications Inc ASUS VS228 E3LMTF071391"]
|
||||
|
||||
-- Read workspace configurations
|
||||
package.loaded["workspace_config"] = nil -- force reload in case it changed
|
||||
@@ -21,7 +25,8 @@ local function assign_workspaces()
|
||||
-- Iterate in REVERSE to assign the most negative IDs to the first items, counteracting Waybar's low-to-high sorting!
|
||||
for i = #ws_config, 1, -1 do
|
||||
local ws = ws_config[i]
|
||||
local target_mon = has_dock and ws.monitor or "eDP-1"
|
||||
local target_mon = has_dock and monitors[ws.monitor] or "eDP-1"
|
||||
if not target_mon then target_mon = "eDP-1" end
|
||||
hl.workspace_rule({ workspace = "name:" .. ws.name, monitor = target_mon, persistent = true, default = true })
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user