fusuma是一个支持多指的触控板手势识别程序,使得ubuntu更加易用.
地址: fusuma/GitHub
安装
- 允许读取触控板设备
sudo gpasswd -a $USER input
重启以添加设置
- 安装
sudo apt-get install libinput-tools
sudo apt-get install ruby
sudo gem install fusuma
sudo apt-get install xdotool
ruby安装过程中若出现连接错误可能需要换源
#换源(optional)
gem sources --add https://gems.ruby-china.com/ --remove https://rubygems.org/
确保gem sources -l
只有https://gems.ruby-china.com
- 发送触控板活动
gsettings set org.gnome.desktop.peripherals.touchpad send-events enabled
配置手势
sudo mkdir -p ~/.config/fusuma
sudo gedit ~/.config/fusuma/config.yml
第一次后配置只需要修改~/.config/fusuma/config.yml
即可
- fusuma 支持的手势选项
- swipe:
- support 3:, 4: fingers
- support left:, right:, up:, down: directions
- pinch:
- support 2:, 3:, 4: fingers
- support in:, out: directions
- rotate:
- support 2:, 3:, 4: fingers
- support clockwise:,counterclockwise: directions
- swipe:
我的配置文件
swipe:
3:
left:
command: 'xdotool key alt+Right'
right:
command: 'xdotool key alt+Left'
up:
command: 'xdotool key super'
down:
command: 'xdotool key ctrl+super+d'
4:
left:
command: 'xdotool key super+Left'
right:
command: 'xdotool key super+Right'
up:
command: 'xdotool key super+a'
down:
command: 'xdotool key ctrl+super+d'
pinch:
2:
in:
command: 'xdotool key ctrl+plus'
threshold: 0.1
out:
command: 'xdotool key ctrl+minus'
threshold: 0.1
threshold:
swipe: 0.2
pinch: 0.5
interval:
swipe: 1
pinch: 1
# thredshold: 敏感度
# interval: 手势之间的延迟
默认配置
swipe:
3:
left:
command: "xdotool key alt+Right" # History forward
right:
command: "xdotool key alt+Left" # History back
up:
command: "xdotool key super" # Activity
down:
command: "xdotool key super" # Activity
4:
left:
command: "xdotool key ctrl+alt+Down" # Switch to next workspace
right:
command: "xdotool key ctrl+alt+Up" # Switch to previous workspace
up:
command: "xdotool key ctrl+alt+Down" # Switch to next workspace
down:
command: "xdotool key ctrl+alt+Up" # Switch to previous workspace
pinch:
in:
command: "xdotool keydown ctrl click 4 keyup ctrl" # Zoom in
out:
command: "xdotool keydown ctrl click 5 keyup ctrl" # Zoom out
设置开机自启
- 设置
fusuma.desktop
cd /usr/share/applications
touch fusuma.desktop
sudo gedit fusuma.desktop
fusuma.desktop
[Desktop Entry]
Encoding=UTF-8
Name=fusuma
Comment=fusuma
# fusuma位置
Exec=/var/lib/gems/2.5.0/gems/fusuma-1.9.0/exe/fusuma # (改)
# fusuma的自定义icon
Icon=/usr/share/icons/others/tactile.png # (改)
Terminal=false
StartupNotify=false
Type=Application
Categories=Application;Development;
fusuma.desktop
-
打开tweaks
Startup Applications -> + -> 找到fusuma
开机自启
重启
网友评论