fix hyprland folder
This commit is contained in:
46
.config/hypr/hyprland/layout.lua
Normal file
46
.config/hypr/hyprland/layout.lua
Normal file
@@ -0,0 +1,46 @@
|
||||
hl.config({
|
||||
dwindle = {
|
||||
preserve_split = true,
|
||||
|
||||
smart_split = false, -- No splitting based on cursor position
|
||||
force_split = 2, -- Always split to the right
|
||||
},
|
||||
|
||||
master = {
|
||||
new_status = "slave", -- New windows are added as slaves
|
||||
|
||||
mfact = 0.7,
|
||||
orientation = "right"
|
||||
}
|
||||
})
|
||||
|
||||
-- I needed to create a custom layout, because I can only configure the master layout's
|
||||
-- orientation globally, and this layout is used specifically for a vertical monitor.
|
||||
local focus_split = 0.66
|
||||
hl.layout.register("vertical", {
|
||||
recalculate = function(ctx)
|
||||
local n = #ctx.targets
|
||||
if n == 0 then return end
|
||||
|
||||
-- First, we place the first target in the focus area
|
||||
local focus_area = ctx:split(ctx.area, "bottom", focus_split)
|
||||
ctx.targets[1]:place(focus_area)
|
||||
|
||||
-- Then we split the remaining area into equal parts for the other targets (left-to-right)
|
||||
local remaining_area = ctx:split(ctx.area, "top", 1 - focus_split)
|
||||
local remaining = n - 1
|
||||
|
||||
for i, target in ipairs(ctx.targets) do
|
||||
if i == 1 then goto continue end -- Skip the first target, it's already placed
|
||||
|
||||
local remaining_split = 1 / remaining
|
||||
local target_area = ctx:split(remaining_area, "left", remaining_split)
|
||||
|
||||
remaining_area = ctx:split(remaining_area, "right", 1 - remaining_split)
|
||||
remaining = remaining - 1
|
||||
|
||||
target:place(target_area)
|
||||
::continue::
|
||||
end
|
||||
end
|
||||
})
|
||||
Reference in New Issue
Block a user