All Projects → iberianpig → Fusuma

iberianpig / Fusuma

Licence: mit
Multitouch gestures with libinput driver on Linux

Programming Languages

ruby
36898 projects - #4 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to Fusuma

simple gesture detector
Easy to use, reliable and lightweight gesture detector for Flutter apps, exposing simple API for basic gestures
Stars: ✭ 26 (-99.09%)
Mutual labels:  swipe, gesture
Libinput Gestures
Actions gestures on your touchpad using libinput
Stars: ✭ 3,212 (+11.92%)
Mutual labels:  touchpad, libinput
gestures
A library for normalized events and gesture for desktop and mobile.
Stars: ✭ 31 (-98.92%)
Mutual labels:  swipe, gesture
Swipycell
Easy to use UITableViewCell implementing swiping to trigger actions.
Stars: ✭ 230 (-91.99%)
Mutual labels:  swipe, gesture
Any Touch
👋 手势库, 按需2kb~5kb, 兼容PC / 移动端
Stars: ✭ 567 (-80.24%)
Mutual labels:  swipe, gesture
XamarinFormsGesture
Xamarin Form Gesture Effects
Stars: ✭ 85 (-97.04%)
Mutual labels:  swipe, gesture
Gnome Shell Extended Gestures
Better touchpad gesture handling for GNOME
Stars: ✭ 281 (-90.21%)
Mutual labels:  swipe, gesture
React Native Swipe Gestures
4-directional swipe gestures for react-native
Stars: ✭ 471 (-83.59%)
Mutual labels:  swipe, gesture
Nanogallery2
a modern photo / video gallery and lightbox [JS library]
Stars: ✭ 488 (-83%)
Mutual labels:  swipe, gesture
Comfortable Swipe
Comfortable 3-finger and 4-finger swipe gesture using Xdotool in native C++
Stars: ✭ 483 (-83.17%)
Mutual labels:  swipe, gesture
React Soft Slider
Simple, fast and impartial slider
Stars: ✭ 54 (-98.12%)
Mutual labels:  swipe, gesture
Rxgesture
RxSwift reactive wrapper for view gestures
Stars: ✭ 1,069 (-62.75%)
Mutual labels:  swipe, gesture
Touchegg
Linux multi-touch gesture recognizer
Stars: ✭ 2,241 (-21.92%)
Mutual labels:  touchpad, libinput
Meiwidgetview
🔥一款汇总了郭霖,鸿洋,以及自己平时收集的自定义控件集合库(小红书)
Stars: ✭ 2,060 (-28.22%)
Mutual labels:  gesture
Gestureviews
ImageView and FrameLayout with gestures control and position animation
Stars: ✭ 2,257 (-21.36%)
Mutual labels:  gesture
Hswiper Wx
微信小程序swiper插件
Stars: ✭ 167 (-94.18%)
Mutual labels:  swipe
Zingtouch
A JavaScript touch gesture detection library for the modern web
Stars: ✭ 2,019 (-29.65%)
Mutual labels:  gesture
Smart Recycler Adapter
Small, smart and generic adapter for recycler view with easy and advanced data to ViewHolder binding.
Stars: ✭ 197 (-93.14%)
Mutual labels:  swipe
Lantern
基于Swift的高可用视图框架
Stars: ✭ 181 (-93.69%)
Mutual labels:  gesture
Jxpatternlock
An easy-to-use, powerful, customizable pattern lock view in swift. 图形解锁/手势解锁 / 手势密码 / 图案密码 / 九宫格密码
Stars: ✭ 165 (-94.25%)
Mutual labels:  gesture

Fusuma Gem Version Testing on Ubuntu Coverage Status

Fusuma is multitouch gesture recognizer. This gem makes your linux able to recognize swipes or pinchs and assign commands to them.

fusuma_image

襖(Fusuma) means sliding door used to partition off rooms in a Japanese house.

Features

  • Easy installation with RubyGems
  • Defining Gestures and Actions in YAML
  • Sensitivity setting (threshold, interval) for gesture recognition
  • Automatic device addition for reconnecting external touchpads
  • Extension of gesture recognition by plugin system

Installation

Grant permission to read the touchpad device

IMPORTANT: You MUST be a member of the INPUT group to read touchpad by Fusuma.

sudo gpasswd -a $USER input

Then, You apply the change with no logout or reboot.

newgrp input

For Debian Based Distros (Ubuntu, Debian, Mint, Pop!OS)

1. Install libinput-tools

You need libinput release 1.0 or later.

sudo apt-get install libinput-tools

2. Install Ruby

Fusuma runs in Ruby, so you must install it first.

sudo apt-get install ruby

3. Install Fusuma

sudo gem install fusuma

4. Install xdotool (optional)

For sending shortcuts:

sudo apt-get install xdotool

For Arch Based Distros (Manjaro, Arch)

1. Install libinput.

You need libinput release 1.0 or later. This is most probably installed by default on Manjaro

sudo pacman -S libinput

2. Install Ruby

Fusuma runs in Ruby, so you must install it first.

sudo pacman -S ruby

3. Install Fusuma

Note: By default in Arch Linux, when running gem, gems are installed per-user (into ~/.gem/ruby/), instead of system-wide (into /usr/lib/ruby/gems/). This is considered the best way to manage gems on Arch, because otherwise they might interfere with gems installed by Pacman. (From Arch Wiki)

To install gems system-wide, see any of the methods listed on Arch Wiki

sudo gem install fusuma

4. Install xdotool (optional)

For sending shortcuts:

sudo pacman -S xdotool

Touchpad not working in GNOME

Ensure the touchpad events are being sent to the GNOME desktop by running the following command:

