hyprwm / Hyprland

Hyprland is an independent, highly customizable, dynamic tiling Wayland compositor that doesn't sacrifice on its looks.
https://hyprland.org
BSD 3-Clause "New" or "Revised" License
18.6k stars 772 forks source link

Window Rules: allow both `workspace empty` and `monitor <id>` #4910

Open simonwiles opened 5 months ago

simonwiles commented 5 months ago

Description

If I set a window rule of the form:

windowrulev2 = monitor $primaryMonitor,class:^(FreeTube)$

all works well, but if I also set:

windowrulev2 = workspace empty,class:^(FreeTube)$

then the window opens on the first empty workspace, whichever monitor that happens to be on (and whichever order I put the rules in).

What I was hoping was to open the window on a new/empty workspace on a chosen monitor. Would that be possible?

vaxerski commented 5 months ago

I don't think that's possible atm, tho shouldn't be hard to implement

simonwiles commented 5 months ago

Thanks for considering it!

It feels like for this config

windowrulev2 = monitor $primaryMonitor,class:^(FreeTube)$
windowrulev2 = workspace empty,class:^(FreeTube)$

the expected behaviour might be to open on an empty workspace on $primaryMonitor; but thinking about it some more I realised it's related to another minor awkwardness in my workflow. I initially set up

bind = $mainMod, N, workspace, empty
bind = $mainMod SHIFT, N, movetoworkspace, empty

but this isn't quite what I wanted either -- I always want empty to mean "an empty workspace on the current monitor". In a multi-monitor setup I'm struggling to imagine when someone might want empty to mean "an empty workspace no matter where" tbh.

If empty could be modified in this way it would solve both of these problems and probably be a better behaviour over all.

(Nb. I can work around the latter to some extent with

bind = $mainMod, N, workspace, r+1
bind = $mainMod SHIFT, N, movetoworkspace, r+1

but it's not ideal.)