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.58k stars 772 forks source link

Split monitor into virtual outputs #3575

Open aDogCalledSpot opened 9 months ago

aDogCalledSpot commented 9 months ago

Description

Sway has already covered this issue quite extensively.

The idea is that you can split an (ultrawide) monitor into multiple smaller virtual outputs.

Example: Instead of having a single 5440x1440 monitor, you could divide it into two 2560x1440 monitors or even a setup such as 1280x1440 + 2560x1440 + 1280x1440 monitor

This way you can switch between workspaces on different parts of the physical screen indepently of the rest of the screen.

If someone could give me some pointers, I would be happy to draft a PR for this.

gernotfeichter commented 7 months ago

I have the opposite requirement: One virtual output should span over two physical monitors. Would be awesome if the code could cover that scenario as well!

blueStruct commented 6 months ago

I have the opposite requirement: One virtual output should span over two physical monitors. Would be awesome if the code could cover that scenario as well!

As I recently checked again if sway or hyprland had implemented splitting a monitor (the feature in this issue) since the last time I checked, I came across a hyprland plugin that seems to do what you want: https://github.com/levnikmyskin/hyprland-virtual-desktops

I found it on the hyprland awesome list: https://github.com/hyprland-community/awesome-hyprland

Oh, and, of course, a solution that is generic enough to cover both scenarios would be awesome.

One solution I thought about was whether the fake outputs feature could already be used to split a monitor into multiple. https://wiki.hyprland.org/hyprland-wiki/pages/Configuring/Using-hyprctl/#output

Herbstluftwm is the only wm which has this feature, as far as I know. https://herbstluftwm.org/tutorial.html#monitors

aDogCalledSpot commented 4 months ago

@vaxerski could you give a high-level overview of what would need to be done to support this, so that someone could maybe look into it a bit?

vaxerski commented 4 months ago

this is all but simple; hyprland is very much not made with this in mind.

aDogCalledSpot commented 4 months ago

Are there possible first steps that could be done in order to slowly move towards this? I dont expect this to be solved with a single PR.

vaxerski commented 4 months ago

none that I can think of. the entire thing is built on the assumption that there is strictly 1 monitor per 1 workspace

Rattlyy commented 3 months ago

Can second this, I own an ultrawide and I can't use it with hyprland.

ZackMitkin commented 3 months ago

An alternative is to use PBP mode, idk if there's any monitors that support 3 side by side PBP outputs though. I find it pretty clunky because the only way to center a window between 2 monitors is through floating.

I just use master layout with always_center_master, it works pretty well except I don't have control over resizing the non-master windows individually. I just got used to it.

tobh commented 3 months ago

I'm currently using XMonad with layoutScreens there to cycle through three configurations for my ultrawide (5120x1440):

XMonad handles everything inside these virtual monitors as if they where real displays and it also uses the available resolution of each virtual monitor to select the best layout (e.g. the half sized displays have a master window on top and other windows below tiled and the full sized ones have the master on the left or right).

If hyprland could or does support something similar it would be great.

Edit:

Here is how this is configured in XMonad and something similar would be great:

[ layoutScreens 3 (ThreeColMid 1 (3/100) (1/2)), layoutScreens 2 (TwoPane 0.5 0.5), rescreen ]

endeavour commented 3 months ago

I don't know much about wayland but a quick glance through the docs suggests to me that this is something that should sit above the compositor and maps real wl_output devices (monitors) onto multiple virtual wl_outputs? That way it wouldn't be hyprland specific? Maybe someone more knowledgeable can confirm if this is possible.

marcSoda commented 1 month ago

I too am unable to switch to hyprland until this is supported. I have an ultrawide that I would like to split into 2 or 3 virtual displays. It would be great if hyprland could treat it as 3 separate displays. This is how you would do it in x11:

  xrandr --setmonitor LeftSide 1280/340x1440/381+1920+0 none > /dev/null 2>&1
  xrandr --setmonitor Center 2560/677x1440/381+3200+0 "$connected_monitor" > /dev/null 2>&1
  xrandr --setmonitor RightSide 1280/340x1440/381+5760+0 none > /dev/null 2>&1