Middle-click autoscroll for Linux on Wayland (KDE Plasma).
Replicates the autoscroll behavior found in Windows and Firefox — hold down the middle mouse button and move the mouse to scroll. Move slowly for slow scroll, move fast for fast scroll.
KDE Plasma on Wayland has no built-in middle-click autoscroll. This daemon runs in the background and adds that functionality system-wide, across all applications.
The script listens passively to raw mouse input via evdev and injects scroll events through a virtual uinput device. It does not grab exclusive control of the mouse, so the mouse always works normally — the daemon crashing or stopping will never lock up your mouse.
- Linux with Wayland (tested on KDE Plasma / CachyOS)
python-evdev- User must be in the
inputgroup
1. Install dependency
sudo pacman -S python-evdev2. Add yourself to the input group
sudo usermod -aG input $USERLog out and back in for this to take effect.
3. Copy the script
cp autoscroll.py ~/.local/bin/autoscroll.py
chmod +x ~/.local/bin/autoscroll.py4. Install the systemd user service
mkdir -p ~/.config/systemd/user
cp autoscroll.service ~/.config/systemd/user/autoscroll.service
systemctl --user daemon-reload
systemctl --user enable --now autoscroll.serviceHold the middle mouse button and move the mouse to scroll. No configuration needed.
In autoscroll.py, adjust this value to your preference:
SCROLL_THRESHOLD = 15 # pixels of mouse movement per scroll tick (lower = more sensitive)# Check status
systemctl --user status autoscroll
# View logs
journalctl --user -u autoscroll -f
# Stop
systemctl --user stop autoscroll
# Uninstall
systemctl --user disable --now autoscroll
rm ~/.local/bin/autoscroll.py
rm ~/.config/systemd/user/autoscroll.service| File | Description |
|---|---|
autoscroll.py |
The daemon |
autoscroll.service |
Systemd user service (auto-start on login) |
MIT