如macOS般丝滑的触摸板

最近折腾了一番linux的触摸板,发现竟然能达到与macos触摸板近乎一样的体验!详细配置如下

需要的包:

  1. libinput-three-finger-drag
  2. libinput-gestures

/etc/X11/xorg.conf.d/30-touchpad.conf中写入以下内容

Section "InputClass"
    Identifier "touchpad"
    Driver "libinput"
    Option "Tapping" "on"
    Option "TappingDrag" "false"
    Option "ClickMethod" "clickfinger"
EndSection

更新:我又在xorg设置中加入了禁止单指触摸拖动( Option "TappingDrag" "false" )。

7 个赞

libinput-three-finger-drag由于用了xdotool,貌似不支持wayland吧?

三指拖动太好用了,比鼠标还方便,完全可以不用鼠标。但是看上去linux不准备支持,挺遗憾。现在能用的方法有点hack

应该也可以,我看aur下面评论里面有人在sway中使用。不清楚是不是要用xdotool

libinput官方好像专门开了个issue.也许未来会支持

在ubuntu 22.04的wayland里编译改版的libinput,实测可用,参考 GitHub - aakside/libinput: complyue's implementation of "3 finger initiated drag (a trackpad feature) for macOS experience on Linux (Wayland or Xorg) desktop" on top of libinput 1.16 里面提到的: I personally stopped using this in favor of abc def’s implementation. You can clone that, then follow the regular build instructions to install.

代码: https://gitlab.freedesktop.org/abcdef/libinput/-/commits/resumable-3fd

编译步骤:libinput build instructions — libinput 1.24.0 documentation

wayland下似乎也能用 (我用的是hyprland) https://aur.archlinux.org/packages/libinput-three-finger-drag 这里的patch 比较新, 回答此问题时,针对的是 libinput-1.26.1

我在gentoo 上libinput 安装的版本是1.26.2 也能打这个补丁 步骤就是 把这些补丁 装到/etc/portage/patches/dev-libs/libinput-1.26.2 目录下 重新安装 libinput ,后 重启sway 或hyprland 就行。

(venv) jxfluoji ➜  libinput-1.26.2 git:(master) ✗ $ equery m libinput
 * dev-libs/libinput [gentoo]
Maintainer:  [email protected] (X11)
Upstream:    Remote-ID:   https://gitlab.freedesktop.org/libinput/libinput.git/ (freedesktop-gitlab)
Homepage:    https://www.freedesktop.org/wiki/Software/libinput/
Homepage:    https://gitlab.freedesktop.org/libinput/libinput
Location:    /var/db/repos/gentoo/dev-libs/libinput
Keywords:    1.26.1:0/10:
Keywords:    1.26.2:0/10: amd64 arm arm64 ppc ppc64 sparc x86 ~alpha ~hppa ~loong ~m68k ~mips ~riscv ~s390
License:     MIT