Window Gaps is a KWin Script for KDE Plasma 6 that adds configurable gaps around windows on Wayland.
- Adds gaps between tiled windows through KWin tile padding.
- Adds gaps between windows and screen edges.
- Leaves fullscreen windows untouched.
- Applies gaps to maximized windows on all sides.
- Exposes a configurable
gapSizeoption inSystem Settings > Window Management > KWin Scripts. - Avoids geometry update loops by tracking windows currently being modified.
- Avoids interfering with interactive move and resize operations.
- KDE Plasma 6
- KWin on Wayland
kpackagetool6kwriteconfig6qdbus6
.
├── contents/
│ ├── code/
│ │ ├── geometry.js
│ │ └── main.js
│ ├── config/
│ │ └── main.xml
│ └── ui/
│ └── config.ui
├── install.sh
├── uninstall.sh
├── metadata.json
├── package.json
└── tests/
cd /home/master/code/plasma-window-gaps
./install.shThis will:
- install or upgrade the KWin Script package,
- enable the plugin in
kwinrc, - trigger
KWinreconfiguration.
Open:
System Settings > Window Management > KWin Scripts > Window Gaps
Then change:
Gap size (px)
The setting is stored in:
~/.config/kwinrc- group:
[Script-plasma-window-gaps] - key:
gapSize
You can also change it from the terminal:
kwriteconfig6 --file kwinrc --group Script-plasma-window-gaps --key gapSize 24
qdbus6 org.kde.KWin /KWin org.kde.KWin.reconfigureRun the local unit tests:
cd /home/master/code/plasma-window-gaps
npm testThe test suite checks:
- gap value clamping,
- maximized window geometry calculations,
- floating window edge offset logic,
- runtime loading of
main.jsin a mocked KWin-like environment.
- Open two windows and quick-tile them side by side.
- Confirm there is a visible gap between them and the screen edges.
- Maximize a window and confirm the gap is applied on all sides.
- Put a window into fullscreen and confirm there are no gaps.
- Change
Gap size (px)in System Settings and clickApply.
cd /home/master/code/plasma-window-gaps
./install.shcd /home/master/code/plasma-window-gaps
./uninstall.sh- This script targets Wayland.
- Fullscreen windows are always excluded.
- If you use other window gap scripts at the same time, they may conflict with this one.
- If configuration changes do not appear to apply, run:
qdbus6 org.kde.KWin /KWin org.kde.KWin.reconfigure