-
-
Notifications
You must be signed in to change notification settings - Fork 647
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
The new notch handling mechanism is problematic for menubars such as simple-bar #1060
Comments
I got the same problem. I constantly disconnect and work without a monitor and then the gap becomes too big on the MacBook screen. |
similar issue, is there a way to determine screen size and conditionally set the gap size? |
I know this is super hacky, but I coudn't really come up with something more elegant (you need to put the UUID of the notched display in the script). Basically it decides between three states:
This should cover most use cases, except the somewhat rare and unusual cases with two external monitors and the notched screen as a third monitor, or external monitor setups with the notched screen as the main display NOTCH_UUID="XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXX"
NORMAL_BAR=32
NOTCH_BAR=0
yabai -m signal --add event=display_added action="if [[ \"\$(yabai -m query --displays | jq \".[\$YABAI_DISPLAY_ID].uuid\")\" =~ \"$NOTCH_UUID\" ]]; then yabai -m config external_bar main:$NORMAL_BAR:0; elif [[ \"\$(yabai -m query --displays | jq '.[].uuid')\" =~ \"$NOTCH_UUID\" ]]; then yabai -m config external_bar main:$NORMAL_BAR:0; else yabai -m config external_bar all:$NORMAL_BAR:0; fi"
yabai -m signal --add event=display_removed action="if [[ \"\$(yabai -m query --displays | jq \".[\$YABAI_DISPLAY_ID].uuid\")\" =~ \"$NOTCH_UUID\" ]]; then yabai -m config external_bar all:$NORMAL_BAR:0; elif [[ \"\$(yabai -m query --displays | jq '.[].uuid')\" =~ \"$NOTCH_UUID\" ]]; then yabai -m config external_bar all:$NOTCH_BAR:0; fi"
# global settings
if [[ "$(yabai -m query --displays | jq '.[].uuid')" =~ "$NOTCH_UUID" ]]; then if [ "$(yabai -m query --displays | jq length)" -gt "1" ]; then yabai -m config external_bar main:$NORMAL_BAR:0; else yabai -m config external_bar all:$NOTCH_BAR:0; fi else yabai -m config external_bar all:$NORMAL_BAR:0; fi |
I've been tinkering around with this as well, but since I was used to keeping my laptop display as the main one, I messed around with other ways besides the above script, and what I ended up with seems to work well for me so far. If your notched display is always the main one, and if you don't use "clampshell mode" / only external monitors, then the simplest solution is:
If you want all the cool features of @FelixKratz's solution except with the laptop screen always being the main display (so long as the laptop is open) then I've adapted their script to work for this case (this was written against b884717): NOTCH_UUID="XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXX"
NORMAL_BAR=32
NOTCH_BAR=0
NOTCH_OFFSET=$((NOTCH_BAR-NORMAL_BAR))
# Make the default space top padding equal to whatever your "normal" bar spacing is supposed to be
yabai -m config top_padding $NORMAL_BAR
# If the notched display is added, set external_bar to "main:$NOTCH_OFFSET:0". This will decrease the padding on the main (notched) screen
yabai -m signal --add event=display_added action="if [[ \"\$(yabai -m query --displays | jq \".[] | select(.id == \$YABAI_DISPLAY_ID) | .uuid\")\" =~ \"$NOTCH_UUID\" ]]; then yabai -m config external_bar \"main:$NOTCH_OFFSET:0\"; fi"
# If the notched display is removed, set external_bar to off so the main screen (which is now not notched) no longer has a padding decrease
yabai -m signal --add event=display_removed action="if [[ ! \"\$(yabai -m query --displays | jq '.[].uuid')\" =~ \"$NOTCH_UUID\" ]]; then yabai -m config external_bar off:0:0; fi"
# Apply those effects at startup
if [[ "$(yabai -m query --displays | jq '.[].uuid')" =~ "$NOTCH_UUID" ]]; then yabai -m config external_bar "main:$NOTCH_OFFSET:0"; else yabai -m config external_bar off:0:0; fi
This version is just a little simpler, and it seems to work in all the configurations mentioned above, except with the laptop screen as the main one whenever it's open. I find myself liking Note that both these methods use |
All of these workarounds are great, but the best one for external bar users is still to stay on Yabai 3 😟 @koekeishiya Is it planned to re-adjust this behaviour to match how the previous versions of Yabai handle it? I think the simplest way would be to apply a different external_bar value to notched displays, such as In case someone needs an external bar below the notch, maybe an additional configuration could be done? such as |
Check out PR #1149, should solve the issue. |
Has been fixed by 271f908, thank you so much!! Congratulations for the release too. |
Hurray! 🎉 Yabai is much appreciated, grateful to delete my hacky workaround now 😄 , y'all rock |
I am asking here since I could not find any documentation on this (probably my fault). |
The latest version of yabai can now calculate the notch height, and automatically put windows below it, which is super cool.
However, in my
.yabairc
, I haveyabai -m config external_bar all:32:0
.The issue is that it creates a 32px gap below the notch for the bar, even though the bar fits alongside the notch.
I could set the gap to 0 and call it a day, however now external displays cannot show the bar at all.
Would it be possible to make an
external_bar
variant for notched displays? So I can set a gap of 0 for the MacBook display, and 32 for the external ones.(Alternatively, I guess that subtracting the top value of
external_bar
with the notch height for notched displays would work too)Thank you!
The text was updated successfully, but these errors were encountered: