Hyprland configuration and display control
Hyprland is the compositor that connects Omarchy's Wayland desktop session to its displays and windows. Its Lua configuration sets the normal session rules, while command helpers apply short-lived or persistent changes for monitors, workspaces, focus, layout, fullscreen state, laptop displays, appearance, rendering performance, and reloads. This page complements desktop session and window management, shell UI and desktop interactions, and hardware profiles and device controls.
Configuration tree
The configuration tree separates shipped defaults from user-owned settings. /home/user/repo/config/hypr/hyprland.lua first loads the Omarchy bootstrap and defaults. It then loads user files for monitors, input, bindings, appearance, and startup. This order lets a user override defaults without editing the shipped rule set.
The main configuration areas are:
| Area | Purpose |
|---|---|
monitors.lua | Add monitor rules and compositor settings that the monitor panel does not cover. |
input.lua | Set keyboard, pointer, touchpad, and gesture behavior. |
bindings.lua | Add, replace, or remove personal key bindings. |
looknfeel.lua | Adjust gaps, borders, decoration, animation, and layout behavior. |
autostart.lua | Add user processes that start with Hyprland. |
~/.local/state/omarchy/toggles/hypr | Hold enabled runtime flags and generated display rules. |
The user-owned input.lua layer keeps personal input changes separate from the shipped defaults. Uncommented settings replace defaults, while app-specific touchpad rates and optional three-finger gestures extend input behavior without changing the main binding tree. References: config/hypr/input.lua#L1-L60
The user-owned bindings.lua layer is for personal additions, replacements, and removals. It can also turn off all Omarchy bindings or only preinstalled app and web-app bindings before the user adds a smaller set. The file documents the binding actions for these three cases and points to the keybinding menu as the way to inspect the resulting bindings and their descriptions. References: config/hypr/bindings.lua#L1-L28
The runtime toggle tree is loaded with the normal configuration. A toggle therefore changes the active compositor state and survives a reload until the flag is removed. Corner shape and window transparency are examples of saved appearance choices. The generic toggle helper copies a shipped flag into the runtime tree or removes it, then reloads Hyprland. The refresh helper can replace the user configuration files with shipped defaults and keeps a backup when it replaces an existing file, so local edits and runtime state have different ownership rules.
References: config/…/hyprland.lua• L1-32 config/…/monitors.lua• L1-37 default/…/omarchy.lua• L1-23 default/…/toggles.lua• L1-23 bin/omarchy-hyprland-toggle• L15-54 bin/omarchy-hyprland-corners• L7-40 bin/omarchy-hyprland-window-transparency• L7-32 bin/omarchy-refresh-hyprland• L1-14 bin/omarchy-refresh-config• L20-43
Display control
Display control maps Hyprland monitor data to a stable laptop or external-display state. The monitor helpers query the compositor as JSON, then use Lua commands or a reload to apply a mode, position, scale, mirror, or disabled state.
Monitor configuration
config/hypr/monitors.lua is the user-owned place for monitor choices that the top-bar monitor panel does not cover. It loads after Omarchy's defaults, so an active panel choice normally remains in control for that monitor. A user can turn off those saved panel choices when the same monitor setup must come from the configuration across machines.
The file can also set a monitor by description instead of its connector, apply a scale or mode that the panel does not offer, disable an unwanted output, set GTK and XWayland scaling, enable 10-bit color, or control variable refresh rate. These are optional rules rather than a required catch-all layout.
The display scale helper changes the focused monitor at runtime. It rounds the request to a scale that fits the monitor's pixel size, updates the GTK scale, and persists the result when the configuration still uses Omarchy's generic scale setting. This keeps the active display and later sessions aligned.
References: config/…/monitors.lua• L1-37 bin/omarchy-hyprland-monitor-scaling• L1-17 bin/omarchy-hyprland-monitor-scaling• L55-112 default/…/tiling.lua• L97-98
Clamshell state
Clamshell state is the combination of laptop-lid state and active external monitors. When the lid is closed and an external monitor is active, the internal panel is disabled. When the lid opens or no external monitor remains, the internal panel is enabled again. The system does not disable the only active display.
The external-monitor check counts only enabled real external outputs. It ignores the internal panel and Hyprland's FALLBACK output, which can exist after the last external monitor is unplugged. This lets clamshell recovery turn the internal panel back on at the correct time.
The lid bindings handle the normal close and open events. A monitor event watcher also reconciles the state after monitor add or remove events and polls while a docked laptop is active. This backstop covers missed lid events and suspend or resume changes. The internal-display helper also has a recovery action that wakes the panel only after an external display is gone and the panel was disabled.
Automatic clamshell disable is separate from a user's manual panel disable. The helper removes only its own runtime flag when it restores the panel, preserves a manual disable while another output is active, and remembers the panel scale before it turns the panel off. This lets recovery restore the configured panel position and scale without overriding a deliberate display choice.
The related mirror mode uses the internal panel as the output and mirrors it to every active external monitor. It rejects unsafe connector names before creating a monitor rule, clears mirror state when the external monitor is lost, and removes the manual internal-disable choice before it creates mirror state.
References: default/…/utilities.lua• L31-36 default/…/autostart.lua• L1-14 bin/omarchy-hyprland-monitor-clamshell• L6-20 bin/omarchy-hyprland-monitor-clamshell• L110-214 bin/omarchy-hyprland-monitor-clamshell• L223-266 bin/omarchy-hyprland-monitor-internal• L10-59 bin/omarchy-hyprland-monitor-internal-mirror• L10-63 bin/omarchy-hyprland-monitor-watch• L9-25 bin/omarchy-hyprland-monitor-watch• L64-115
The display flow moves from compositor state to a chosen laptop or external-display action. This diagram shows the normal clamshell path and its recovery loop.
flowchart TD
A[Monitor or lid event] --> B[Read Hyprland monitor state]
B --> C{Closed lid and active external display?}
C -->|Yes| D[Remember scale and disable internal panel]
C -->|No| E[Enable internal panel and sync scale]
D --> F[Reload Hyprland]
E --> F
F --> G[Watch later monitor changes]
G --> B
Monitor recovery
Monitor recovery handles outputs that are present but do not yet report a usable mode. The watcher checks this modeless state after startup, monitor changes, and reload events. It retries guarded reloads with increasing delays until Hyprland reports a usable display or the session can no longer answer.
Reloads are guarded during package changes. The guard pauses automatic reload and suppresses transient errors for each live Hyprland instance, then restores the old values and performs one controlled reload when the package operation ends. If a package transaction replaced the running compositor binary, the old instance stays paused until the session restarts.
References: bin/omarchy-hyprland-monitor-watch• L17-61 bin/omarchy-hyprland-monitor-watch• L90-115 bin/omarchy-hyprland-monitor-modeless• L1-21 bin/omarchy-hyprland-reload-guard• L40-57 bin/omarchy-hyprland-reload-guard• L59-129
Workspace and window behavior
The default tiling bindings provide the main movement model for the desktop. They switch and move windows across numbered workspaces, special scratchpad workspaces, and neighboring monitors while keeping focus and layout changes available from the keyboard.
Workspace layouts
Each workspace can use dwindle, scrolling, or floating. Dwindle is Hyprland's normal tiled layout, scrolling arranges tiled windows horizontally, and floating gives the workspace a floating-window mode. A workspace-specific choice takes priority over the saved default.
The workspace helper reads the active layout, switches to the next or previous mode, applies it at once, and saves a rule for that workspace. When a workspace returns to the default mode, its private rule is removed so later default changes can reach it. The default-layout helper preserves the current mode of busy workspaces, including workspaces represented by minimized windows, and changes only workspaces that follow the default. If Hyprland cannot provide a complete workspace and client view, it changes nothing.
The layout reader combines Hyprland's live tiled-layout value with saved workspace state. It also recognizes the special minimized workspace, so the workspace bar and dock can show the mode that controls whether minimize is available.
References: default/…/tiling.lua• L14-40 bin/omarchy-hyprland-workspace-layout-current• L6-28 bin/omarchy-hyprland-workspace-layout-default• L18-97 bin/omarchy-hyprland-workspace-layout-toggle• L17-98 default/…/workspace-layouts.lua• L1-8
Focus and movement
Focus commands act on windows, workspaces, and monitors as related targets. Directional keys move focus between nearby windows, workspace keys select or move windows, and monitor keys move the active workspace or focus another output. Separate commands support cycling windows, returning to the former workspace, and moving through grouped windows.
The application focus helper adds a name-based path for scripts and launchers. It searches active client identity first and then supports the launch-time title used by agent terminals before focusing the matching window. Application bindings use the shared binding helpers to turn launch, focus, web app, and menu actions into compositor commands or shell actions.
References: default/…/tiling.lua• L16-53 default/…/applications.lua• L1-36 bin/omarchy-hyprland-focus-app• L12-34 default/…/helpers.lua• L90-151
Window layout
Window helpers expose focused-window changes without requiring callers to know Hyprland's lower-level dispatch form. They can resize a window, save and restore a width per application and workspace, toggle gaps, constrain a single window to a square shape, change transparency, or pop a tile into a pinned floating window.
The default window rules establish common behavior for all windows and then allow application-specific rules to adjust it. App rules use shared tags and match data to place special windows into a consistent layout. For example, browser video windows can leave the normal browser treatment, picture-in-picture and webcam windows can stay pinned, and dialogs or system surfaces can use a centered floating treatment.
Window lifecycle helpers can close every open client and optionally wait for its owning process to exit. The close-all path records the owning processes before it closes their windows, then returns the focused monitor to workspace 1. Minimize moves a window to the special minimized workspace only from a floating workspace, while a source tag records the workspace that the dock must restore.
References: default/…/tiling.lua• L5-14 default/…/utilities.lua• L16-22 default/…/windows.lua• L1-26 default/…/helpers.lua• L213-230 bin/omarchy-hyprland-window-width• L1-6 bin/omarchy-hyprland-window-width• L73-168 bin/omarchy-hyprland-window-pop• L1-40 bin/omarchy-hyprland-window-close-all• L6-29 bin/omarchy-hyprland-window-minimize• L6-36 default/…/browser.lua• L1-10 default/…/pip.lua• L1-20 default/…/system.lua• L1-44 default/…/webcam-overlay.lua• L1-23
Appearance toggles
Appearance helpers provide persistent choices that sit above the current theme. Corner control follows the theme or forces sharp or rounded corners. Window transparency control selects opaque, transparent, or glassy behavior and updates related terminal appearance when needed.
These choices are saved as mutually exclusive state files, then applied by a reload. Corner control saves a new override before it removes the old one, which keeps the prior choice available if saving fails. After the reload, it updates T3 Code so that its rounding state follows the new Hyprland state. The transparency path protects the theme update with a lock and restores the previous choice if the glass settings cannot be written, so the saved state does not disagree with the screen.
References: bin/omarchy-hyprland-corners• L7-43 bin/omarchy-hyprland-window-transparency• L7-64 default/…/toggles.lua• L1-23
Rendering performance
The software-rendering helper detects when Hyprland draws through the CPU instead of a usable GPU. It marks the current compositor session and reloads lighter defaults that disable animations, blur, and shadows unless the user has explicitly chosen to keep animations without a GPU. The marker belongs to the current session, so a later session checks its renderer again.
The animation status helper reports both sources of disabled animation: the saved no-animations choice and the automatic software-rendering state. This keeps the appearance UI aligned with the reason the compositor is not animating.
References: bin/omarchy-hyprland-software-rendering• L1-13 bin/omarchy-hyprland-software-rendering• L19-83 bin/omarchy-hyprland-animations-off• L3-14 default/…/software-rendering.lua• L1-23
Fullscreen behavior
Hyprland exposes more than one fullscreen result because a user may want either a true fullscreen window, a tiled fullscreen window, or a full-width window. The default bindings keep these choices separate, and the tiled-fullscreen helper changes the client fullscreen state while leaving the internal compositor state unchanged.
The desktop-wide fullscreen toggle is separate from window fullscreen. It is bound as a runtime toggle so other desktop surfaces can respond to the same state. Application rules can also request fullscreen for apps such as games or screensavers without changing the meaning of the user-facing window toggle.
References: default/…/tiling.lua• L7-11 default/…/utilities.lua• L19-23 bin/omarchy-hyprland-window-tiled-fullscreen-toggle• L1-16 default/…/retroarch.lua• L1-4 default/…/system.lua• L32-38
Configuration reloads
Reloads are the bridge between persistent configuration state and the running compositor. hyprctl reload re-reads the Lua tree, while hyprctl eval or a dispatch applies a focused change without rewriting the whole tree. The helper commands use the direct path when available and retain a standard Hyprland command as a fallback for compatible operations.
Normal runtime toggles copy or remove a Lua flag and then reload Hyprland. Display changes that need a generated monitor rule follow the same pattern. Workspace layout changes can apply immediately and save a workspace rule, while monitor watching adds delayed reloads only for recovery. The package reload guard prevents those reloads from reading a half-updated configuration and leaves a compositor running an old replaced binary for session restart.
Session lock ownership
Session lock recovery distinguishes a compositor-held lock from a live lock screen that another process still owns. The stranded-lock helper reports a stranded lock only when no other Quickshell or hyprlock process can own it; an active owner produces an undetermined result so the caller can retry instead of taking over a live lock.
References: bin/omarchy-hyprland-session-lock-stranded• L7-19
References: bin/omarchy-hyprland-toggle• L15-54 bin/omarchy-hyprland-monitor-clamshell• L209-243 bin/omarchy-hyprland-monitor-internal-mirror• L34-63 bin/omarchy-restart-hyprctl• L1-5 bin/omarchy-hyprland-monitor-watch• L33-61 bin/omarchy-hyprland-reload-guard• L64-129
Change checklist
When these files or sections are changed, remember to consider these:
- Keep the load order in
config/hypr/hyprland.luaaligned with the rule that user files override Omarchy defaults. - Keep personal binding overrides distinct from the default and preinstalled app binding controls in
config/hypr/bindings.lua. - Keep every runtime toggle name matched across its binding, source Lua file, state flag, and reload behavior.
- Keep monitor names safe before inserting them into generated Lua or
hyprctl evalcommands. - Keep workspace layout names and saved default or workspace-specific rules compatible with both live dispatch and reload-time restoration.
- Keep minimized-window source tags aligned with the special minimized workspace and the dock restore path.
- Keep lid bindings, monitor event recovery, and internal-display guard checks consistent so a laptop cannot disable its only active display.
- Keep external-monitor detection limited to enabled real external outputs, not the internal panel or Hyprland's
FALLBACKoutput. - Keep automatic clamshell state separate from manual internal-panel disable state so recovery does not undo a user's display choice.
- Keep the configured monitor rules, panel-saved settings, saved scale fallback, and runtime recovery rule compatible when changing panel restore behavior.
- Keep reload guard state scoped to each live Hyprland instance and preserve the replaced-binary check when changing package or monitor recovery behavior.
- Keep app rule tags and match conditions aligned with the shared window rules so special windows do not inherit the wrong tile, float, opacity, or fullscreen behavior.
- Keep appearance choices synchronized with theme glass generation, terminal refresh, and T3 Code rounding refresh when changing transparency or corner controls.
- Keep animation status aligned with both the explicit animation toggle and the current session's software-rendering marker.
- Keep the lock helper's stranded, unlocked, and undetermined results distinct when changing session recovery.
- Keep binding descriptions and dispatcher forms aligned when changing application launch or runtime toggle actions because the keybinding menu uses both.
- Keep the close-all process-wait path aligned with the client snapshot and the final workspace reset when changing window shutdown behavior.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| The internal panel is the only active display | The panel would be disabled and leave the session without an output | Internal-display control checks for an active external monitor before disabling the panel. |
Hyprland leaves a FALLBACK output after the last external monitor is unplugged | Clamshell recovery can treat the fallback as an external display and leave the internal panel disabled | External-monitor detection ignores FALLBACK and counts only enabled outputs that are not internal-panel connectors. |
| A monitor name contains unsafe characters | Generated Lua or an evaluated command could run unintended content | Monitor helpers accept only plain connector names before writing or evaluating them. |
| A manual panel disable is treated as automatic clamshell state | Monitor polling can turn a deliberately disabled panel back on | Clamshell recovery uses a separate flag and restores the panel only when the external-output conditions allow it. |
| A docked monitor changes state without a matching lid event | The internal panel can remain in the wrong state | The monitor watcher reacts to monitor events and polls while the laptop is docked. |
| A display reports no usable mode after it appears | Hyprland can keep the output at an unusable size and the screen can stay black | Modeless recovery retries guarded reloads with backoff. |
| A package update overlaps an automatic reload | Hyprland can read incomplete configuration and show transient errors | The reload guard pauses auto-reload per live instance and performs one controlled reload after the update. |
| A package update replaces the running Hyprland binary | Resume can load new configuration into an old compositor process | The guard leaves that instance paused until the session restarts. |
| The software-rendering probe cannot read the renderer before its retry window ends | The session keeps its configured animation, blur, and shadow settings | The helper retries after startup and reports the unresolved state without changing the configuration. |
| A saved width has no matching focused application or workspace state | Restore cannot find a safe target and leaves the window unchanged | Width state is keyed by window identity and workspace, and restore checks the saved value before dispatch. |
| A window loses the tag or match expected by an app rule | The window can tile, float, or use opacity unlike its intended role | Shared tag creation and later window rules keep app-specific matches and actions consistent. |
| A workspace layout applies but its state file cannot be saved | The screen and the next reload can use different workspace layouts | The helper reports the unsaved state instead of treating the change as persistent. |
| A window is minimized from a tiled workspace | The dock cannot provide the floating-workspace restore path | The minimize helper leaves the window unchanged unless the workspace is floating. |
| Transparency state is saved but theme glass generation fails | The saved choice and the visible terminal appearance can disagree | The transparency helper restores the prior mode when the glass update fails. |
| A corner override cannot be saved before the old override is removed | The current corner choice can remain active instead of changing | The corner helper saves the new override first and removes the old override only after the save succeeds. |
| Mirror mode starts without an external monitor | No safe mirror target exists | The mirror helper refuses the change until at least one external output is active. |
| A live lock owner is mistaken for a stranded lock | Recovery can take over another lock screen and strand its owner | Lock recovery returns an undetermined result while another locker is alive. |
| A close-all operation loses the process list before window closure | Applications can exit without giving callers a way to wait for shutdown | The helper snapshots client-owned process IDs before it dispatches close actions. |
Key files
| File | Why to read it |
|---|---|
config/hypr/hyprland.lua | Shows the boundary between Omarchy defaults and user overrides. |
config/hypr/bindings.lua | Shows the user-owned binding override layer and controls for disabling shipped bindings. |
config/hypr/input.lua | Shows the user-owned input and gesture override layer. |
config/hypr/monitors.lua | Shows the user-owned monitor rules and display settings that extend or replace the monitor panel. |
default/hypr/bindings/tiling.lua | Shows the user-facing workspace, focus, layout, movement, fullscreen, and scale controls. |
default/hypr/bindings/utilities.lua | Connects display toggles, lid events, and window appearance toggles to helpers. |
default/hypr/bindings/applications.lua | Shows how application and web-app launch actions enter the shared binding layer. |
default/hypr/helpers.lua | Defines the shared path from declarative bindings and window matches to Hyprland actions. |
default/hypr/autostart.lua | Starts the monitor watcher that maintains display state after session start. |
default/hypr/software-rendering.lua | Shows the lighter compositor defaults used when the session renders on the CPU. |
default/hypr/windows.lua | Establishes shared window rules and loads application-specific rules. |
default/hypr/apps/ | Illustrates how app roles such as browsers, overlays, dialogs, and fullscreen apps receive window behavior. |
bin/omarchy-hyprland-toggle | Shows the common contract for persistent Hyprland flags and reloads. |
bin/omarchy-hyprland-software-rendering | Detects CPU rendering and applies session-level performance changes. |
bin/omarchy-hyprland-animations-off | Reports whether animation is off by choice or by rendering limits. |
bin/omarchy-hyprland-monitor-clamshell | Applies clamshell state while preserving manual panel disable choices and panel scale for recovery. |
bin/omarchy-hyprland-monitor-internal | Applies and recovers the internal-panel state for external-monitor conditions. |
bin/omarchy-hyprland-monitor-external-active | Defines which enabled Hyprland outputs count as real external monitors for clamshell decisions. |
bin/omarchy-hyprland-monitor-internal-mirror | Applies mirror mode and clears it when the external output is lost. |
bin/omarchy-hyprland-monitor-watch | Provides monitor-event recovery and the clamshell reconciliation loop. |
bin/omarchy-hyprland-workspace-layout-current | Resolves the effective layout from live Hyprland state and saved workspace state. |
bin/omarchy-hyprland-workspace-layout-default | Changes the default layout without rearranging busy workspaces. |
bin/omarchy-hyprland-workspace-layout-toggle | Applies and persists the active workspace layout choice. |
bin/omarchy-hyprland-window-close-all | Shows the session-wide close path, process wait, and final workspace reset. |
bin/omarchy-hyprland-window-minimize | Shows the dock-backed minimize and restore contract. |
bin/omarchy-hyprland-window-transparency | Shows persistent transparency choices and theme synchronization. |
bin/omarchy-hyprland-corners | Shows persistent corner choices, safe state replacement, and T3 Code synchronization. |
bin/omarchy-hyprland-focus-app | Shows the application and agent-terminal focus path. |
bin/omarchy-hyprland-session-lock-stranded | Shows how lock recovery distinguishes ownership from a stranded compositor lock. |
bin/omarchy-hyprland-reload-guard | Shows how reloads are controlled during package changes and across multiple compositor instances. |