Skip to content

kaosko/libinput-one-finger-scroll

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

libinput-one-finger-scroll

Transform single-finger touchpad movements via libinput in Wayland into scroll events.

Motivation

I've been a Fedora and a Thinkpad user for more than a decade. I bit my lip while migrating to Wayland & Pipewire, but I had it when I was forced to move to libinput from Synaptics driver and synclient. You see, me and my fellow Thinkpad users do not want to move the fingers from the keyboard. Thinkpad was meant to be used with your fingers on the keyboard & on the trackpoint and the thumb leisurely swiping the touchpad to scroll through content on the screen. There was always a Synaptics driver for X11 but for Wayland, libinput is the only choice. For whatever reason, libinput developers decided that the only right way to scroll is with two fingers, or with a fixed size edge scroll. When I moved to P1, the touchpad got even bigger and the edge of it further away from my thumb. After developing a carpal tunnel syndrome in only two days, awkwardly trying to hit the edge of the touch with my right thumb, I decided that enough is enough and I need to have a better way to scroll (also tried two thumb scroll with jarring screen jumps as I attempted to synchronize lifting the thumps up exactly at the same time). At least you get access to all the data that libinputs provides as evdev events. Using my script, the one finger scroll again works for me as well as it did when I had perfected scrolling on my previous, trustworthy X1 Extreme with synclient configuration.

Installation & usage

You can run the committed python script with sudo python3 touchpad_scroll_palmdetection_cursorgrab_accumulate.py (you must run with sudo). Press F9 to activate. Test it & tweak as needed but I have already added a reasonable palm detection, cursor grab (to stop the cursor from moving when I'm scrolling) and accumulating movements to make slow scrolling smooth. When you are happy with your experience, install the script as a service. Then, copy the script to /usr/local/bin/ and create a systemd service with: sudo vi /etc/systemd/system/touchpad-scroll.service. Add the following contents to it:

[Unit]
Description=One-Finger Touchpad Scroll
After=multi-user.target

[Service]
ExecStart=/usr/bin/python3 /usr/local/bin/touchpad_scroll_palmdetection_cursorgrab_accumulate.py
Restart=always

[Install]
WantedBy=multi-user.target

And enable with sudo systemctl enable --now touchpad-scroll.service.

No guarantees that it'll work in other environments, but as long as you are after one finger scrolling and on Wayland, I don't see how it'd matter whether you are on Debian, Arch or Red Hat based distro.

About

Transform single-finger touchpad movements via libinput into scroll events.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages