Ubuntu中下载安装fusuma并设置fusuma开机启动,附赠个人fusuma手势配置

 

看到小伙伴的mac小本本的手势操作很炫酷,于是自己也想做个(小声BB还是不因为没钱买mac.......)。

1、下载安装fusuma

①.安装必要的包,终端输入:

sudo apt-get install libinput-tools
sudo apt-get install xdotool
sudo gem install fusuma

PS:有些人可能会安装失败,因为gem要使用Ruby的环境,如果上面的第三步安装失败了,记得先使用下面这条指令安装Ruby。然后再执行上述第三条命令。

sudo apt-get install ruby

2、试用fusuma

①.启动fusuma,终端输入:

sudo fusuma

使用触摸板后,这个终端中会有当前的动作,而不是回到

[email protected] ~$:

这个地方。这里不做演示了,都能看得懂。

3、设置fusuma开机启动

①.打开目录/usr/share/applications

②.在此处打开终端,输入:

sudo touch fusuma.desktop

输入密码,回车后发现这个文件夹下面多了一个fusuma的空白标志。

③.继续使用此终端,输入以下内容使用vi编辑编辑我们刚刚创建的这个图标

sudo vi fusuma

回车,输入密码成功后,进入了vi的命令模式,我们点击  i  键,进入插入模式,输入以下内容:

[Desktop Entry]
Encoding=UTF-8
Name=fusuma
Comment=fusuma
Exec=/var/lib/gems/2.5.0/gems/fusuma-0.10.2/exe/fusuma
#上面这里时你的fusuma的路径,如果你不知道在哪里,就在根目录下搜索一下,找到这个路径。
Icon=/usr/share/icons/chumoban.png
#这里是你的fusuma的图标,随便找一个就行,如果时强迫症,非得找个好看的,就来这里http://www.iconfont.cn/
Terminal=false  #软件打开时是否启动终端,这里选择false
StartupNotify=false
Type=Application
Categories=Application;Development;

注意:以上内容,你和我的代码不同的地方仅为fusuma的路径和图标的路径,其他的保持一致就行。在此你还可以重启电脑,然后从图标这里打开这个软件试一下这个有没有安装成功。

④.打开优化工具,将fusuma设为开机启动。

如果没有安装优化工具的,打开Ubuntu软件商店,搜索框输入tweak,回车

Ubuntu中下载安装fusuma并设置fusuma开机启动,附赠个人fusuma手势配置

安装完之后,打开此软件,如图(此时你的fusuma应该不在右边的开机启动程序里):

Ubuntu中下载安装fusuma并设置fusuma开机启动,附赠个人fusuma手势配置

点击“开机启动程序”,然后点击右边的那个加号,把fusuma添加进入即可。

最后,送给大家我的个人手势配置,在复制我的手势之前,先给大家一个神秘的链接https://blog.csdn.net/Small_Dong_0_o/article/details/83342693

点击完上面那个神秘链接之后,也许你就明白了什么,我们继续往下讲。

fusuma的配置文件是~/.config/fusuma/config.yml ,如果你找不到这个文件,那你就直接在根目录下搜索config.yml,然后进入到这个目录下,以管理员的身份打开config.yml这个文件并编辑。

默认配置:

swipe:
  3: 
    left: 
      shortcut: 'alt+Left'
    right: 
      shortcut: 'alt+Right'
    up: 
      shortcut: 'ctrl+t'
    down: 
      shortcut: 'ctrl+w'
  4:
    left: 
      shortcut: 'super+Left'
    right: 
      shortcut: 'super+Right'
    up: 
      shortcut: 'super+a'
    down: 
      shortcut: 'super+s'
pinch:
  in:
    shortcut: 'ctrl+plus'
  out:
     shortcut: 'ctrl+minus'

threshold:
  swipe: 1
  pinch: 1

interval:
  swipe: 1
  pinch: 1

我的配置:

swipe:
  3:
    left:
      command: 'xdotool key ctrl+alt+Down'
    right:
      command: 'xdotool key ctrl+alt+Up'
    up:
      command: 'xdotool key super+s'
    down:
      command: 'xdotool key super+d'
  4:
    left:
      command: 'xdotool key super+Left'
    right:
      command: 'xdotool key super+Right'
    up:
      command: 'xdotool key super+Up'
    down:
      command: 'xdotool key super+Down'

pinch:
  2:
    in:
      command: 'xdotool key ctrl+equal'
    out:
      command: 'xdotool key ctrl+minus'
  4:
    in:
      command: 'xdotool key super+a'
    out:
      command: 'xdotool key super+s'

threshold:
  swipe: 0.3
  pinch: 0.1

interval:
  swipe: 1
  pinch: 1

有什么不懂的,欢迎询问。有什么错误,欢迎指正。