AeroSpace icon indicating copy to clipboard operation
AeroSpace copied to clipboard

[Feature Request] Better support for ultrawide monitors

Open juniusfree opened this issue 2 years ago • 27 comments

Description

What exactly should be done to support ultrawide monitors is an open question

The current go-to design is window-max-width config option that would restrict the max widths of leaf nodes (tiling windows):

  • https://github.com/nikitabobko/AeroSpace/discussions/621
  • https://github.com/nikitabobko/AeroSpace/issues/60#issuecomment-2237504168

Alternatives

  • Conditional gaps https://github.com/nikitabobko/AeroSpace/issues/60#issuecomment-2170067042 (discarded at the moment)
  • Ghost windows https://github.com/nikitabobko/AeroSpace/issues/60#issuecomment-2532587617

Original message

First of all, thank you for creating AeroSpace.

Apologies if this is already solved. I am using a 28-inch monitor. When only one application is open, the window stretches across the entire screen, making it too wide and challenging to navigate efficiently.

It might be helpful to have a feature that allows for managing the window size or position in such scenarios.

This is the result I am aiming for. The window could be also be on the left or right, not just center. image

juniusfree avatar Dec 17 '23 00:12 juniusfree

Also endorsing this one. In yabai I am using space specific padding to achieve this, so maybe that could be a possible solution without restricting window sizes etc?

Marty-W avatar Feb 07 '24 18:02 Marty-W

In yabai I am using space specific padding to achieve this

What is the point of using ultra-wide screen, if you effectively cut left and right gaps from it?

I'm not joking, it's real question to better understand use case for workspace-specific gaps

nikitabobko avatar Feb 07 '24 20:02 nikitabobko

My current setup on an ultrawide:

1 work: docs/terminal | code | localhost
2 leisure: (gap) | browser | (gap)
3 focused work: (gap) | browser | code | (gap)

The thing is I am still trying to divide the workspaces for the task at hand. So when I'm just browsing the web I don't really need all that screen real estate and having one window span the entire screen makes it harder to navigate (as @juniusfree pointed out). The idea behind workspace three is that sometimes having too many windows open makes it harder for me to focus, so having just two, or only an editor makes it easier.

Marty-W avatar Feb 07 '24 23:02 Marty-W

@Marty-W thanks for the explanation, I get it now

When you mentioned workspace-specific gaps, I assumed that you'd just make all workspaces that are assigned to the ultrawide monitor have big gaps, but I get it now. You only put big gaps for workspaces that only have one or so windows

That's an interesting use case for workspace-specific gaps

nikitabobko avatar Feb 07 '24 23:02 nikitabobko

Currently, it's possible to have monitor-specific gaps

gaps.outer.top = [{ monitor."built-in" = 0 }, 24] # (1)

That's how it can be extended to support workspace-specific gaps:

gaps.outer.top = [{ monitor."built-in" = 0 }, { workspace.1 = 10 }, 24] # (2)

But I think we can do even better to support a pattern like "window count" (I'm brainstorming, it's not a final design, though I encourage you to share your thoughts)

# (3)
gaps.outer.left = [{ window-count-range."1..2" = 200 }, 0]
gaps.outer.right = [{ window-count-range."1..2" = 200 }, 0] # Ugh, there is no way to conjugate conditions :(

# (4)
gaps.outer.left = [{ if.window-count-range = "1..2", if.monitor = "ultrawide-monitor-name-pattern", value = 200 }, 0]
gaps.outer.right = [{ if.window-count-range = "1..2", if.monitor = "ultrawide-monitor-name-pattern", value = 200 }, 0]
# Yay! Conjugated conditions! 

Note to myself: I should stop turning TOML into a programming language, it'd be easier if AeroSpace used Lua for configuration

Note: When I refer to "monitor pattern" I mean monitor pattern name as in https://nikitabobko.github.io/AeroSpace/guide.html#assign-workspaces-to-monitors

UPD: forget about it. max-width is better https://github.com/nikitabobko/AeroSpace/issues/60#issuecomment-2237504168

nikitabobko avatar Feb 07 '24 23:02 nikitabobko

window-count-range

