Files
dotfiles/hypr/hyprland/rules.lua

80 lines
2.0 KiB
Lua

-- Smart gaps
hl.workspace_rule({ workspace = "w[tv1]s[false]", gaps_out = 0, gaps_in = 0 })
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 })
-- Special workspace
hl.workspace_rule({ workspace = "s[true]", gaps_out = 64, gaps_in = 12})
-- Misc window rules
hl.window_rule({
match = {
class = "Write:"
},
float = true
})
hl.window_rule({
match = {
class = "xdg-desktop-portal-gtk"
},
float = true
})
hl.window_rule({
match = {
title = "(Open File)"
},
no_blur = true
})
hl.window_rule({
match = {
class = "(Xdg-desktop-portal-gtk)"
},
no_blur = true
})
hl.window_rule({
match = {
class = "(eog)"
},
float = true,
center = true
})
hl.window_rule({
match = {
class = "ninjabrainbot-Main"
},
float = true,
move = {10, "monitor_h*0.5 - window_h*0.5"}
})
hl.window_rule({
match = {
class = "(mpv|loupe|com.gabm.satty)"
},
float = true,
size = { "monitor_w*0.95", "monitor_h*0.95"}
})
hl.layer_rule({
match = { namespace = "quickshell" },
no_anim = true
})
hl.on("window.active", function(window, active)
if window == nil or window.class == nil then
hl.dispatch(hl.dsp.submap("reset"))
return
end
if window.class:find("zen") == 1 then
hl.dispatch(hl.dsp.submap("zen"))
elseif window.class:find("Minecraft") == 1 then
hl.dispatch(hl.dsp.submap("mcsr"))
else
hl.dispatch(hl.dsp.submap("reset"))
end
end)
hl.define_submap("zen", function()
hl.bind("ALT + ALT_L", hl.dsp.send_key_state({mods = "ALT", key = "F12", state = "down"}), {release = true})
hl.bind("ALT + N", hl.dsp.send_shortcut({mods = "CTRL", key = "TAB"}))
hl.bind("ALT + T", hl.dsp.send_shortcut({mods = "CTRL + SHIFT", key = "TAB"}))
end)