nikitabobko / AeroSpace

AeroSpace is an i3-like tiling window manager for macOS
https://nikitabobko.github.io/AeroSpace/guide
MIT License
7.51k stars 119 forks source link

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

Open chrisbarrett opened 2 months ago

chrisbarrett commented 2 months ago

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.

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

nikitabobko commented 2 months ago

Your use case is indeed is not supported

Once #278 + https://github.com/nikitabobko/AeroSpace/issues/60#issuecomment-2170067042 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