Find the hyprlang lines in a Lua config that do nothing or break the file
The cause holds. Every quoted parse result was reproduced with Lua 5.5.1 on this machine: the five assignment lines run silently, and windowrulev2, the 0.53 windowrule form, exec-once, $mainMod, monitor, bindm, the general block and hl.set give exactly the quoted messages. In v0.56.2, safeLuaRequire (ConfigManager.cpp line 312) turns an error in a required file into a 'require("<module>"): ...' config error and returns an empty table, so that file is lost. Phase 1 of a reload runs luaL_loadfile on the main config only and keeps the old config when that fails. hl.set and a top-level hl.submap are not registered (only hl.dsp.submap and hl.define_submap exist). hl.env, hl.unbind, hl.dsp.window.close, hl.dsp.focus({ workspace }) and hl.dsp.window.move({ workspace }) all exist and match Omarchy's tiling.lua. The fix had a copy-paste defect: the block bound SUPER + Q twice (hl.bind and o.bind) and then called hl.unbind("SUPER + Q"). hlUnbind calls removeKeybind on the key, so pasting the block in order deletes the user's new bind as well. The $mainMod example rebinds SUPER+RETURN, which Omarchy binds to the terminal in default/hypr/bindings/applications.lua, so both would fire. And o.launch_on_start("waybar") on Omarchy 4 adds a second bar beside omarchy-shell. The fix is rewritten with unbind before bind, alternatives commented out, those Omarchy notes added, and a caveat that the step 1 grep also matches field lines inside multi-line Lua tables. The rest of the fix is unchanged. Nothing was exercised inside a running Hyprland.
Symptom
I pasted my old hyprland.conf lines into ~/.config/hypr/bindings.lua (or hyprland.lua) and nothing happens: no error bar, no new keybinding, no cursor size change. Or the opposite: a red error such as <name> expected near '^', syntax error near '-', unexpected symbol near '$', malformed number near '1920x', attempt to call a nil value (global 'general') or attempt to call a nil value (field 'set'), and every binding I had in that file is gone, including the hl.unbind lines, so Omarchy's defaults come back on keys I had replaced.
Cause
Hyprland 0.55 and later evaluate ~/.config/hypr/hyprland.lua and everything it requires as Lua, and Omarchy 4 ships only Lua. hyprlang lines fall into two groups when Lua reads them.
Some are valid Lua by accident. bind = SUPER, Q, exec, kitty is a multiple assignment: it sets a global named bind to the value of the undefined global SUPER (nil) and discards the rest. env = XCURSOR_SIZE,24, bezier = myBezier, 0.05, 0.9, 0.1, 1.05, animation = windows, 1, 7, myBezier and layerrule = blur, waybar behave the same way. They raise nothing and register nothing. Confirmed by running each line through Lua 5.5.1, which is the liblua.so.5.5 that Hyprland 0.56.2 links on Omarchy 4.
The rest are syntax or runtime errors: windowrulev2 = float, class:^(pavucontrol)$ gives <name> expected near '^', exec-once = waybar gives syntax error near '-', $mainMod = SUPER gives unexpected symbol near '$', monitor = DP-1, 1920x1080@60, 0x0, 1 gives malformed number near '1920x', bindm = SUPER, mouse:272, movewindow gives <name> expected near '272', a section block such as general { gaps_in = 5 } is a call of an undefined global and gives attempt to call a nil value (global 'general'), and AI-written configs often use hl.set(...) or hl.submap(...), which do not exist in the 0.56 API and give attempt to call a nil value (field 'set').
Where the error lands decides how much is lost. Hyprland 0.56.2 replaces require with a protected version (safeLuaRequire in src/config/lua/ConfigManager.cpp): an error inside a required file is added to the config error list as require("hypr.bindings"): ... and loading carries on with the next file, so the whole of that one file is lost, binds and unbinds alike. Only the main file is syntax-checked before a reload, so a syntax error in hyprland.lua itself makes Hyprland refuse the reload and keep the old config.
Fix
**1. Find the leftovers.** This lists hyprlang-shaped assignment lines in every Lua file, including the silent ones:
grep -nE '^[[:space:]]*(bind[a-z]*|unbind|env|bezier|animation|exec(-once)?|windowrule(v2)?|layerrule|monitor|workspace|source|gesture|\$[A-Za-z_]+)[[:space:]]*=' ~/.config/hypr/*.lua
grep -nE '^[[:space:]]*[a-z_]+[[:space:]]*\{' ~/.config/hypr/*.lua # hyprlang section blocks
hyprctl configerrors
The first grep also matches legitimate fields inside a Lua table that spans several lines, such as workspace = "3 silent", or animation = "slide", inside an hl.window_rule({ ... }). A leftover hyprlang line sits at the top level of the file and carries commas and no quotes, as in bind = SUPER, Q, exec, kitty.
**2. Rewrite each line in the Lua API.** On Omarchy 4, put each kind in the file Omarchy loads it from: binds in ~/.config/hypr/bindings.lua, input in ~/.config/hypr/input.lua, look and animations in ~/.config/hypr/looknfeel.lua, autostart in ~/.config/hypr/autostart.lua, monitors in ~/.config/hypr/monitors.lua. All of them load after Omarchy's defaults, so they win. On plain Arch, put them in ~/.config/hypr/hyprland.lua or a file it requires.
Each pair below is one hyprlang line and its Lua equivalent. Where two Lua forms are shown, pick one: pasting both binds the key twice.
-- If Omarchy already uses the key, unbind it FIRST, then bind it.
-- hl.unbind removes every bind on that key, including one you added above it.
hl.unbind("SUPER + Q")
-- bind = SUPER, Q, exec, kitty
hl.bind("SUPER + Q", hl.dsp.exec_cmd("kitty"))
-- or, on Omarchy 4, the helper that takes a plain command and a description for SUPER+K:
-- o.bind("SUPER + Q", "Terminal", "kitty")
-- Omarchy 4 already binds SUPER+W, SUPER+1..0 and SUPER+SHIFT+1..0 to these actions.
-- bind = SUPER, W, killactive
hl.bind("SUPER + W", hl.dsp.window.close())
-- bind = SUPER, 3, workspace, 3
hl.bind("SUPER + 3", hl.dsp.focus({ workspace = "3" }))
-- bind = SUPER SHIFT, 3, movetoworkspace, 3
hl.bind("SUPER + SHIFT + 3", hl.dsp.window.move({ workspace = "3" }))
-- env = XCURSOR_SIZE,24
hl.env("XCURSOR_SIZE", "24")
-- general { gaps_in = 5 } or keyword general:gaps_in 5
hl.config({ general = { gaps_in = 5 } })
-- $mainMod = SUPER (a local is visible only in the file that declares it)
local mainMod = "SUPER"
-- SUPER+RETURN is Omarchy's terminal key, so unbind it first on Omarchy 4:
hl.unbind(mainMod .. " + RETURN")
hl.bind(mainMod .. " + RETURN", hl.dsp.exec_cmd("kitty"))
-- exec-once = waybar
hl.on("hyprland.start", function() hl.exec_cmd("waybar") end)
-- or, on Omarchy 4, in ~/.config/hypr/autostart.lua:
-- o.launch_on_start("waybar")
-- Omarchy 4 draws its own bar with omarchy-shell, so a waybar line copied
-- from an old config adds a second bar. Drop it there.
bezier/animation, windowrule/windowrulev2/layerrule, submap and source each have their own trap. See the records lua-animation-needs-bezier-key-and-hl-curve, windowrulev2-into-lua-hl-window-rule, lua-submap-binds-leak-global and hyprlang-variables-and-source-to-lua.
**3. Reload and read the errors.** Hyprland reloads on save by itself. To force it:
hyprctl reload
hyprctl configerrors
Verify
grep from step 1 prints nothing, hyprctl configerrors prints an empty list, and the new bind appears in hyprctl -j binds (search for its key) and in omarchy menu keybindings --print on Omarchy 4. The Lua parse results above were checked with the Lua 5.5.1 interpreter on Omarchy 4. They were not exercised inside a running Hyprland.
Sources
- https://wiki.hypr.land/configuring/core/
- https://wiki.hypr.land/configuring/core/dispatchers/
- https://wiki.hypr.land/configuring/core/autostart/
- https://wiki.hypr.land/configuring/core/environment-variables/
- https://github.com/hyprwm/Hyprland/blob/v0.56.2/src/config/lua/ConfigManager.cpp
- https://github.com/omacom/omarchy/blob/quattro/config/hypr/hyprland.lua
- https://github.com/omacom/omarchy/blob/quattro/config/hypr/bindings.lua
- https://github.com/omacom/omarchy/blob/quattro/default/hypr/helpers.lua
- https://github.com/hyprwm/Hyprland/blob/v0.56.2/src/config/lua/bindings/LuaBindingsToplevel.cpp