I am using latest hyprland-git using lua and working great, but I just start using hyprland’s scratch pads. The only issue I have is when going from my docking setup(big monitor) to my laptop screen, my scratchpads aren’t transferring with correct size.
local function apply_monitor_config()
local monitors = hl.get_monitors()
local big_monitor_name = nil-- Loop through active screens and find any HDMI-A output for _, m in ipairs(monitors) do if m.name and m.name:match("^HDMI%-A") then big_monitor_name = m.name break end end -- Apply layouts based on detection if big_monitor_name then -- Big monitor on the left hl.monitor({ output = big_monitor_name, mode = "3840x2160@60", position = "0x0", scale = "1", }) -- Laptop screen on the right hl.monitor({ output = "eDP-1", disabled = true, }) else -- Fallback: Laptop screen only when disconnected from the KVM hl.monitor({ output = "eDP-1", disabled = false, mode = "1920x1080@60", position = "0x0", scale = "1", }) end -- -- Re-bind special workspaces to active output so geometry re-evaluates nativel -- Restart Waybar cleanly hl.exec_cmd("systemctl --user restart waybar") -- Respawn terminals on the new active resolution -- monitor_w and monitor_h in windowrules.lua will evaluate against the current displayend
-- Connect the configuration handler to Hyprland’s window manager event hooks
–hl.on(“config.reloaded”, apply_monitor_config)
hl.on(“monitor.added”, apply_monitor_config)
hl.on(“monitor.removed”, apply_monitor_config)
-- Run the check immediately on initialization
apply_monitor_config()
hl.window_rule({
name = “kitty_dropterm_scratchpad”,
match = { class = “kitty-dropterm” },
float = true,
size = { “monitor_w * 0.7”, “monitor_h * 0.7” },
center = true,
stay_focused = true,
workspace = “special:term silent”,
})hl.window_rule({
name = “kitty_dropneomutt_scratchpad”,
match = { class = “kitty-dropneomutt” },
float = true,
size = { “monitor_w * 0.7”, “monitor_h * 0.7” },
center = true,
stay_focused = true,
workspace = “special:neomutt silent”,
})hl.window_rule({
name = “kitty_dropyazi_scratchpad”,
match = { class = “kitty-dropyazi” },
float = true,
size = { “monitor_w * 0.7”, “monitor_h * 0.7” },
center = true,
stay_focused = true,
workspace = “special:yazi silent”,
})hl.window_rule({
name = “kitty_dropcmus_scratchpad”,
match = { class = “kitty-dropcmus” },
float = true,
size = { “monitor_w * 0.7”, “monitor_h * 0.7” },
center = true,
stay_focused = true,
workspace = “special:cmus silent”,
})