midscroll
Windows-style middle-button drag autoscroll for Linux.
Hold the middle mouse button and drag. The page scrolls in that direction,
faster the farther you drag from where you pressed, like Windows 10/11.
Release to stop. A quick middle click without dragging still works as a
normal middle click (paste, open link in new tab). Diagonal drags scroll
both axes, so it pans wide pages too.
Prefer clicking to holding? Turn on toggle mode (in the settings GUI or
TOGGLE_MODE = true) for the Windows-Explorer / Firefox style instead: one
middle click starts autoscroll, the cursor moves freely, and any click
stops it.
It works in every app, on Wayland and X11, because it operates at the
kernel input layer (evdev in, uinput out) instead of hooking any
particular desktop or toolkit.
Details:
- The speed curve is Chromium/Edge's actual Windows autoscroll formula
(
0.000008 * distance^2.2 px/ms, 15 px per-axis dead zone): tiny drags
crawl, a full-screen drag flies.
- While scrolling, the real pointer stays anchored at the press point, so
the scroll stays locked to the window you started in. Dragging "over"
the taskbar or another window can't steal it.
- It still looks like Windows while you do it: a badge with a
vertical-arrows icon stays locked at the press point, and a ghost cursor
follows your hand from there - a copy of your own pointer, read from
your cursor theme. The ghost is only drawn: it can't click, hover or
focus anything, which is what lets the scroll stay put while you see
where you are (KDE Plasma Wayland; see notes below).
- Apps that use middle-drag themselves (FreeCAD, OrcaSlicer and Minecraft
by default) are blacklisted by window class: while one of them is
focused, midscroll pauses itself and the middle button behaves natively.
- The desktop and panels are left alone by default: while a desktop shell
(plasmashell, xfdesktop, waybar, GNOME Shell, ...) is focused midscroll
pauses, so a middle-drag can't hijack the desktop. Turn on Enable on
desktop & panels (
DESKTOP_SCROLL = true) if you want it there too.
Install
Fedora / RPM distros
./packaging/fedora/build-rpm.sh
sudo dnf install ./dist/midscroll-*.noarch.rpm
Debian / Ubuntu
./packaging/debian/build-deb.sh
sudo apt install ./dist/midscroll_*_all.deb
Needs a release with gtk4-layer-shell packaged (Debian 13 "trixie"