On Linux (Ubuntu), tune the Trackpad and set the function to a three-finger swipe

It is a record until the function is added to the three-finger swipe using Ubuntu 19.10. What we have achieved is as follows.

--Changed the driver used on the Logitech T650 trackpad --Adjusted the scroll amount of two-finger scroll --Assigned the desktop move function to the three-finger swipe

Set the driver to use

I'm using Ubuntu 19.10. There are three drivers for using Trackpad on Linux:

To find out which one is being used now, use the xinput command. You can find the name of the device recognized by xinput list and display it byxinput list-prop <device name or id>.

$xinput list
⎡Virtual core pointer                    	id=2	[master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer              	id=4	[slave  pointer  (2)]
⎜   ↳ Logitech Rechargeable Touchpad T650     	id=12	[slave  pointer  (2)]

$xinput list-props 'Logitech Rechargeable Touchpad T650'                                                
Device 'Logitech Rechargeable Touchpad T650':
	Device Enabled (154):	1
	Coordinate Transformation Matrix (156):	1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
	Device Accel Profile (286):	0
	Device Accel Constant Deceleration (287):	1.000000
	Device Accel Adaptive Deceleration (288):	1.000000
	Device Accel Velocity Scaling (289):	25.000000
	Trackpad Disable Input (290):	0
	Trackpad Sensitivity (291):	1.000000

In the case of Synaptic and libinput, it can be identified because there is a setting name of the module name. In the case of mtrack, it is displayed as Trackpad.

To enable a particular driver, the initial settings are stored in /usr/share/X11/xorg.conf.d/ after the driver is installed, so this is/etc/X11/xorg.conf. Copy to d /.

$ls /usr/share/X11/xorg.conf.d/                                                                         
10-amdgpu.conf  10-quirks.conf  40-libinput.conf  51-synaptics-quirks.conf  70-wacom.conf
10-nvidia.conf  10-radeon.conf  50-mtrack.conf    70-synaptics.conf

$cp /usr/share/X11/xorg.conf.d/50-mtrack.conf /etc/X11/xorg.conf.d/                                                                               

$ls /etc/X11/xorg.conf.d/                                                                               
50-mtrack.conf

Now, when you log in and log out, the desired driver will be enabled.

To change the driver settings, rewrite the ʻOption item in /etc/X11/xorg.conf.d/or usexinput set-props ` I will. conf can be used for persistence purposes and xinput set-props can be used for ad hoc settings.

However, the conf file and the setting name in xinput list-props do not match. It is a setting name with almost the same name, but since there is no correspondence table, it seems that there is no choice but to choose something like that.

Xorg scrolling situation

Currently Xorg scrolling works as button 5 and button 6. Therefore, scrolling seems to be realized by how many times button 5 and button 6 are pressed for each movement amount.

Inertial scrolling is possible in Synaptics, It seems that it is realized by adjusting the frequency of pressing the scroll button.

libinput tells you how much you've moved, I don't have a specification to adjust the scroll amount to protect that specification. Currently, GNOME3 does not seem to handle scrolling amount either.

Each feature

Synaptics

Synaptics is already in maintenance mode and there are no plans to update its features in the future. However, it only supports inertial scrolling and feels very easy to use for those who are familiar with macOS. However, the three-finger Swipe does not work.

https://wiki.archlinux.jp/index.php/Synaptics_%E3%82%BF%E3%83%83%E3%83%81%E3%83%91%E3%83%83%E3%83%89

You can check the list of setting items from man.

https://linux.die.net/man/4/synaptics

When I tried to operate it, it felt like it was moving, and the inertial scroll was comfortable, but I didn't feel it was free to use.

mtrack

mtrack also has three-finger swipe and four-finger swipe as a function. Two-finger scrolling also works quickly. However, it seems that it is not currently maintained. All the setting items are written in the README of this github.

https://github.com/BlueDragonX/xf86-input-mtrack

The scroll amount and movement speed can also be adjusted, so it is old but very effective.

libinput

It is a library that is still under development. I think it's better to use this if possible.

https://wayland.freedesktop.org/libinput/doc/latest/index.html

The setting items are described below.

https://www.mankier.com/4/libinput

Three-finger swipes are not supported, but can be used by installing libinput-gestures. For the reason in the previous section, the amount of movement when scrolling cannot be set.

Which one should I use after all?

If libinput + libinput-gestures is enough, that's fine. With libinput, if you want to tune the amount of scrolling, you can use mtrack.

The author is using mtrack as of December 2019. The following is the configuration file used.

Section "InputClass"
    MatchIsTouchpad "true"
    Identifier "Multitouch Touchpad"
    Driver "mtrack"
    Option "ScrollDistance" "30"
    Option "ScrollUpButton" "5"
    Option "ScrollDownButton" "4"
    Option "SwipeDistance" "200"
    Option "TapDragEnable" "false"
EndSection

--ScrollDistance 30 Adjustable amount of scrolling with two-finger scrolling --ScrollUp / DownButton 5/4 Change to natural scroll by swapping --SwipeDistance 200 Three-finger swipe sensitivity threshold (initial value 700) --TapDragEnable false Disables the tap-drag feature

Assign functions to three-finger swipes

I want to move the desktop from the mouse key. To do this, take the following steps:

--Assign mouse buttons to Swipe with mtrack --With xbindkeys, you can execute commands from the mouse button. --Send keyboard keys (Super + M, etc.) from commands with xdotools --Set the key (Super + M) as a keyboard shortcut for moving the desktop

In mtrack, three-finger swipes are assigned to 8-11 buttons.

To execute the xdotools command with xbindkeys, create ~ / .xbindkeysrc like the following.

"xdotool key Super_R+m"
b:8+Release
"xdotool key Super_R+comma"
b:9+Release
"xdotool key Super_R+s"
b:10+Release

To make xbindkeys resident, configure the command xbindkeys_autostart to be executed. Finally, in the Gnome keyboard shortcut settings, assign the required functions to Super + M, Super + ,, and Super + s.

Using the Trackpad, I was able to adjust the amount of scrolling and assign functions to three-finger swipes.

Recommended Posts

On Linux (Ubuntu), tune the Trackpad and set the function to a three-finger swipe
On Ubuntu Linux, set Tab to q
Specify the volume on linux and make a sound
How to create a Python 3.6.0 environment by putting pyenv on Amazon Linux and Ubuntu
[Linux] [C / C ++] How to get the return address value of a function and the function name of the caller
How to set up WSL2 on Windows 10 and create a study environment for Linux commands
Set up Ubuntu as a Linux cheat sheet and https server
How to divide and process a data frame using the groupby function
How to install php7.4 on Linux (Ubuntu)
Linux screen distribution on Ubuntu Memo that wants to be a Linux screen distribution YouTuber
[C language] How to use the crypt function on Linux [Password hashing]
Build Linux on a Windows environment. Steps to install Laradock and migrate
Compiling the Linux kernel (Linux 5.x on Ubuntu 20.04)
Function to extract the maximum and minimum values ​​in a slice with Go
How to access the contents of a Linux disk on a Mac (but read-only)
How to build Java environment on Ubuntu (Linux)
Set the startup script on Linux (RasPi, Edison)
Memo A beginner tried to build a Java environment and Japaneseize it on Ubuntu 18.04.2 LTS.
Create a function to visualize / evaluate the clustering result
Set up a file server on Ubuntu 20.04 using Samba
How to install Linux on a 32bit UEFI PC
[Part 1] Let's set up a Minecraft server on Linux
"Stop committing Japanese files to git on Mac> <" For the time being, I wrote a script to search for incompatible Japanese files on Mac and Linux.
How to build a Python environment on amazon linux 2
In matplotlib, set the vertical axis on the left side of the histogram to frequency and the vertical axis on the right side to relative frequency (maybe a wicked way)
Good and bad code to compare on a minimap
Set up python and machine learning libraries on Ubuntu
[C / C ++] Pass the value calculated in C / C ++ to a python function to execute the process, and use that value in C / C ++.
When I tried to build a Rails environment on WSL2 (Ubuntu 20.04LTS), I stumbled and fell.
[Shell startup] I tried to display the shell on the TV with a cheap Linux board G-cluster
I also tried to imitate the function monad and State monad with a generator in Python
A story about porting the code of "Try and understand how Linux works" to Rust
Control the Linux trackpad
Define a task to set the fabric env in YAML
How to use Fujifilm X-T3 as a webcam on Ubuntu 20.04
Notes on building TinyEMU and booting the Linux kernel on Emscripten
Install LAMP on Amazon Linux 2 and build a WordPress environment.
[Ubuntu] How to delete the entire contents of a directory
A memo on how to easily prepare a Linux exercise environment
How to set up Ubuntu for Windows Subsystem for Linux 2 (WSL2)
How to build a new python virtual environment on Ubuntu
How to share OS and Vim clipboard on Ubuntu 18.04.3 LTS
I installed FreeCAD on Linux (Ubuntu) and created an icon
I made a function to check the model of DCGAN
Build a Python environment and transfer data to the server
Find the most F-word commit on Linux (git and later)
Assign a link-local address to Linux and use DNS-SD / SSDP
Commands and files to check the version of CentOS Linux
I will publish a shell script created to reduce the trouble of creating LiveUSB on Linux
"Cython" tutorial to make Python explosive: When a function on the C ++ side has an overload.
I want to create a histogram and overlay the normal distribution curve on it. matplotlib edition
I tried to build a SATA software RAID configuration that boots the OS on Ubuntu Server
How to execute Linux commands on Windows by people who do not know Linux (ubuntu) [Until checking the operation of R and python]