Window Rules: add rule

This commit is contained in:
Fazzi 2026-04-29 21:47:03 +01:00
parent 88530cae1b
commit 3bbc8a558b
2 changed files with 8 additions and 0 deletions

View file

@ -185,6 +185,7 @@ Dynamic effects are re-evaluated every time a property changes.
| render_unfocused | boolean | Forces the window to think it's being rendered when it's not visible. |
| scroll_mouse | number | Forces the window to override `input.scroll_factor`. |
| scroll_touchpad | number | Forces the window to override `input.touchpad.scroll_factor`. |
| confine_pointer | boolean | Locks the mouse cursor to the window. Mostly useful for keeping your mouse cursor locked to one monitor during gaming.
All dynamic effects can be set with `setprop`.

View file

@ -502,3 +502,10 @@ Add `exec-once=xrandr --output [MONITOR_ID] --primary` to your config, replacing
By adding this to your hyprland config, it will set the default monitor for X11 applications to your main monitor.
### My mouse cursor keeps escaping the game window!
Whilst most games should be able to lock your cursor seamlessly, you can lock the cursor from Hyprland's side instead using the `confine_pointer` window rule. To apply this rule to all fullscreen apps with content type 'game', the below rule would suffice:
```lua
hl.window_rule({ match = { content = "game", fullscreen = true }, confine_pointer = true })
```