Skip to content

hyprland.lua loads nwg-displays monitors.lua but not workspaces.lua, so workspace-to-monitor assignments never apply #9422

Description

@JohnAtl

System details

Omarchy: 4.0.1-1
Kernel: 6.18.46-1-lts
Hyprland: 0.56.2
CPU: 13th Gen Intel Core i9-13900K
GPU: NVIDIA RTX A4500 (dual)
nwg-displays: 0.4.3-1
Monitors: DP-1 LG Ultra HD, DP-2 LG SDQHD, DP-3 LG SDQHD
hyprctl configerrors: clean
hyprctl plugin list: no plugins loaded

What's wrong?

The default ~/.config/hypr/hyprland.lua loads hypr.monitors but not hypr.workspaces:

require("hypr.monitors")
require("hypr.input")
require("hypr.bindings")
require("hypr.looknfeel")
require("hypr.autostart")

nwg-displays (0.4.3, the stock Arch package) writes both files when you save a display layout: monitors.lua via hl.monitor({...}) and workspaces.lua via hl.workspace_rule({...}). Both .lua paths are derived from the .conf path in the nwg-displays source (nwg_displays/main.py around line 905/937 for workspaces, nwg_displays/settings_applier/settings_applier.py around line 116/121 for monitors).

Because hyprland.lua requires only hypr.monitors, the monitor geometry applies but the workspace-to-monitor rules in workspaces.lua are never loaded. Workspaces then fall back to Hyprland's default placement, so the assignments set in nwg-displays silently do nothing. hyprctl configerrors stays clean, because the file is simply never required (not a parse error).

The same omission is present on the current quattro branch template (config/hypr/hyprland.lua), which requires hypr.monitors but not hypr.workspaces, and ships a monitors.lua template but no workspaces.lua.

Steps to reproduce

  1. In nwg-displays, assign specific workspaces to specific monitors (for example ws 1 and 5 to DP-1, ws 2 and 6 to DP-2, ws 3 and 7 to DP-3) and Apply.
  2. nwg-displays writes ~/.config/hypr/workspaces.lua with hl.workspace_rule({...}) entries (and monitors.lua).
  3. hyprctl reload, or reboot.

Actual result

Workspace-to-monitor assignments do not apply. With a rule binding workspace 5 to DP-1, workspace 5 opens on a different monitor. Monitor geometry from the same nwg-displays run is correct, because monitors.lua is required.

Expected result

Workspaces open on the monitors assigned in nwg-displays, matching the hl.workspace_rule entries in workspaces.lua, consistent with how monitors.lua is already honored.

Workaround

Add one line to ~/.config/hypr/hyprland.lua:

require("hypr.monitors")
require("hypr.workspaces")
require("hypr.input")

After hyprctl reload the rules load and configerrors stays clean. Workspaces already created on the wrong monitor need to be moved once (or a fresh login), since workspace rules apply at creation time.

Suggested fix

Load hypr.workspaces from the default hyprland.lua, guarded so it is a no-op when the file is absent (a fresh install has no workspaces.lua), for example via the existing require_optional helper already used for the theme in default/hypr/omarchy.lua. That way users who set workspace assignments in nwg-displays get them honored, and fresh installs are unaffected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions