Hyprland
Hyprland is the most popular compositor out there and it really shows why, it has 4 built-in layouts, animations, special workspaces and more.
Tips
The following do not come as default although we believe these are generally beneficial.
-
Disable window focus fallback when reaching the end of a monitor:
general { no_focus_fallback = true }In new Lua configuration:
hl.config{( general = { no_focus_fallback = true } )} -
Allow for clicks to passthrough the special workspace into normal workspaces:
input { special_fallthrough = true }In new Lua configuration:
hl.config({ input = { special_fallthrough = true, } }) -
Hide special workspaces when focusing a normal workspace:
binds { hide_special_on_workspace_change = true }In new Lua configuration:
hl.config({ binds = { hide_special_on_workspace_change = true, } }) -
Remove default wallpaper and nags:
misc { force_default_wallpaper = 0 disable_hyprland_logo = true disable_splash_rendering = true } ecosystem { no_donation_nag = true no_update_news = true }In new Lua configuration:
hl.config({ misc = { disable_hyprland_logo = true, }, ecosystem = { no_update_news = true, no_donation_nag = true, } }) -
Focus windows that request activation:
misc { focus_on_activate = true }In new Lua configuration:
hl.config({ misc = { focus_on_activate = true, } }) -
Color code the state of windows:
windowrule = border_color $yellow $yellow_dim, match:pin true windowrule = border_color $cyan $cyan_dim, match:fullscreen_state_internal 1 windowrule = border_color $blue $blue_dim, match:workspace s[true]In new Lua configuration:
hl.window_rule({ name = "pinned", match = { pin = true }, border_color = yellow .. " " .. yellow_dim, }) hl.window_rule({ name = "maximized", match = { fullscreen_state_internal = 1}, border_color = cyan .. " " .. cyan_dim, }) hl.window_rule({ name = "highlight_special", match = { workspace = "s[1]" }, border_color = blue .. " " .. blue_dim, })In this case we give pinned windows a yellow color, maximized windows cyan, and blue for windows in special workspaces as well as their respetive dimmed color for when they are unfocused.
-
Cycle through fullscreen windows with the same keybinds to focus winows directionally.
binds { movefocus_cycles_fullscreen = true }In new Lua configuration:
hl.config({ binds = { movefocus_cycles_fullscreen = true, } }) -
Define settings and toggle them:
local closeWindowBind = hl.bind(mm .. " + c", hl.dsp.window.close()) closeWindowBind:set_enabled(false) -
Set keybinds for workspace management in one go:
for i = 1, 10 do local key = i % 10 hl.bind( mainMod .. " + " .. key, hl.dsp.focus({ workspace = i }) ) hl.bind( mainMod .. " + SHIFT + " .. key, hl.dsp.window.move({ workspace = i, follow = true }) ) hl.bind( mainMod .. " + CTRL + " .. key, hl.dsp.window.move({ workspace = i, follow = false }) ) end -
Float stubborn windows(dynamic rules):
Extensions like password managers and others very often need to span a new browser window, with Firefox one can’t simply use a normal rule to make these float because Firefox renames the title of the window after it spawns. For this reason we make the following event function.
hl.on("window.title", function(w) if string.find(w.title, "Extension: (AliasVault)", nil, true ) then local monitor = hl.get_active_monitor() if monitor == nil then return end local win_size = { width = 500, height = 800 } local win_pos = { x = monitor.width * 0.5 - win_size.width * 0.5, y = monitor.height * 0.5 - win_size.height * 0.5, } hl.dispatch( hl.dsp.window.float({ action = "enable", window = w }) ) hl.dispatch( hl.dsp.window.resize({ x = win_size.width, y = win_size.height, relative = false, window = w }) ) hl.dispatch( hl.dsp.window.move({ x = win_pos.x, y = win_pos.y, relative = false, window = w }) ) end end)
Quirks
-
Mpv content type:
When toggling fullscreen on a mpv window the screen goes black for some seconds, to fix this use the following rule:
hl.window_rule({ name = "mpv_content_type", match = { class = "mpv" }, content = "none" })