Move binds around and add multimonitor rules
This commit is contained in:
@@ -4,6 +4,32 @@ hl.workspace_rule({ workspace = "f[1]s[false]", gaps_out = 0, gaps_in = 0 })
|
||||
hl.window_rule({ match = { float = false, workspace = "w[tv1]s[false]" }, border_size = 0 })
|
||||
hl.window_rule({ match = { float = false, workspace = "f[1]s[false]" }, border_size = 0 })
|
||||
|
||||
-- For multiple monitors
|
||||
function map_monitors()
|
||||
local monitor_priority = {
|
||||
["eDP-1"] = -1
|
||||
}
|
||||
local monitors = hl.get_monitors()
|
||||
local nmonitors = #monitors
|
||||
table.sort(monitors, function(a, b)
|
||||
return (monitor_priority[a.name] or 0) > (monitor_priority[b.name] or 0)
|
||||
end)
|
||||
local workspace = 9
|
||||
for i, monitor in ipairs(monitors) do
|
||||
local lower_workspace = workspace + 1 - math.floor(9/nmonitors)
|
||||
if i == nmonitors then
|
||||
lower_workspace = 1
|
||||
end
|
||||
for j = workspace, lower_workspace, -1 do
|
||||
hl.workspace_rule({workspace = tostring(j), monitor = monitor.name})
|
||||
end
|
||||
workspace = lower_workspace - 1
|
||||
end
|
||||
end
|
||||
map_monitors()
|
||||
hl.on('monitor.added', map_monitors)
|
||||
hl.on('monitor.removed', map_monitors)
|
||||
|
||||
-- Special workspace
|
||||
hl.workspace_rule({ workspace = "s[true]", gaps_out = 64, gaps_in = 12})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user