Ubuntu下觸控板手勢調節軟件xSwipe


樓主進了一台Thinkpad T450s,觸控板支持4點觸控,安裝了ubuntu14.04 LTS之后,觸控板只剩下雙指滑動了,略有不爽,各種google,百度。

真找到辦法了。

首先得知了touchegg,但是各種安裝不上,折騰的我心力焦悴,最后偶然在知乎上有一位伙伴說了他的電腦用xSwipe搞定了。

於是轉向xSwipe,在開源項目網站上GitHub上找到了這神器。 傳送門,或者復制地址:https://github.com/iberianpig/xSwipe  到地址欄打開,可能打開得很慢,樓主備份了要下載的文件,下載地址放在文章末尾了。

官方的文檔是英文版,雖然推薦讀者閱讀原版文章,但是為了照顧英文不好的小伙伴,我找到了一片中文博客(點我訪問),或者復制地址:http://loliko.me/zai-linuxzhong-tian-jia-hong-mo-ban-shou-shi/      到地址欄打開

下面是GitHub上的說明文檔:

 

xSwipe

xSwipe is multitouch gesture recognizer. This script make your linux PC able to recognize swipes like a Macbook.

Usage

Before running the script, you must first do some preparations.

  1. Download xSwipe
  2. Install X11::GUITest
  3. Enable SHMConfig

1. Download xSwipe

Type below code, download xSwipe from github

$ cd ~
$ wget https://github.com/iberianpig/xSwipe/archive/master.zip
$ unzip master.zip

2. Install X11::GUITest

To install libx11-guitest-perl from synaptic package manager Or run the script on the terminal run as

$ sudo apt-get install libx11-guitest-perl

NOTE: If using Ubuntu14.04, or later

Install older version synaptics driver that is compatible with xSwipe.
$ sudo apt-get install -y git build-essential libevdev-dev autoconf automake libmtdev-dev xorg-dev xutils-dev libtool
$ sudo apt-get remove -y xserver-xorg-input-synaptics
$ git clone https://github.com/Chosko/xserver-xorg-input-synaptics.git
$ cd xserver-xorg-input-synaptics
$ ./autogen.sh
$ ./configure --exec_prefix=/usr
$ make
$ sudo make install

3. Enable SHMConfig

Open /etc/X11/xorg.conf.d/50-synaptics.conf with your favorite text editor and edit it to enable SHMConfig

$ sudo gedit /etc/X11/xorg.conf.d/50-synaptics.conf

NOTE:You will need to create the /etc/X11/xorg.conf.d/ directory and create 50-synaptics.conf if it doesn't exist yet. $ sudo mkdir /etc/X11/xorg.conf.d/

/etc/X11/xorg.conf.d/50-synaptics.conf
Section "InputClass"
Identifier "evdev touchpad catchall"
Driver "synaptics"
MatchDevicePath "/dev/input/event*"
MatchIsTouchpad "on"
Option "Protocol" "event"
Option "SHMConfig" "on"
EndSection

To reflect SHMConfig, restart your session.

That's it for preparation.

Run xSwipe

To run xSwipe, type below code on terminal.

$ perl ~/xSwipe-master/xSwipe.pl

Note:You should run xSwipe.pl in same directory as "eventKey.cfg" .

You can use "swipe" with 3 or 4 fingers, they can call an event. Additionally, some gestures are avilable.

  • edge-swipe : swipe with 2 fingers from outside edge(need to enable with option).
  • long-press : hold pressure for 0.5 seconds with 3 or 4 fingers.

Option

  • -d RATE : RATE is sensitivity to swipe.Default value is 1. Shorten swipe-length by half (e.g.,$ perl xSwipe.pl -d 0.5)
  • -m INTERVAL : INTERVAL is how often synclient monitor changes to the touchpad state. Default value is 10(ms). Set 50ms as monitoring-span. (e.g.,$ perl xSwipe.pl -m 50)
  • -n : Natural scroll like Macbook, use "/nScroll/eventKey.cfg".
  • -e : Enable edge-swipe

Customize

You can customize the settings for gestues to edit eventKey.cfg. Please check this article, "How to customize gesture".

Bindable gestures

  • 3/4/5 fingers swipe
  • 2/3/4/5 fingers long-press
  • 2/3/4 fingers edge-swipe
    • 2fingers edge-swipe: only swipe-left/right from right/left edge
    • 3fingers edge-swipe: only swipe-down from top egde

Example shortcut keys

  • go back/forward on browser (Alt+Left, Alt+Right)
  • open/close a tab on browser (Ctrl+t/Ctrl+w)
  • move tabs (Ctrl+Tab, Ctrl+Shift+Tab)
  • move workspaces (Alt+Ctrl+Lert, Alt+Ctrl+Right, Alt+Ctrl+Up, Alt+Ctrl+Down)
  • move a window (Alt+F7)
  • open launcher (Alt+F8)
  • open a terminal (Ctrl+Alt+t)
  • close a window (Alt+F4)

Please let me know if you have any questions about this program.

 

 

我按照說明文檔安裝xSwipe之后,進行到最后一步  

perl ~/xSwipe-master/xSwipe.pl

遇到了錯誤提示
"Can't locate Smart/Comments.pm in @INC (you may need to install the Smart::Comments module) (@INC contains: /etc/perl /usr/local/lib/perl/5.18.2 /usr/local/share/perl/5.18.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.18 /usr/share/perl/5.18 /usr/local/lib/site_perl .) at /home/jackson/xSwipe-master/xSwipe.pl line 15."

真是蛋疼,每到最后關頭就出問題。百度無果,最后還是google給了我答案,原文在這兒:https://forum.teksyndicate.com/t/perl-smart-comments/86880

做法就是,在終端下鍵入下列命令
sudo cpan -i Smart::Comments

此時要正常聯網,樓主用代理模式上的網,各種錯誤,不知道具體原因在哪兒,最后用手機開wifi給電腦用,心疼啊(別問我為什么沒wifi,學校不給大一新生校園網)
不出意外得話,應該在執行完執之前那條命令之后,就搞定了
使用
perl ~/xSwipe-master/xSwipe.pl

應該就可以開啟觸控板手勢,目前我的電腦能實現三指滑動切換工作區,其它還沒設置。

xSwipe下載:http://pan.baidu.com/s/1gesqHm7
下載之后請先查看README.md文件,在xSwipe得其中一個子文件夾內。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM