For those trying in Ubuntu 24.04.1 LTS (in my case on a Lenovo ThinkPad) I just succeeded in all applications (global OS-wide)
Overall, you're trying to change a parameter called scroll-factor, which is stored deep in the OS somewhere.
Lessons learned the hard way:
- xinput doesn't work, because Ubuntu 24.04.1 LTS out of the box uses XWayland.
- libinput doesn't work (natively) because it no longer contains the ability to set the scroll factor (because... reasons to do with GNOME Wayland that I don't understand)
- THIS https://gitlab.com/cczp/act-2/libinput-touchpad-scroll-fix has been DEPRECATED. This is stated on the page, with a link to libinput-config (see next paragraph).
The correct answer is the libinput-config by NonPotableWater: https://gitlab.com/warningnonpotablewater/libinput-config. This basically writes a wrapper around your native libinput that allows you to set the scroll factor.
Installing libinput-config. How I got it to work.
i. Create a libinput.conf file. Navigate to your root 'etc' folder. touch is just a way of creating an empty file in linux.
cd /etc
sudo touch libinput.conf
ii. Install meson
sudo apt install meson
iii. Configure meson to use the non-glibc compiler (Ubuntu uses gcc by default)
meson configure -Dnon_glibc=true
iv. Download the libinput-config code from gitlab as ZIP and extract. For example, I extracted it to ~/Downloads/libinput-config-default/
v. cd to that folder where you extracted to, e.g.
cd ~/Downloads/libinput-config-default/
vi. Build the libinput-config install files, by running
meson build
This creates the ./build/ folder.
vii. cd into that folder
cd build
viii. Run ninja
ninja
ix. Install libinput-config by running
sudo ninja install
x. Set your desired configuration by editing the libinput.conf file using VIM (or your preferred text editor)
cd /etc
sudo vim libinput.conf
(If you don't know how to use VIM, then GOOGLE IT FIRST. Hint: press i to get into edit mode then ESC, :wq to write and quit the file.)
My libinput.conf file looks like this:
override-compositor=disabled #doesn't seem to be necessary
scroll-factor=0.3 #seems to be about right, comparable to Windows, might be different on your touch-pad
xi. Log out of Ubuntu and log back in again (and/or restart your machine to be sure).
Following these steps, I managed to set my scroll factor across all applications. scroll-factor=0.3 was about right for me. Any questions or comments, please go ahead!
~Tom