This is a KWin script that automatically resizes all windows so that they're not obstructed by the MacBook's notch and adjusts the taskbar size to match it. It also hides the taskbar when a window is in fullscreen to avoid a conspicuous light at the top of the screen.
- Automatically resizes all windows so that they're not obstructed by the MacBook's notch
- Adjusts taskbar size to match the notch whatever the screen scaling
- Hides the taskbar when a window is in fullscreen (you can still access it by moving the mouse to the top of the screen)
- Works with multiple displays (only applies to the display with the notch)
You should first move the taskbar to the top of the screen for the script to work properly:
- Right-click on the taskbar
- Click on "Enter Edit Mode"
- Drag the taskbar from the "Drag to move" area to the top of the screen
- Exit the edit mode
Then, you can install the script in one of the following ways:
-
Download the latest release from the releases page
-
Go to System Settings > Window Management > KWin Scripts
-
Click on "Install from file" and select the downloaded file
-
To enable it, check
Kwin/Plasma notch avoider
and click "Apply".
- Clone this repository:
git clone https://github.com/user/kwin-notch-avoider.git
- Navigate to the cloned directory:
cd kwin-notch-avoider
- Build and install the script:
make install
OR
- Build the script:
make
And install the script:
Go to System Settings > Window Management > KWin Scripts
and click on "Install from file" and select the notch.kwinscript
file.
- To enable it, go to
System Settings > Window Management > KWin Scripts
and checkKwin/Plasma notch avoider
.
You can configure the script by going to System Settings > Window Management > KWin Scripts
and clicking on the "Configure" button next to Kwin/Plasma notch avoider
.
You can then change the following settings:
- Notch Thickness: The thickness of the notch in real pixels (default: 65, the value found on the M1 MacBook Pro 16"), you can find this value by setting the screen scaling to 100% and changing the taskbar size until it matches the notch.
- Main Screen Width: The width of the main screen in real pixels (default: 3456, the value found on the M1 MacBook Pro 16"), you can find this value in
System Settings > Display and Monitor > Display Configuration
. - Main Screen Height: The height of the main screen in real pixels (default: 2232, the value found on the M1 MacBook Pro 16"), same as above.
Don't forget to put the taskbar on top of the screen for the script to work.
The colors below the taskbar (in fullscreen) will be your wallpaper, so I would recommend editing it to add a black bar at the top with the right size to match the notch, and setting the taskbar to opaque. For instance:
- My wallpaper is 3200x2000 (a bit wider aspect ratio than my screen, so the full height will be visible)
- I have a 65px notch and a 2232px height The thickness of the black bar I need to draw onto the wallpaper is 65px * 2000px / 2232px ≈ 58px
If you wish to uninstall the script, you can do so by running:
kpackagetool5 -t KWin/Script -r notch
or by going to the cloned directory and running:
make uninstall
or by going to System Settings > Window Management > KWin Scripts
and unchecking Kwin/Plasma notch avoider
, then clicking on "Apply". You can also click on the "Delete" icon to remove the script from your system (then click "Apply").
- Taskbar autohide doesn't properly work when stuck between two displays
This issue is solved in plasma 6.1, see this issue for more information and workarounds: https://bugs.kde.org/show_bug.cgi?id=351175
If you have any other issues, please report them on the issue tracker.