Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support configuration for notched vs un-notched built-in displays #492

Open
3 tasks done
chrisbarrett opened this issue Sep 4, 2024 · 1 comment
Open
3 tasks done
Labels
problem Neither a bug, nor a feature request

Comments

@chrisbarrett
Copy link

chrisbarrett commented Sep 4, 2024

Hello,

I have a configuration that's shared across two MacBooks, one of which has a display notch (an M3) and another which doesn't (an M1). I haven't found a way to account for the clearance needed for the menubar in a way that works for both machines.

I'm wondering if there's a mechanism I've missed that could make a shared configuration work for both hardware types; if not, this is probs a duplicate of #115.

Thanks so much for implementing and maintaining this project. 💜

Detail

The issue seems to be that the origin AeroSpace uses for window management differs on notched vs un-notched hardware; I vaguely understand this corresponds to how things work in the macOS APIs.

  • on the M1, point 0,0 seems to be the corner of the display

    • the menubar is rendered at 0,0
    • therefore top padding needs to be applied for AeroSpace to tile windows clear of the menu bar
  • on the M3, point 0,0 seems level with the bottom of the notch

    • the menubar is rendered above the origin
    • therefore no top padding should be applied to clear the menu bar.

I don't see a solution that allows one configuration to handle both cases out-of-the box.

  1. aerospace list-monitors reports Built-in Retina Display on both machines; therefore per-monitor configuration wouldn't work
  2. I don't see a documented command that can set padding settings dynamically.

Can you think of a way to configure this via the existing configuration mechanisms?

Workaround

The workaround I'm contemplating is templating the TOML configuration file; my nix-darwin config knows which machines have notches, so I can apply different padding values for different systems that way. But it's obviously not the nicest way to accomplish this. :)

Checklist

aerospace CLI client version: 0.14.2-Beta 0cb8dbdfc5ee73b8cbc200f175f467ebead55201
AeroSpace.app server version: 0.14.2-Beta 0cb8dbdfc5ee73b8cbc200f175f467ebead55201
@nikitabobko nikitabobko added the problem Neither a bug, nor a feature request label Sep 4, 2024
@nikitabobko
Copy link
Owner

Your use case is indeed is not supported

Once #278 + #60 (comment) are fixed, smth like this could become possible (draft):

gaps.outer.top = '''
  if test %{monitor-name} == "Built-in Retina Display" do
    if test %{hostname} == "M3_WITH_NOTCH" do
      echo 100
    elif test %{hostname} == "M1_WITHOUT_NOTCH" do
      echo 50
    end
  else
    echo 20
  end
'''

or as you correctly mentioned, #115 is an alternative

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
problem Neither a bug, nor a feature request
Projects
None yet
Development

No branches or pull requests

2 participants