Make Steam and Proton games open on your main monitor
The cited blog post supports the cause (Proton runs through XWayland, X's RandR primary decides placement, xrandr --primary fixes it but is lost when the monitor powers off) and the udev fallback. The Hyprland events page documents monitor.layout_changed as firing on monitor add, remove, mode change and config reload, and Omarchy's /usr/share/omarchy/default/hypr/helpers.lua defines o.exec_on_start via hl.on("hyprland.start") calling hl.exec_cmd, so the Lua snippet uses real API. Hyprland's config-options page has no xwayland option for a primary output and src/xwayland in the Hyprland repo has no RandR primary handling, so 'no setting for it' holds. The Arch steam package depends on xorg-xrandr, as the record says. Two defects: the symptom's 'Dota 2 renders squished' appears in no cited source and no omacom/omarchy issue, so it is unsupported precision and is dropped, and the cited Hyprland xwayland.md page covers HiDPI scaling and the abstract socket only and says nothing about a primary monitor, so it does not support the record. The fix was not exercised.
Symptom
Steam and Proton games open on my second monitor, or open fullscreen at the second monitor's resolution so the picture is squished or offset. After a monitor goes to sleep or is power-cycled, games start landing on the wrong screen again even though it was fixed before.
Cause
Wayland has no concept of a primary monitor, but games running through XWayland, which is how Proton runs them, place themselves on X's RandR primary output. Hyprland's config has no setting for it, so the primary is whichever output XWayland happened to choose. A primary set with xrandr is lost when that output is removed and re-added, for example when the monitor sleeps and drops its connection, which is why the problem comes back.
Fix
**Find the connector name and test:**
hyprctl monitors | grep ^Monitor
pacman -Q xorg-xrandr || sudo pacman -S --needed xorg-xrandr
xrandr --output DP-1 --primary
xrandr --listmonitors # the primary carries a '*'
xorg-xrandr usually comes in as a Steam dependency.
**Make it stick (Omarchy 4, Hyprland Lua).** Add this to ~/.config/hypr/autostart.lua. The second block re-applies the setting whenever the monitor layout changes, which covers sleep and hotplug:
o.exec_on_start("xrandr --output DP-1 --primary")
hl.on("monitor.layout_changed", function()
hl.exec_cmd("sleep 2; xrandr --output DP-1 --primary")
end)
**Hyprland before 0.55 (hyprlang config):**
exec-once = xrandr --output DP-1 --primary
That version has no layout hook. Re-run the command after a monitor wakes, or use a udev rule as in the cited blog post.
Verify
xrandr --listmonitors shows * on your main monitor after a login and after the monitors wake from sleep. Launch a fullscreen game and check that it opens there at the correct resolution.
Sources
- https://github.com/hyprwm/hyprland-wiki/blob/main/content/configuring/core/advanced-configuration/events.md
- https://kyouha.today/blog/rando/xwayland-game-primary-monitor/
- https://github.com/hyprwm/hyprland-wiki/blob/main/content/configuring/core/config-options.md
- https://archlinux.org/packages/multilib/x86_64/steam/