Configurable snap zones for ultrawide (or any) monitors on KDE Plasma 6 Wayland.
Snap active windows to left / center / right zones with Meta+Shift+Arrow.
Auto-place configured apps into their zone when they open.
Works around all the Plasma 6 shortcut breakage:
registerShortcut()removed ·khotkeysremoved ·kglobalaccelwon't run shell commands ·swhkdgrabs the device
- KDE Plasma 6 on Wayland
qdbus6(part ofqt6-tools, usually already installed)- Python 3 +
evdev:pip install --user evdevorsudo pacman -S python-evdev - User in the
inputgroup:sudo usermod -aG input $USER(log out/in after)
Always clone from the canonical URL to avoid typosquatting:
git clone https://github.com/TheDave94/kwin-snap-zones
cd kwin-snap-zones
./install.shThe installer:
- Verifies file checksums (
CHECKSUMS.sha256) before touching anything - Detects your
WAYLAND_DISPLAYautomatically - Copies the KWin script to
~/.local/share/kwin/scripts/snap-zones/ - Installs the listener daemon to
~/.local/share/kwin-snap-zones/ - Creates and enables two systemd user services
- Runs a D-Bus connectivity smoke test and reports the result
| Zone | Shortcut | Width |
|---|---|---|
| Left | Meta+Shift+Left | 20% |
| Center | Meta+Shift+Up | 60% |
| Right | Meta+Shift+Right | 20% |
Designed for a 49" ultrawide (32:9). Adjust ratios in main.js.
Change zone ratios — edit ~/.local/share/kwin/scripts/snap-zones/contents/code/main.js:
const LEFT_RATIO = 0.25; // 25% left
const CENTER_RATIO = 0.50; // 50% center
const RIGHT_RATIO = 0.25; // 25% rightAuto-place apps — add window class names to the lists in main.js:
const AUTO_LEFT = ['Alacritty', 'org.kde.dolphin'];
const AUTO_CENTER = ['vivaldi-stable', 'firefox'];
const AUTO_RIGHT = ['telegram-desktop'];Find window class names:
- Enable spy mode in
main.js: setconst SPY_MODE = true - Reload:
systemctl --user restart snap-zones-autoplace.service - Open any app and watch:
journalctl --user -f | grep SNAP_ZONES_SPY - Disable spy mode again when done (
SPY_MODE = false)
After any edit, reload:
systemctl --user restart snap-zones-autoplace.service./uninstall.shThis stops the services, unloads the KWin script from the running session, and removes all installed files.
The listener daemon reads raw EV_KEY events from all keyboards in order to detect modifier+key combinations. It does not log, store, or transmit any keystrokes. Only Meta+Shift+Arrow combos trigger any action — a local D-Bus call to KWin to move the active window.
You can audit the full source in listener.py. It is ~200 lines with no network calls, no file writes during operation, and no external dependencies beyond evdev and the Python standard library.
SPY_MODE in main.js logs window class names to help you configure auto-placement. It deliberately does not log window captions (document titles, URLs, etc.) to avoid journald retaining private data. Spy mode is off by default — enable it only during setup.
Adding your user to the input group grants read access to all input devices (/dev/input/event*). This is a standard requirement for any Wayland-compatible hotkey daemon. The same group is required by tools like wev, libinput, and various other input utilities.
Two components work together:
KWin script (main.js) — loaded once at login via a oneshot systemd service. Installs a windowAdded hook for auto-placement.
Listener daemon (listener.py) — monitors raw keyboard input via evdev without grabbing the device (all other apps still receive input normally). On Meta+Shift+Arrow, calls KWin via D-Bus using the absolute path to qdbus6 (resolved at startup, not via PATH).
Meta+Shift+Left
│
▼
listener.py (evdev non-grabbing, single instance via PID file)
│ /usr/bin/qdbus6 loadScript left.js
│ /usr/bin/qdbus6 start
▼
KWin D-Bus /Scripting
│
▼
left.js: w.frameGeometry = { x, y, width: 20%, height: 100% }
registerShortcut() was silently removed in Plasma 6. KWin scripts can still run JS and manipulate windows — they just can't bind keyboard shortcuts anymore. The evdev listener is the only reliable cross-app shortcut mechanism on Plasma 6 Wayland that doesn't grab the input device.
Shortcuts don't fire:
systemctl --user status snap-zones-listener.service
journalctl --user -u snap-zones-listener.service
# If "input group" error: sudo usermod -aG input $USER && rebootAuto-place not working:
systemctl --user status snap-zones-autoplace.service
journalctl --user -u snap-zones-autoplace.serviceWrong WAYLAND_DISPLAY:
echo $WAYLAND_DISPLAY # note the value
# Edit the service file:
systemctl --user edit snap-zones-listener.service
# Add: Environment=WAYLAND_DISPLAY=wayland-0 (or whatever yours is)
systemctl --user restart snap-zones-listener.serviceMIT