我是一名 Linux 新用户,并不是一名开发人员,所以我的技能仍然非常非常基础。我刚刚购买了一台装有 Ubuntu 的 Dell XPS 13,并设法(可能)安装了 libinput 来配置触控板上的一些多点触控手势。以下是我想要设置的手势:
- 两指 - 自然滚动(向上滑动/向下翻页,反之亦然)
- 双指单击 - 菜单选项(类似于在普通鼠标上单击鼠标右键)
- 3 根手指左右//上下 - 全屏切换工作区(在 ubuntu 中,目前只能通过 Ctrl+Alt+左/右/上/下来实现)。捏合/缩小 - 放大/缩小
双指顺时针/逆时针旋转 - 旋转页面或图像(pdf、jpeg 等)
停用三指向左/向右滑动 - 在浏览器上切换上一个和下一个网页
- 停用两指向左/向右滑动 - 在浏览器的选项卡之间切换。[出于某种原因,最后这两个似乎是 libinput 上的标准配置]
我还想添加“使用键盘时停用触摸板”选项,或者找到一种方法来调节灵敏度(因为触摸板似乎经常不由自主地被激活)。
当我输入命令时nano ~/.config/libinput-gestures.conf
,我得到的结果如下:
# Typically command will be xdotool, or wmctrl. See "man xdotool" for
# the many things you can action with that tool. Note that unfortunately
# xdotool does not work with native Wayland clients.
#
# Note the default is an "internal" command that uses wmctrl to switch
# workspaces and, unlike xdotool, works on both Xorg and Wayland (via
# XWayland). It also can be configured for vertical and horizontal
# switching over tabular workspaces, as per the example below. You can
# also add "-w" to the internal command to allow wrapping workspaces.
# Move to next workspace (works for GNOME/KDE/etc on Wayland and Xorg)
gesture swipe up _internal ws_up
# gesture swipe up xdotool key super+Page_Down
# Move to prev workspace (works for GNOME/KDE/etc on Wayland and Xorg)
gesture swipe down _internal ws_down
# gesture swipe down xdotool key super+Page_Up
# Browser go forward (works only for Xorg, and Xwayland clients)
gesture swipe left xdotool key alt+Right
# Browser go back (works only for Xorg, and Xwayland clients)
gesture swipe right xdotool key alt+Left
# NOTE: If you don't use "natural" scrolling direction for your touchpad
# then you may want to swap the above default left/right and up/down
# configurations.
# Optional extended swipe gestures, e.g. for browser tab navigation:
#
# Jump to next open browser tab
# gesture swipe right_up xdotool key control+Tab
关于如何插入命令有什么建议吗?我需要直接将它们写在这个文件上还是其他地方?
谢谢!
答案1
我已经按照此步骤安装了 Libinput-gestures指导。可以通过添加以下四行来设置简单的工作区切换/概览,使用三根手指向左/向右滑动(切换)或向上/向下滑动(概览):
gesture swipe left 3 _internal ws_up
gesture swipe right 3 _internal ws_down
gesture swipe up 3 xdotool key ctrl+alt+Up
gesture swipe down 3 xdotool key ctrl+alt+Down
我会尝试弄清楚如何启用您要求的功能。然后,希望我会再次给您打电话。不要忘记使用 root 权限打开配置文件:
sudo nano ~/.config/libinput-gestures.conf
编辑文件后,停止并启动手势服务:
libinput-gestures-setup stop
libinput-gestures-setup start
希望它有效!;)