Skip to content

JimMoen/rinertia

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rinertia

Momentum scrolling for Linux laptop touchpads.

The Synaptics input driver used to provide momentum (coasting) scrolling — you could flick two fingers and the page would keep gliding. When the Linux desktop moved to libinput, this feature was dropped. rinertia brings it back as a standalone userspace daemon, working system-wide with any Wayland compositor and any application, zero configuration required.

How it works

graph LR
    K["Kernel evdev<br/>/dev/input/eventN"] --> R["rinertia<br/>(passive read, no GRAB)"]
    K --> L["libinput"]
    R --> M["Momentum engine"]
    M --> U["uinput virtual device<br/>REL_WHEEL_HI_RES"]
    U --> L
    L --> C["Compositor / Applications"]

    style R fill:#4a9eff,color:#fff
    style U fill:#4a9eff,color:#fff
Loading

rinertia passively reads touchpad events via evdev, computes momentum, and injects scroll events through a uinput virtual device. These injected events flow through libinput into the compositor — the same path as any real input device. Since rinertia never grabs the touchpad, normal scrolling, gestures, and tools like fusuma are completely unaffected.

rinertia reads raw touchpad events directly from /dev/input/eventN via evdev — it does not depend on or interfere with libinput. Since it never grabs the device, your compositor, libinput, and gesture tools like fusuma continue to work exactly as before.

Features

  • Plug and play — auto-detects your touchpad, just run it
  • Non-invasive — passively reads events, never grabs your touchpad
  • Universal — works with GTK, Qt, Electron, Firefox, and everything else
  • Interruptible — touch the pad, press a key, or move your mouse to stop immediately
  • Tunable — damping, decay curve, and speed are all adjustable

Install

cargo build --release

Usage

# Just works — auto-detect touchpad, default settings
sudo rinertia

# Match touchpad by name
sudo rinertia -n "ELAN"

# Longer, smoother inertia
sudo rinertia --damping 0.03 --linear-decel-ms 500

# Shorter, snappier inertia
sudo rinertia --damping 0.10 --linear-decel-ms 200

# Pure exponential decay (no linear tail)
sudo rinertia --damping-curve expo

# Troubleshooting — log only, no virtual device
sudo rinertia --dry --log-level debug

# See all options
rinertia --help

Tuning

Parameter Effect of increasing
--damping Faster deceleration, shorter inertia
--tp-to-hires More scroll distance per gesture
--linear-decel-ms Slower, longer tail
--scroll-factor More scroll output per tick

Scroll direction

rinertia auto-detects your desktop's scroll direction setting at startup. Currently supported:

Desktop Detection method
KDE Plasma KWin D-Bus (org.kde.KWin.InputDevice.naturalScroll)
GNOME gsettings (org.gnome.desktop.peripherals.touchpad natural-scroll)
Others libinput device default (with warning)
  • Traditional scrolling (default) — finger drags the scrollbar. Swipe down → page scrolls down.
  • Natural scrolling — finger moves with the content, like dragging a piece of paper. Swipe down → page scrolls up.

You can override the auto-detected value with --natural-scroll or natural_scroll = true in the config file. If your override conflicts with the desktop setting, rinertia will print a warning.

Known issues

  • Chromium-based browsers have built-in smooth scrolling that may stack with rinertia. Disable it via chrome://flags/#smooth-scrolling, or use --scroll-factor to compensate.
  • --tp-to-hires is device-specific — if scrolling feels too fast or slow, adjust this first.
  • Pointer inertia (--mode pointer) is experimental.

Acknowledgements

  • fusuma — multitouch gesture recognizer, whose architecture inspired our passive evdev listener design
  • waynaptics — Wayland synaptics driver shim, from which the dual-phase momentum engine was originally ported
  • xkeysnail — evdev-based key remapper, whose passive evdev monitoring approach informed our no-GRAB design

License

MIT

About

Momentum scrolling for Linux laptop touchpads.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors