Linux Gestures

Swipe

Gestures on Linux.

Swipe

https://evuraan.info/Swipe/

Screengrab:

Features

Swipe uses a novel yet simple correlation mechanism to determine directional intent from event coordinates.

  • Wide range of devices supported
  • Touchscreens and Touchpads
  • Wayland and X11 compatible
  • Easy Installation - download (or git clone) and run.
  • No dependency on Python or Ruby
  • Supports Config files

Available variants/branches

  • Branch modular - Swipe/1.06e - Use with xdotool or ydotool or xte etc.

Requirements

  • libinput-tools
      sudo apt-get install libinput-tools 
  • Your user must be a member of input group:
      sudo gpasswd -a $USER input
      newgrp input
  • Optional: Enable touchpad events
      gsettings set org.gnome.desktop.peripherals.touchpad send-events enabled

Setup

  • Download Swipe to a folder. (Either download the latest release, or clone this repo, or download and extract the Zip file.)
  • Launch swipe with an optional config file

See your distro's documentation to setup Swipe as a Startup Application - an application that starts when a desktop user logs in.

Usage:

$ ./swipe -h
Usage: ./swipe
  -h  --help             print this usage and exit
  -v  --version          print version information and exit
  -s  --sampleCfg        show sample config
  -d  --debug            show verbose output
  -c  /etc/ku.conf       config file to use 
  -k  --keys             show available keys
  -i  /dev/input/event1  kbd device to use
  
  • If no config file is specified, Swipe would use a default configuration.
  • If an appropriate kbd device cannot be found, Swipe will ask you to specify a suitable device using the -i option.

Config

Generate a sample config file with -s option:

$ ./swipe -s
Sample Config: 
# 3 Button Touchpad Gestures:
3right: "KEY_LEFTALT + KEY_LEFT"
3left:  "KEY_LEFTALT + KEY_RIGHT"
3up:    "KEY_SPACE"
3down:  "KEY_LEFTSHIFT + KEY_SPACE"

# 4 Button Touchpad Gestures:
4right: "KEY_LEFTALT + KEY_LEFT"
4left:  "KEY_LEFTALT + KEY_RIGHT"
4up:    "KEY_HOME"
4down:  "KEY_END"

# 5 - Touchscreens
5right:      "KEY_LEFTALT + KEY_LEFT"
5left:       "KEY_LEFTALT + KEY_RIGHT"
5up:         "KEY_DOWN + KEY_DOWN + KEY_DOWN + KEY_DOWN + KEY_DOWN + KEY_DOWN"
5mediumUp:   "KEY_SPACE"
5mediumDown: "KEY_LEFTSHIFT + KEY_SPACE"
5down:       "KEY_UP + KEY_UP + KEY_UP + KEY_UP + KEY_UP + KEY_UP"
5fastup:     "KEY_SPACE"
5fastdown:   "KEY_LEFTSHIFT + KEY_SPACE"

Debug option

Run with -d option to have debug info onto the terminal:

$ ./swipe -d
$ ./swipe -d -c /tmp/swipe.conf 
Wed Aug 25 07:14:12 2021 Swipe/3.01c Read 12 values from the config file
Wed Aug 25 07:14:12 2021 Swipe/3.01c 3 key touchpad events: map[DOWN:KEY_LEFTSHIFT + KEY_SPACE LEFT:KEY_LEFTALT + KEY_RIGHT RIGHT:KEY_LEFTALT + KEY_LEFT UP:KEY_SPACE]
Wed Aug 25 07:14:12 2021 Swipe/3.01c 4 key touchpad events: map[DOWN:KEY_END LEFT:KEY_LEFTALT + KEY_RIGHT RIGHT:KEY_LEFTALT + KEY_LEFT UP:KEY_HOME]
Wed Aug 25 07:14:12 2021 Swipe/3.01c touchscreen events: map[DOWN:KEY_UP + KEY_UP + KEY_UP + KEY_UP + KEY_UP + KEY_UP FAST_DOWN:KEY_LEFTSHIFT + KEY_SPACE FAST_UP:KEY_SPACE LEFT:KEY_LEFTALT + KEY_RIGHT MED_DOWN:KEY_LEFTSHIFT + KEY_SPACE MED_UP:KEY_SPACE RIGHT:KEY_LEFTALT + KEY_LEFT UP:KEY_DOWN + KEY_DOWN + KEY_DOWN + KEY_DOWN + KEY_DOWN + KEY_DOWN]
Copyright © 2021 Evuraan <[email protected]>. All rights reserved.
This program comes with ABSOLUTELY NO WARRANTY.
Wed Aug 25 07:14:12 2021 Swipe/3.01c Howdy!
Wed Aug 25 07:14:12 2021 Swipe/3.01c keyboard device: /dev/input/event3
Wed Aug 25 07:14:12 2021 [C] [getFd] fd opened: 3
Wed Aug 25 07:14:12 2021 Swipe/3.01c About to run stdbuf -oL /usr/libexec/libinput/libinput-debug-events
Wed Aug 25 07:14:12 2021 Swipe/3.01c pid: 9145
Wed Aug 25 07:14:21 2021 Swipe/3.01c left: 0 right: 0 up: 0 down: 0
Wed Aug 25 07:14:21 2021 Swipe/3.01c movedTo: RIGHT
Wed Aug 25 07:14:21 2021 [C] [emit] emitted 24 bytes type 1 code 56
Wed Aug 25 07:14:21 2021 [C] [emit] emitted 24 bytes type 1 code 105
Wed Aug 25 07:14:21 2021 [C] [emit] emitted 24 bytes type 0 code 0
Wed Aug 25 07:14:21 2021 [C] [emit] emitted 24 bytes type 1 code 56
Wed Aug 25 07:14:21 2021 [C] [emit] emitted 24 bytes type 1 code 105
Wed Aug 25 07:14:21 2021 [C] [emit] emitted 24 bytes type 0 code 0
Wed Aug 25 07:14:21 2021 [C] [handleEvents] Handled 2 events
Wed Aug 25 07:14:21 2021 Swipe/3.01c Gesture type 3, intent: RIGHT, cmd: KEY_LEFTALT + KEY_LEFT
Wed Aug 25 07:14:23 2021 Swipe/3.01c touchLen: 3
Wed Aug 25 07:14:23 2021 Swipe/3.01c movedTo: DOWN
Wed Aug 25 07:14:23 2021 Swipe/3.01c fingers: 1
Wed Aug 25 07:14:23 2021 Swipe/3.01c startx :59.95, endx: 59.98
Wed Aug 25 07:14:23 2021 Swipe/3.01c starty: 60.01, endy: 60.34
Wed Aug 25 07:14:23 2021 Swipe/3.01c xdelta: 0.02999999999999403, ydelta: 0.3300000000000054, abs(xd): 0.02999999999999403, abs(yd): 0.3300000000000054
Wed Aug 25 07:14:23 2021 [C] [emit] emitted 24 bytes type 1 code 103
Wed Aug 25 07:14:23 2021 [C] [emit] emitted 24 bytes type 1 code 103
Wed Aug 25 07:14:23 2021 [C] [emit] emitted 24 bytes type 1 code 103
Wed Aug 25 07:14:23 2021 [C] [emit] emitted 24 bytes type 1 code 103
Wed Aug 25 07:14:23 2021 [C] [emit] emitted 24 bytes type 1 code 103
Wed Aug 25 07:14:23 2021 [C] [emit] emitted 24 bytes type 1 code 103
Wed Aug 25 07:14:23 2021 [C] [emit] emitted 24 bytes type 0 code 0
Wed Aug 25 07:14:23 2021 [C] [emit] emitted 24 bytes type 1 code 103
Wed Aug 25 07:14:23 2021 [C] [emit] emitted 24 bytes type 1 code 103
Wed Aug 25 07:14:23 2021 [C] [emit] emitted 24 bytes type 1 code 103
Wed Aug 25 07:14:23 2021 [C] [emit] emitted 24 bytes type 1 code 103
Wed Aug 25 07:14:23 2021 [C] [emit] emitted 24 bytes type 1 code 103
Wed Aug 25 07:14:23 2021 [C] [emit] emitted 24 bytes type 1 code 103
Wed Aug 25 07:14:23 2021 [C] [emit] emitted 24 bytes type 0 code 0
Wed Aug 25 07:14:23 2021 [C] [handleEvents] Handled 6 events
Wed Aug 25 07:14:23 2021 Swipe/3.01c Gesture type 5, intent: DOWN, cmd: KEY_UP + KEY_UP + KEY_UP + KEY_UP + KEY_UP + KEY_UP


Desktop notifications (example) are also enabled in debug mode - which shows the details of the event intercepted.

Keys and buttons supported:

Swipe supports about 482 keys/buttons - pretty much inline with Linux's input-event-codes.h.

Run swipe -k to see a full list:

$ ./swipe -k
Available keys:
key -->  KEY_FN_D
key -->  KEY_BRL_DOT8
key -->  KEY_HANJA
key -->  KEY_FILE
key -->  KEY_PHONE
key -->  KEY_ATTENDANT_ON
key -->  KEY_MACRO_PRESET1
key -->  KEY_KP5
key -->  KEY_PAGEUP
key -->  KEY_RIGHT
key -->  KEY_PRESENTATION
key -->  KEY_KBDINPUTASSIST_NEXT
key -->  KEY_FASTREVERSE
key -->  KEY_KP1
<snip>  

Optional: Build

If you prefer to build yourself, you will need the Go Programming Language installed on your System.

Go into the folder and build as:

go build
Similar Resources

Isle - A Linux Runtime For Mac

Isle Thanks for your interest in isle, Integrated System Linux Environment. Isle is currently in alpha, but working relatively stably! This page will

Dec 29, 2022

Procmon is a Linux reimagining of the classic Procmon tool from the Sysinternals suite of tools for Windows. Procmon provides a convenient and efficient way for Linux developers to trace the syscall activity on the system.

Procmon is a Linux reimagining of the classic Procmon tool from the Sysinternals suite of tools for Windows. Procmon provides a convenient and efficient way for Linux developers to trace the syscall activity on the system.

Process Monitor for Linux (Preview) Process Monitor (Procmon) is a Linux reimagining of the classic Procmon tool from the Sysinternals suite of tools

Dec 29, 2022

Open Source runtime scanner for Linux containers (LXD), It performs security audit checks based on CIS Linux containers Benchmark specification

Open Source runtime scanner for Linux containers (LXD), It performs security audit checks based on CIS Linux containers  Benchmark specification

lxd-probe Scan your Linux container runtime !! Lxd-Probe is an open source audit scanner who perform audit check on a linux container manager and outp

Dec 26, 2022

REconfig-linux is a configuration extractor for the Linux variant of REvil Ransomware.

REconfig-linux is a configuration extractor for the Linux variant of REvil Ransomware.

REconfig-linux is a configuration extractor for the Linux variant of REvil Ransomware. It is capable of extracting the json config from the ELF file and decoding the ransomnote within it. By default the script will write the results to files in the current working directory, but you can also choose to print the config to stdout only by using the -print flag.

Jul 25, 2021

Qt binding for Go (Golang) with support for Windows / macOS / Linux / FreeBSD / Android / iOS / Sailfish OS / Raspberry Pi / AsteroidOS / Ubuntu Touch / JavaScript / WebAssembly

Introduction Qt is a free and open-source widget toolkit for creating graphical user interfaces as well as cross-platform applications that run on var

Jan 2, 2023

A Go package for sending and receiving ethernet frames. Currently supporting Linux, Freebsd, and OS X.

ether ether is a go package for sending and receiving ethernet frames. Currently supported platform: BPF based OS X FreeBSD AF_PACKET based Linux Docu

Sep 27, 2022

netstat-nat - Display NAT entries on Linux systems

netstat-nat This is a reimplementation of the netstat-nat tool, written entirely in Go. It uses the same command line flags and almost the same output

Oct 26, 2021

A rest application to update firewalld rules on a linux server

Firewalld-rest A REST application to dynamically update firewalld rules on a linux server. Firewalld is a firewall management tool for Linux operating

Jan 2, 2023

Test your command line interfaces on windows, linux and osx and nodes viá ssh and docker

Commander Define language independent tests for your command line scripts and programs in simple yaml files. It runs on windows, osx and linux It can

Dec 17, 2022

Run a real Postgres database locally on Linux, OSX or Windows as part of another Go application or test

Run a real Postgres database locally on Linux, OSX or Windows as part of another Go application or test

embedded-postgres Run a real Postgres database locally on Linux, OSX or Windows as part of another Go application or test. When testing this provides

Dec 27, 2022

Perforator is a tool for recording performance metrics over subregions of a program using the Linux "perf" interface.

Perforator Perforator is a tool for recording performance metrics over subregions of a program (e.g., functions) using the Linux "perf" interface.

Dec 15, 2022

Podman based development-only dependency manager for Linux.

Tent is a CLI tool for running development dependencies such as MySQL, Mongo, ElasticSearch etc inside pre-configured containers using simple one

Aug 30, 2022

Create virtual machines and run Linux-based operating systems in Go using Apple Virtualization.framework.

vz - Go binding with Apple Virtualization.framework vz provides the power of the Apple Virtualization.framework in Go.

Jan 9, 2023

progress_bar creates a single customizable progress bar for Linux terminal.

progress_bar creates a single customizable progress bar for Linux terminal.

progress_bar Go Progress Bar Features progress_bar creates a single customizable progress bar for Linux terminal. Installation go get -u github.com/er

Aug 12, 2022

Getting better at Linux with 10 mini-projects.

10 things Linux How do you advance your Linux skills when you are already comfortable with the basics? My solution was to come up with 10 subjects to

Dec 25, 2022

A GNU/Linux monitoring and profiling tool focused on single processes.

A GNU/Linux monitoring and profiling tool focused on single processes.

Uroboros is a GNU/Linux monitoring tool focused on single processes. While utilities like top, ps and htop provide great overall details, they often l

Dec 26, 2022

Automatic Linux privesc via exploitation of low-hanging fruit

Automatic Linux privesc via exploitation of low-hanging fruit

Traitor Automatically exploit low-hanging fruit to pop a root shell. Linux privilege escalation made easy! Traitor packages up a bunch of methods to e

Jan 1, 2023

Tracee: Linux Runtime Security and Forensics using eBPF

Tracee: Linux Runtime Security and Forensics using eBPF

Tracee is a Runtime Security and forensics tool for Linux. It is using Linux eBPF technology to trace your system and applications at runtime, and analyze collected events to detect suspicious behavioral patterns.

Jan 5, 2023

Seesaw v2 is a Linux Virtual Server (LVS) based load balancing platform.

Seesaw v2 Note: This is not an official Google product. About Seesaw v2 is a Linux Virtual Server (LVS) based load balancing platform. It is capable o

Jan 3, 2023
Related tags
Linux Controllers for Kubernetes

Tambourine Kubelet replacement with Built in Linux extensions Development Success: Install, Manage, and Observe a new systemd service from Kubernetes.

Jun 2, 2021
A Go library for the Linux Landlock sandboxing feature

Go landlock library The Go landlock library provides an interface to Linux 5.13's Landlock kernel sandboxing features. The library provides access to

Dec 27, 2022
Sysctl.conf and other system tunings for Linux

PATCHFILES I came to the idea to create patchfiles, when I saw lots of config files people create. Patchfiles implements various config scripts into o

Sep 4, 2022
A Rancher and Kubernetes optimized immutable Linux distribution based on openSUSE

RancherOS v2 WORK IN PROGRESS RancherOS v2 is an immutable Linux distribution built to run Rancher and it's corresponding Kubernetes distributions RKE

Nov 14, 2022
Truly Minimal Linux Distribution for Containers

Statesman Statesman is a minimal Linux distribution, running from memory, that has just enough functionality to run OCI-compatible containers. Rationa

Nov 12, 2021
🔥 🔥 Open source cloud native security observability platform. Linux, K8s, AWS Fargate and more. 🔥 🔥
🔥 🔥   Open source cloud native security observability platform. Linux, K8s, AWS Fargate and more. 🔥 🔥

CVE-2021-44228 Log4J Vulnerability can be detected at runtime and attack paths can be visualized by ThreatMapper. Live demo of Log4J Vulnerability her

Jan 1, 2023
Linux provisioning scripts + application deployment tools. Suitable for self-hosting and hobby-scale application deployments.

Apollo Linux provisioning scripts + application deployment tools. Suitable for self-hosting and hobby-scale application deployments. Philosophy Linux-

Feb 7, 2022
RancherOS v2 is an immutable Linux distribution built to run Rancher and it's corresponding Kubernetes distributions RKE2 and k3s

RancherOS v2 is an immutable Linux distribution built to run Rancher and it's corresponding Kubernetes distributions RKE2 and k3s. It is built using the cOS-toolkit and based on openSUSE

Dec 27, 2022
Lagoon - Simple Linux package repository mirror

Lagoon - Simple Linux package repository mirror A lagoon is a shallow stretch of water separated from the sea by a reef or sandbank. Lagoon can be use

Aug 17, 2022
Automated Arch Linux (Written in Go)
Automated Arch Linux (Written in Go)

ShobuArch -- Automated Arch Linux Tools (Written in Go) Have you ever wanted to use an IaC (Infrastructure as Code) approach towards automating an Arc

Sep 18, 2022