Hyprland icon indicating copy to clipboard operation
Hyprland copied to clipboard

Split monitor into virtual outputs

Open aDogCalledSpot opened this issue 2 years ago • 11 comments

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.

aDogCalledSpot avatar Oct 15 '23 07:10 aDogCalledSpot

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!

gernotfeichter avatar Dec 15 '23 17:12 gernotfeichter

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

blueStruct avatar Jan 12 '24 01:01 blueStruct

@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?

aDogCalledSpot avatar Mar 30 '24 08:03 aDogCalledSpot

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

vaxerski avatar Mar 30 '24 17:03 vaxerski

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.

aDogCalledSpot avatar Mar 30 '24 20:03 aDogCalledSpot

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

vaxerski avatar Mar 30 '24 20:03 vaxerski

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

Rattlyy avatar Apr 05 '24 06:04 Rattlyy

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.

ZackMitkin avatar Apr 05 '24 10:04 ZackMitkin

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

  • 3 virtual monitors with the middle one being the normal sized (2560x1440) and the side ones being half sized
  • 2 virtual monitors with the same 2560x1440 resolution
  • 1 big monitor using all available space

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 ]

tobh avatar Apr 10 '24 13:04 tobh

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.

endeavour avatar Apr 26 '24 18:04 endeavour

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

marcSoda avatar Jun 26 '24 23:06 marcSoda

Yes please, I usually split my monitor into two: half for notes and what I'm doing (an ADHD must) and the other half is my workspace. I wish I could make the switch but this is essential if I want to maintain productivity

foodornt avatar Aug 15 '24 17:08 foodornt