i3wm下使用libinput-gestures实现触控板手势

好久没发了,水一篇文章。

安装

首先安装libinput-gestures

1
2
sudo pacman -S xdotool wmctrl
yay -S libinput-gestures

启动

1
libinput-gestures-setup autostart start

配置

编辑配置文件:

1
~/.config/libinput-gestures.conf

我的配置示例:

1
2
3
4
5
6
7
8
9
10
gesture swipe up    3 xdotool key alt+Up
gesture swipe down 3 xdotool key alt+Down
gesture swipe left 3 xdotool key alt+Left
gesture swipe right 3 xdotool key alt+Right

gesture pinch in 2 xdotool key ctrl+minus
gesture pinch out 2 xdotool key ctrl+plus

gesture swipe left 4 xdotool key alt+shift+Tab
gesture swipe right 4 xdotool key alt+Tab

重启

1
libinput-gestures-setup restart