In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains "how to configure libinput-gestures multi-gesture operation in kde5 and archlinux environment". The content of the article is simple and clear, easy to learn and understand. Please follow the editor's train of thought to study and learn "how to configure libinput-gestures multi-gesture operation in kde5 and archlinux environment".
Original intention
My notebook is an archlinux+kde plasma5 environment. Seeing that my colleague's macbook pro supports a lot of gesture operations (gestures), I also want to configure convenient gesture operations in archlinux and kde environments.
After querying the data, it is found that both touchegg and libinput-gestures can meet the requirements, but in the actual configuration process, there are many problems in touchegg that have not been solved, while libinput-gestures basically does not have much problem. So this article mainly introduces how to configure libinput-gestures.
Preliminary knowledge
Computer window manager
Kde is a X.Org desktop environment. A X.Org Server-based driver xf86-input-libinput-git is maintained on aur, which is very convenient. The relationship between them is as follows:
X11 client is kde plasma5 to me.
The driver libinput,linux Ecology provides many drivers. The driver used in this paper is libinput, which is responsible for analyzing the data obtained by the kernel from the input device and sending it to the desktop environment. The desktop environment gives feedback according to different data.
Terminology interpretation
Touchpad: the touchpad in the usual sense.
Clickpad: refers to the touchpad without a button at the bottom. Refer to clickpad. Clickpad simulates the left, middle and right mouse button clicks through the click behavior of different number of fingers. These can be configured or turned off.
Click: click to "press" and "release" the physical buttons in the context of this article.
For more information on the behavior of soft buttons on Clickpad software button behavior:clickpad, please see Clickpad software button behavior.
Libinput installation
Install basic libinput and xf86-input-libinput
Sudo gpasswd-a $USER inputsudo pacman-S libinput xf86-input-libinput configuration
Libinput can be configured in two ways:
Permanent configuration using configuration files
Use the xinput command line tool for real-time configuration of the runtime (runtime), mainly for debugging.
Configuration file
The default configuration file after libinput installation is in the / usr/share/X11/xorg.conf.d directory. How to install multiple drivers, there will be multiple files:
➜xorg.conf.d lltotal 12K Mustang RWFURAFUR-1 root root 1.4K Aug 14 05:40 10Kuks.confQURWFUR QQ-1 root root 964 May 5 20:24 40 MULBINPUTHART-1 root root 1.8K Nov 18 2016 70-synaptics.conf
The author has installed 3 drivers here, so there are 3 configuration files. By default, kde will decide which profile to use first according to the size of the file prefix digits. The higher the number, the higher the priority.
We need to copy the default configuration file to the / etc/X11/xorg.conf.d/ directory:
Sudo cp / usr/share/X11/xorg.conf.d/40-libinput.conf / etc/X11/xorg.conf.d/40-libinput.conf
The following is the configuration of the touchpad section of the file:
Section "InputClass" Identifier "touchpad" MatchIsTouchpad "on" MatchDevicePath "/ dev/input/event*" Driver "libinput" Option "Tapping"on" Option "ButtonMapping"1 304 5 6 7" Option "TappingButtonMap"lmr" Option "DisableWhileTyping"on" Option "TappingDrag"on" EndSection
For more information and explanation, please see libinput man page: based on X.Org input dirver, which explains the following important configuration parameters:
Option "Tapping"on": finger click touchpad sends mouse click event
Option "TappingButtonMap"lmr": 1 finger clicks the corresponding left mouse button, 2 fingers clicks the corresponding middle mouse button, 3 mice clicks the corresponding right mouse button.
Option "ButtonMapping"1304567", button mapping, see libinput#Button_Mapping for details, here the author closes the corresponding left button of 3 fingers.
Option "DisableWhileTyping"on": do not detect touchpad events while typing to prevent users from accidentally touching touchpad and causing unnecessary effects.
Option "TappingDrag"on": enable click and drag.
Debug
Identify touchpad Devic
➜~ xinput list ⎡ Virtual core pointer id=2 [master pointer (3)] ⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)] ⎜ ↳ SynPS/2 Synaptics TouchPad id=13 [slave pointer (2)] ⎜ ↳ TPPS/2 IBM TrackPoint id=16 [slave pointer (2)].
View the detailed configuration of touchpad
➜~ xinput list-props "SynPS/2 Synaptics TouchPad" Device 'SynPS/2 Synaptics TouchPad': Device Enabled: 1 Coordinate Transformation Matrix: 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000 1.000000 libinput Tapping Enabled: 1 libinput Tapping Enabled Default: 0 libinput Tapping Drag Enabled: 1 libinput Tapping Drag Enabled Default: 1 libinput Tapping Drag Lock Enabled: 0 libinput Tapping Drag Lock Enabled Default: 0 libinput Tapping Button Mapping Enabled: 0,1 libinput Tapping Button Mapping Default: 1 0 libinput Accel Speed: 0.000000 libinput Accel Speed Default: 0.000000 libinput Natural Scrolling Enabled: 0 libinput Natural Scrolling Enabled Default: 0 libinput Send Events Modes Available: 1,1 libinput Send Events Mode Enabled: 0,0 libinput Send Events Mode Enabled Default 0 libinput Left Handed Enabled (284): 0 libinput Left Handed Enabled Default (285): 0 libinput Scroll Methods Available (286): 1,1,0 libinput Scroll Method Enabled (287): 1,0,0 libinput Scroll Method Enabled Default (288): 1,0,0 libinput Click Methods Available (303): 1,1 libinput Click Method Enabled (304): 1,0 libinput Click Method Enabled Default 0 libinput Middle Emulation Enabled: 0 libinput Middle Emulation Enabled Default: 0 libinput Disable While Typing Enabled: 1 libinput Disable While Typing Enabled Default: 1 Device Node: "/ dev/input/event10" Device Product ID: 2,7 libinput Drag Lock Buttons: libinput Horizontal Scroll Enabled: 1
There is an important value Device Node (265): "/ dev/input/event10", which will be used later when using the libinput command line.
Use libinput debug-events to monitor touchpad events
➜~ libinput debug-events-- device / dev/input/event10-event10 DEVICE_ADDED SynPS/2 Synaptics TouchPad seat0 default group1 cap:pg size 100x56mm tap (dl off) left scroll-nat scroll-2fg-edge click-buttonareas-clickfinger dwt-onevent10 GESTURE_SWIPE_BEGIN + 2.82s 3event10 GESTURE_SWIPE_UPDATE + 2.82s 3 0.00/ 0.44 (0.00/ 3.63 unaccelerated) event10 GESTURE_SWIPE_UPDATE + 2.84s 3 0.00/ 3.43 .38 unaccelerated) event10 GESTURE_SWIPE_UPDATE + 2.87s 3 0.00/ 5.00 (0.00swap 19.38 unaccelerated) event10 GESTURE_SWIPE_UPDATE + 2.89s 3 0.00/ 3.33 (0.00Accord 10.90 unaccelerated) event10 GESTURE_SWIPE_UPDATE + 2.92s 3 0.00/ 2.74 (0.0048 unaccelerated)
Use libinput debug-gui to monitor touchpad events
➜~ libinput debug-gui-- device / dev/input/event10info: event10 SynPS/2 Synaptics TouchPad added
A GUI screen will appear to help with the detection.
Libinput-gestures
After configuring the touchpad and gestures, use libinput-gestures to parse the touchpad data, and then perform the relevant operations. Xdotool,xdotool is a command line tool that simulates keyboard / mouse input and window management. Libinput-gestures depends on xdotool.
After libinput-gestures is installed, there will be a default configuration in / etc/libinput-gestures.conf, and users can configure their own configuration in ~ / libinput-gestures.conf. The author modifies the relevant configuration according to his own needs, as follows:
# Switch to next desktopgesture swipe right 4 xdotool key ctrl+F1# Switch to prev desktopgesture swipe left 4 xdotool key ctrl+F2# Present windows (current desktop) gesture swipe down 3 xdotool key ctrl+F9# Present windows (all desktop) gesture swipe down 4 xdotool key ctrl+F10# Show desktopgesture swipe up 3 xdotool key super+d# Show desktops gridgesture swipe up 4 xdotool key ctrl+F8
The main idea is to trigger the relevant shortcut keys for different gestures, and the configuration of the shortcut keys can be set in the system preference settings → shortcut keys. The following figure shows the shortcut key configuration for switching desktops in plasma5:
Demo
Four fingers slide horizontally to switch desktops:
TODOs
Zoom in / out the web page by pinching (pinch in/pinch out) (alignment macbook)
Forward / backward of the web page (macbook)
To be added...
Summary
This article took about a month from the idea to the configuration, and most of the time was spent understanding the input driver, configuring the driver, and configuring and debugging toucgegg and libinput-gestures.
After configuring my own archlinux gestures, the author coincidentally used macbook pro for a week and experienced the gestures below Apple. The overall feeling is that Apple's gestures are smoother and more accurate. After all, Apple is its own ecosystem, which can be encapsulated and debugged for its own macOS system. In the Linux ecology, because there are multiple Linux distributions and desktop environments, gesture operations are difficult to be compatible with all distributions, which requires users to have strong hands-on ability and understanding ability. It can be said that both of them can achieve rich gesture operations, and Linux is more scalable, but requires more professional knowledge and hands-on ability.
Thank you for reading, the above is the content of "how to configure libinput-gestures multi-gesture operation in kde5 and archlinux environment". After the study of this article, I believe you have a deeper understanding of how to configure libinput-gestures multi-gesture operation in kde5 and archlinux environment. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.