Or more correctly: tiling-window-count-range (floating windows shouldn't be counted)

nikitabobko avatar Feb 08 '24 00:02 nikitabobko

I like the proposed solution using the tiling-window-count-range and monitor filter.

lamdor avatar Mar 25 '24 18:03 lamdor

New proposal #278

[gaps]
outer.left = 'test %{workspace-tiling-windows-count} --lessThan 3 && echo 100 || echo 0'
outer.right = 'test %{workspace-tiling-windows-count} --lessThan 3 && echo 100 || echo 0'

UPD: forget about it. max-width is better https://github.com/nikitabobko/AeroSpace/issues/60#issuecomment-2237504168

nikitabobko avatar Jun 15 '24 16:06 nikitabobko

As an alternative idea for solving this issue, what about introducing configuration options (per monitor) to set maximum window sizes and alignment? To me, these feel more intuitive for solving the root usability issues.

e.g., for @Marty-W's scenarios:

1 work: docs/terminal | code | localhost 2 leisure: (gap) | browser | (gap) 3 focused work: (gap) | browser | code | (gap)

Let's say the monitor width is 3440px, the alignment is set to "center" and the max width is set to 1500.

In scenario 1, each windows takes ~1146px, which is less than the max width, so the look is the same as the vertical tiling today.

In scenario 2, the window would have taken the full 3440px, but is instead maxed out at 1500px. Additionally, the window would be aligned in the center.

In scenario 3, each window maxes out at 1500px and because thee two windows combined still don't reach the full monitor width, they are aligned in the center, leaving a 220px gap on each side (440px total).

ryanflegel avatar Jul 18 '24 20:07 ryanflegel

@ryanflegel so essentially instead of making gaps bigger you suggest to restrict windows max width/height. Makes perfect sense. ~~I think my "bigger gaps" suggestion and yours can coexist~~ (UPD: forget it, conditional gaps is weird)

Good suggestion, thanks!

nikitabobko avatar Jul 20 '24 09:07 nikitabobko

I have an ultrawide screen and wanted to share my usecase I believe if this behaviour is toggalable, that would be great

Generally I think this feature is super important for ultrawide monitors, most of the time, I would want max window width, Especially if I'm surfing the web, opening discord, etc

But when I am deep in a project coding with nvim, I often full screen the terminal because I have way to many vertical panes open

nadeemkhedr avatar Aug 12 '24 11:08 nadeemkhedr

Just to add that the way fyabai (a popular fork of Yabai) solves this problem is like the max window size thing described above... I have it configured that way so that for instance:

  • If I have only a single window open it is centered and at a specific size
  • Two windows take up more space overall but still don't quite expand to fill the whole screen
  • Three or more windows are large enough that the behaviour becomes more like the default (i.e. screen is filled)

And part of my use case for this is actually for Screen sharing purposes - my colleagues don't have Ultrawide monitors so if I share my entire screen the text for them is tiny, so what I prefer to do is use Zoom's "Share a region of the screen" and I set that region right over the "one window" size.

I could tell the screen sharing to share a window rather than the screen, but if I do that then I can't switch application on the share easily. Using the region based share I can move between workspaces to show other single-window applications

stevewardle avatar Aug 15 '24 14:08 stevewardle

Personally, I find the lack of tiling on ultrawide monitors manageable with floating windows. However, a feature that would improve my workflow would be the ability to automatically switch to a floating layout when the monitor for a workspace or window exceeds a certain width threshold. Or more generally, the ability to callback when switching between monitors.

RW21 avatar Sep 14 '24 08:09 RW21

Using the count method is sub optimal in my opinion and doesn't suit all possible scenarios well. I have certain workspaces that I like to have large gaps on e.x. a workspace with messengers on my ultra-wide, where I usually have 2 messenger windows open and don't need them to occupy all the space available.

I would like to be able to manually set gaps per workspace, that's all.

Unfortunately the provided solution

That's how it can be extended to support workspace-specific gaps:

gaps.outer.top = [{ monitor."built-in" = 0 }, { workspace.1 = 10 }, 24] # (2)

doesnt seem to work for me and AeroSpace gives an error that "the table is expected to have a single key monitor". How do I make it work?

zakroma avatar Sep 26 '24 15:09 zakroma

I prototyped a quick-and-dirty solution for myself, since this is the only feature blocking my use of Aerospace: https://github.com/sdoerner/AeroSpace/commit/a9560e39c2d582e93edcb71a50821e3567e17a27

Probably not merge-worthy because I assume you want to fix this in a way that allows more customization with your mini scripting language. Happy to polish some of this up though if you think it would work with your final design (e.g. moving visibleRectPaddedByOuterGaps into Workspace).

I struggled a bit with naming. maxWidth doesn't exactly fit into gaps, as it's rather the opposite of a gap. However, I do find this modeling with maxWidth useful because I have a two different monitors at home/work and only one of them is widescreen.

sdoerner avatar Sep 27 '24 17:09 sdoerner

I am already using aerospace; I would say implementing some sort of max-window-size will make life so much easier for users with ultrawide screens

nadeemkhedr avatar Nov 25 '24 09:11 nadeemkhedr

new to aerospace, but could this be solved with "ghost windows"? i have an ultrawide and i was wondering if its possible to add a empty space window so i can control how my real windows take up space.

pk1m avatar Dec 10 '24 18:12 pk1m