1. Overview

Two-finger scrolling is a touchpad feature that enables us to scroll using two fingers.

In this tutorial, we’re going to look at how to configure this in Linux using the command-line and GUI methods.

All commands mentioned in this guide have been tested on Debian 12 (Bookworm) with xinput 1.63, GNOME 46.3, and KDE Plasma 5.27.5.

2. Two-Finger Scrolling

Two-finger scrolling is a multi-touch gesture supported by modern touchpad hardware and software. It’s an efficient way to navigate long web pages and documents.

We can configure the direction of two-finger scrolling to either be traditional scrolling or natural scrolling.

Traditional scrolling, which is the default, is the classic scrolling direction where the content moves in the opposite direction of the scroll bar or scroll gesture. When we move our two fingers down, the content moves up, and vice versa. It feels like we’re moving the viewport over the content.

Natural scrolling, also known as reverse scrolling, is the opposite of traditional scrolling. This feels like pulling the content within the viewport, much as we’d expect when interacting with a touchscreen.

Let’s look at how to enable natural scrolling in Linux.

3. Configuring Two-Finger Scrolling With xinput

xinput is a command-line tool that enables us to configure input devices, such as mice, keyboards, and touchpads.

Let’s configure the two-finger scrolling direction to natural scrolling using xinput.

We’re going to need to find the device name, then check the two-finger scrolling mode, and finally, enable natural scrolling mode.

3.1. Finding the Touchpad Device Name

First, we need to find the touchpad device name:

$ xinput list
⎡ Virtual core pointer id=2 [master pointer (3)]
...
⎜ ↳ AlpsPS/2 ALPS GlidePoint id=16 [slave pointer (2)]
...

The list option lists all input devices that are connected to our system.

Based the xinput output above, the touchpad device name is “AlpsPS/2 ALPS GlidePoint“. Depending on our touchpad hardware, it could also look like “SynPS/2 Synaptics TouchPad” or “DLLxxx Touchpad“.

3.2. Checking Two-Finger Scrolling Status

Next, let’s check the touchpad device’s two-finger scrolling status.

We can use either the device name (“AlpsPS/2 ALPS GlidePoint“) or the device ID (16) as the parameter for the command:

$ xinput list-props "AlpsPS/2 ALPS GlidePoint"
Device 'AlpsPS/2 ALPS GlidePoint':
Device Enabled (185): 1
...
libinput Natural Scrolling Enabled (347): 0
libinput Natural Scrolling Enabled Default (348): 0
...
libinput Scroll Methods Available (349): 1, 1, 0
libinput Scroll Method Enabled (350): 1, 0, 0
libinput Scroll Method Enabled Default (351): 1, 0, 0
...

The list-props option lists all the device properties that we can configure.

From the output above, we see that the “Scroll Methods Available“, “Scroll Method Enabled“, and “Scroll Method Enabled Default” settings each have three comma-separated values:

  • the first value represents two-finger scrolling
  • the second value represents edge scrolling
  • the third value represents on-button scrolling

Since the first value of “Scroll Methods Available” is 1, this means that the two-finger scrolling method is available or supported.

On the other hand, the “Scroll Method Enabled” setting determines which scrolling method(s) is enabled, with the first value being 1, indicating that the two-finger scrolling method is enabled. Moreover, this scrolling method is enabled by default, as reflected by the first value of “Scroll Method Enabled Default“.

Meanwhile, the setting Natural Scrolling Enabled: 0” means that the two-finger scrolling direction is in default mode (“Natural Scrolling Enabled Default: 0“), which is the traditional mode.

3.3. Enabling Natural Scrolling Mode

Finally, since the two-finger scrolling is already active, let’s enable the natural scrolling direction:

$ xinput set-prop "AlpsPS/2 ALPS GlidePoint" 347 1

We used the set-prop option in xinput to modify the config setting. We passed the device name, followed by either the setting name (“libinput Natural Scrolling Enabled“) or setting ID (347), and the setting value (1).

After entering that command, we can verify the change by running the xinput list-props command again:

$ xinput list-props 16
Device 'AlpsPS/2 ALPS GlidePoint':
    Device Enabled (185):	1
...
    libinput Natural Scrolling Enabled (347):    1
...

At this point, our two-finger scrolling direction should be in natural scrolling mode.

4. Configuring Two-Finger Scrolling With GUI-Based Programs

Besides using the command-line method, we can also use a GUI-based program to configure two-finger scrolling.

In many Linux desktop environments, there’s usually a Settings program with a menu to configure touchpad behavior, including two-finger scrolling.

Let’s have a look at the two most commonly used desktop environments: GNOME and KDE Plasma.

4.1. GNOME

GNOME has a Settings program that we can use to configure the touchpad behavior:

Settings - Mouse and Touchpad

We can enable or disable the touchpad, two-finger or edge scrolling, as well as the natural scrolling.

4.2. KDE Plasma

KDE Plasma also has a program for configuring the touchpad behavior called System Settings:

KDE Settings - Mouse and Touchpad

We can enable or disable the touchpad, two-finger or edge scrolling, as well as the natural scrolling (invert scroll) direction.

5. Conclusion

In this article, we learned about configuring the touchpad two-finger scrolling behavior using the xinput command as well as two GUI-based Settings programs. We can use any of these options that are available to us, according to our preference or requirement.

Comments are open for 30 days after publishing a post. For any issues past this date, use the Contact form on the site.