Mouse gestures - "draw" commands using your mouse/touchscreen/touchpad. Now written in Rust and completely independent of X11 and legacy drivers.
sudo apt install pkg-config libgtk-4-dev libevdev-dev git meson ninja-build cargosudo dnf install pkgconf-pkg-config gtk4-devel libevdev-devel git meson ninja-build cargoapk add git meson cargo sudo make
apk add glib-dev cairo-dev gdk4 gdk-pixbuf-dev pango-dev gtk4.0-devYou can compile and install mygestures either using the compatibility wrapper Makefile or directly using meson.
git clone https://github.com/deters/mygestures.git
cd mygestures/
make
sudo make installgit clone https://github.com/deters/mygestures.git
cd mygestures/
meson setup build
meson compile -C build
sudo meson install -C buildThe installation process automatically installs the mygestures and gestos binaries, installs the udev rules, reloads the udev system, and adds your user to the input group if necessary.
mygestures: Start the daemon. Uses default button (button 3 / right-click) on the default mouse device.gestos: Start the GTK4 GUI configuration editor.
To use gestures: Hold the trigger button (default: right-click / button 3) and move the mouse to draw a gesture. Release the button to execute.
- Wrong device: The daemon auto-detects standard pointer devices. If yours is not captured, find its path in
/dev/input/by-path/and runmygestures -d '/dev/input/by-path/event-mouse'. - Permissions: Ensure you have installed the udev rules (see above) and configured permissions. By default, the udev rules restrict access to the
inputgroup for security. You can configuremygestureswith Set-Group-ID (SGID) privileges to run securely, or fallback to standarduaccess/inputgroup setups. Running the binary will output detailed instructions on both options. - Trigger Button: If you are on a laptop with a touchpad, you might need to use button 1 (left-click) instead of 3. Try
mygestures -b 1. - Missing /dev/uinput (e.g. Alpine Linux): On some distributions like Alpine Linux, the
uinputkernel module is not loaded by default, and/dev/uinputwill not exist. Load it manually usingsudo modprobe uinput. To make this persistent on boot, adduinputto/etc/modules(or/etc/modules-load.d/uinput.conf). (Note: If you install MyGestures using the pre-built packages (.deb, .rpm, .apk), the package installation automatically sets up the modules-load rules to load the uinput module on boot.)
On first execution, MyGestures will create a configuration file for your user:
~/.config/mygestures/mygestures.yaml
Gestures are defined using coordinate paths matched using the Protractor gesture recognition algorithm.
Example of mygestures.yaml:
global:
"Close window":
move: "0,0 0,100 100,100" # drawn as an 'L' shape
do: kill
"Maximize window":
move: "50,100 50,0" # drawn upwards
do: toggle-maximized
"Copy":
move: "100,0 0,0 0,100 100,100"
do: keypress Control_L+Cdo: maximize# Maximizes focused windowdo: restore# Restores maximized windowdo: iconify# Minimizes/hides windowdo: toggle-maximized# Toggles window maximization statedo: raise# Raises windowdo: lower# Lowers windowdo: toggle-fullscreen# Toggles window fullscreen state
do: kill# Closes the active windowdo: exec <cmd># Executes a custom shell command (e.g.exec gedit)
do: keypress <keys># Simulates a keyboard shortcut (e.g.keypress Control_L+c)do: click <button># Emulates a mouse click (e.g.click 3for right-click)
(Supported on Sway, Hyprland, GNOME, and KDE)
do: workspace-leftdo: workspace-rightdo: workspace-updo: workspace-downdo: show-overview# Toggles activities overviewdo: show-app-grid# Shows application viewdo: show-desktopdo: lock-screendo: terminaldo: volume-updo: volume-downdo: volume-mutedo: media-playdo: media-nextdo: media-prev
GPL-2.0-or-later