gsettings set org.gnome.desktop.peripherals.touchpad send-events enabled

Usage

fusuma

Update

sudo gem update fusuma

Customize Gesture Mapping

You can customize the settings for gestures to put and edit ~/.config/fusuma/config.yml. NOTE: You will need to create the ~/.config/fusuma directory if it doesn't exist yet.

mkdir -p ~/.config/fusuma        # create config directory
nano ~/.config/fusuma/config.yml # edit config file.

Available gestures

swipe:

  • support 3:, 4: fingers
  • support left:, right:, up:, down: directions
  • support begin:, update:, end: events

pinch:

  • support 2:, 3:, 4: fingers
  • support in:, out: directions
  • support begin:, update:, end: events

rotate:

  • support 2:, 3:, 4: fingers
  • support clockwise:,counterclockwise: directions
  • support begin:, update:, end: events

hold:

  • require libinput version 1.19.0 or later
  • support 1:, 2:, 3:, 4: fingers
  • support begin:, end:, cancelled: events

About YAML Basic Syntax

  • Comments in YAML begins with the # character.
  • Comments must be separated from other tokens by whitespaces.
  • Indentation of whitespace is used to denote structure.
  • Tabs are not included as indentation for YAML files.

Example: Gesture Mapping for Ubuntu

https://github.com/iberianpig/fusuma/wiki/Ubuntu

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
hold:
  4:
    command: "xdotool key super" # Activity

More Example of config.yml

The following wiki pages can be edited by everyone.

If you have a nice configuration, please share ~/.config/fusuma/config.yml with everyone.

Threshold and Interval

if command: properties are blank, the swipe/pinch/hold doesn't execute command.

threshold: is sensitivity to swipe/pinch/hold. Default value is 1. If the swipe's threshold is 0.5, shorten swipe-length by half.

interval: is delay between swipes/pinches/hold. Default value is 1. If the swipe's interval is 0.5, shorten swipe-interval by half to recognize a next swipe.

Example of threshold: / interval: settings

swipe:
  3:
    left:
      command: 'xdotool key alt+Right' # threshold: 0.5, interval: 0.75
      threshold: 0.5
    right:
      command: 'xdotool key alt+Left' # threshold: 0.5, interval: 0.75
      threshold: 0.5
    up:
      command: 'xdotool key super' # threshold: 1, interval: 0.75
    down:
      command: 'xdotool key super' # threshold: 1, interval: 0.75
pinch:
  2:
    in:
      command: "xdotool keydown ctrl click 4 keyup ctrl" # threshold: 0.5, interval: 0.5
    out:
      command: "xdotool keydown ctrl click 5 keyup ctrl" # threshold: 0.5, interval: 0.5

threshold:
  pinch: 0.5

interval:
  swipe: 0.75
  pinch: 0.5

There are three priorities of threshold: and interval:. The individual threshold: and interval: settings (under "direction") have a higher priority than the global one (under "root")

  1. child elements in the direction (left/right/down/up → threshold/interval)
  2. root child elements (threshold/interval → swipe/pinch/hold)
  3. default value (= 1)

command: property for assigning commands

On fusuma version 0.4 command: property is available! You can assign any command each gestures.

shortcut: property is deprecated, it was removed on fusuma version 1.0. You need to replace to command: property.

swipe:
  3:
    left:
-      shortcut: 'alt+Left'
+      command: 'xdotool key alt+Left'
    right:
-      shortcut: 'alt+Right'
+      command: 'xdotool key alt+Right'

About xdotool

NOTE: xdotool has some issues

Alternatives to xdotool

Options

  • -c, --config=path/to/file : Use an alternative config file
  • -d, --daemon : Daemonize process
  • -l, --list-devices : List available devices
  • -v, --verbose : Show details about the results of running fusuma
  • --version : Show fusuma version
  • --log-file=path/to/file : Set path of log file

Specify touchpads by device name

Set the following options to recognize multi-touch gestures only for the specified touchpad device.

plugin:
  filters:
    libinput_device_filter:
      keep_device_names:
        - "BUILT-IN TOUCHPAD NAME"
        - "EXTERNAL TOUCHPAD NAME"

Autostart (gnome-session-properties)

  1. Check the path where you installed fusuma with which fusuma
  2. Open gnome-session-properties
  3. Add Fusuma and enter the location where the above path was checked in the command input field
  4. Add the -d option at the end of the command input field

Fusuma Plugins

Following features are provided as plugins.

  • Adding new gestures or combinations
  • Features for specific Linux distributions
  • Setting different gestures per applications

Available plugins

Fusuma plugins are provided with the fusuma-plugin-XXXXX naming convention and hosted on RubyGems.

Name Version About
fusuma-plugin-sendkey Gem Version Emulates keyboard events
fusuma-plugin-wmctrl Gem Version Manages Window and Workspace
fusuma-plugin-keypress Gem Version Detects gestures while pressing multiple keys
fusuma-plugin-tap Gem Version Detects Tap and Hold gestures
fusuma-plugin-appmatcher Gem Version Configure app-specific gestures

Installation of Fusuma plugins

# install fusuma-plugin-XXXX
sudo gem install fusuma-plugin-XXXXX`
# update
sudo gem list fusuma-plugin- | cut -d' ' -f1 | xargs --no-run-if-empty sudo gem update

Tutorial Video

Multitouch Touchpad Gestures in Linux with Fusuma Multitouch Touchpad Gestures in Linux with Fusuma by Eric Adams

Support

I'm a Freelance Engineer in Japan and working on these products after finishing my regular work or on my holidays. Currently, my open-source contribution times is not enough. If you like my work and want to contribute and become a sponsor, I will be able to focus on my projects.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/iberianpig/fusuma. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].