Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jyane/twofingers-gesture
Enables gestures by 2 fingers on Linux (X11, GNOME)
https://github.com/jyane/twofingers-gesture
Last synced: 23 days ago
JSON representation
Enables gestures by 2 fingers on Linux (X11, GNOME)
- Host: GitHub
- URL: https://github.com/jyane/twofingers-gesture
- Owner: jyane
- License: mit
- Created: 2022-05-23T06:28:43.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-07T02:30:37.000Z (8 months ago)
- Last Synced: 2024-03-07T03:34:15.886Z (8 months ago)
- Language: Python
- Homepage:
- Size: 7.81 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# twofingers-gesture
twofingers-gesture enables mouse / touchpad gestures with 2 fingers on Linux (X11, gnome).## Background and Idea
Unfortunately, libinput doesn't support 2 fingers gestures so users can't go forward/backward browser histroy, etc ... with 2 fingers swipe.
However, other major OSs, Windows and Mac are supporting this feature even ChromeOS does.Even libinput doesn't support 2 fingers swipe, `libinput debug-events` exposes 2 fingers actions with details like this:
```
event6 POINTER_SCROLL_FINGER +2.867s vert 0.00/0.0 horiz -7.03/0.0* (finger)
event6 POINTER_SCROLL_FINGER +2.873s vert 0.00/0.0 horiz -7.47/0.0* (finger)
event6 POINTER_SCROLL_FINGER +2.880s vert 0.00/0.0 horiz -7.03/0.0* (finger)
event6 POINTER_SCROLL_FINGER +2.887s vert 0.00/0.0 horiz -7.47/0.0* (finger)
event6 POINTER_SCROLL_FINGER +2.894s vert 0.00/0.0 horiz -7.03/0.0* (finger)
event6 POINTER_SCROLL_FINGER +2.901s vert 0.00/0.0 horiz -5.27/0.0* (finger)
```This tool parses the lines and checks vert / horiz values and if the action was like forward/backward swipe then maps them to `xdotool key ...` and executes it.
This logic eventualy converts swipe actions to keyboard inputs.
## Registering this to autostart
Write this file to `${XDG_CONFIG_HOME}/autostart/${name}.desktop` usually `~/.config/`.```
[Desktop Entry]
Type=Application
NoDisplay=true
Terminal=false
Name=twofingers-gesture
Icon=
Exec=/PATH_TO/main.py
Comment=
Categories=System;
```## Troubleshooting
`main.py` contains only ~40 lines with comments, you can easily understand that.
1. Run xdotool and verify it works.
2. Run libinput debug-events and verify it works.
3. Make sure that you are in `input` group.The values in `main.py` are customized for my environment (debian testing on X1 carbon), you can watch `libinput debug-events` logs and update `main.py`.
## TODO
Config, rewrite with golang