Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upstream #35

Open
wants to merge 27 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -195,3 +195,7 @@ fabric.properties
# Editor-based Rest Client
.idea/httpRequests

# LSP stuff
.ccls*
.clangd

20 changes: 20 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
language: c
compiler: gcc
os: linux
dist: xenial
before_install:
- docker build -t builder -f build.Dockerfile .
script:
- docker run --rm --device /dev/input -v /run/udev/data:/run/udev/data -v $(pwd):/workdir
-w /workdir -it builder cmake .
- docker run --rm --device /dev/input -v /run/udev/data:/run/udev/data -v $(pwd):/workdir
-w /workdir -it builder make
deploy:
provider: releases
file: "gebaard"
skip_cleanup: true
on:
repo: Coffee2CodeNL/gebaar-libinput
tags: true
api_key:
secure: cocUFpTCvgEjAZzj5EC9iglQ4j1zx71a+U4aPLVUgNQNsFCZusSU//4ZEEwh1uYkJnnoxfhooRhAdgyMaWJs9Uvj7lgxk3dmHkc5f/p6iTFVH1lhPz06BT1tZkWzMkxLFilX8o53xl18qIiGBhgWGvqc5jFCFPrMALphql3qNrI0L/ZZRgU6FP7sXMU4LIomcIUsXKhDUZdRnrDZ3TIYaCrHSZEvLHPPlbYEVHncdmWFoZBjLMQ/M+i0cOgTHybxA6vlyLzA7zoMSGBgM7jDPDE6UN275PJenHT04gn6b9E3Ye6KLqhO/NZWseWfMZkQAnR1HJ6SswpF45nqLoMpjhEjQ5stJKe2dEIbsoeTEjfJgY5usOzh9UBawp+5SyuXYTMGHyaYpJM5w55KQv4bkecQm0yLVg4GBD852lEN2YuWkoteRH+3NYRR2l+Y/xsGKLAxJS4LoO+Jocf6ZUDjhrAyec2bxztQE7VGko2ndwC7nWPO6W8YfWfvgc08lqux5cYJjPE6Jj4fwrxMFhQ03eREcK8iYGHXs4kRTEv8Fj+Q0APFWIXVm6D2s9vPKPmzY84Q/Hq6B1gZKWwbsMOLUerRzsm6LtAxgg+vUQ3EIlknL2ciOkjHtWItkM6kl3txfalrf8TDl+mSTKnLpj2ZO5NxfdXC0aC7AZFGNhn+zSM=
70 changes: 65 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Click to join: [![Discord](https://img.shields.io/discord/548978799136473106.svg
14. Reboot and see the magic

```toml
[commands.swipe.three]
[swipe.commands.three]
left_up = ""
right_up = ""
up = ""
Expand All @@ -46,7 +46,7 @@ down = ""
left = ""
right = ""

[commands.swipe.four]
[swipe.commands.four]
left_up = ""
right_up = ""
up = ""
Expand All @@ -55,8 +55,26 @@ right_down = ""
down = ""
left = ""
right = ""

[pinch.commands]
in = ""
out = ""

[pinch.settings]
threshold = 0.25
one_shot = false


[swipe.settings]
threshold = 0.5
one_shot = true
trigger_on_release = false
```

* `pinch.settings.threshold` key sets the distance between fingers where it shold trigger.
Defaults to `0.25` which means fingers should travel exactly 25% distance from their initial position.
* `swipe.settings.threshold` sets the limit when swipe gesture should be executed. Defaults to 0.5.

### Repository versions

![](https://img.shields.io/aur/version/gebaar.svg?style=flat)
Expand All @@ -67,7 +85,7 @@ right = ""

_~/.config/gebaar/gebaard.toml_
```toml
[commands.swipe.three]
[swipe.commands.three]
left_up = ""
right_up = ""
up = "bspc node -f north"
Expand All @@ -77,7 +95,8 @@ down = "bspc node -f south"
left = "bspc node -f west"
right = "bspc node -f east"

[commands.swipe.four]

[swipe.commands.four]
left_up = ""
right_up = ""
up = "rofi -show combi"
Expand All @@ -86,16 +105,57 @@ right_down = ""
down = ""
left = "bspc desktop -f prev"
right = "bspc desktop -f next"

[pinch.commands.two]
in = "xdotool key Control_L+equal"
out = "xdotool key Control_L+minus"

[pinch.settings]
threshold=0.25
one_shot=false

[swipe.settings]
threshold = 0.5
one_shot = true
trigger_on_release = false
```

Add `gebaard -b` to `~/.config/bspwm/bspwmrc`

**KDE Plasma 5**

Any multiword value (like in some qdbus commands) must have escaped double quotes to work (`\"`).

Additionally, in some distros (like openSUSE), the `qdbus` command might be named `qdbus-qt5`.
Some navigation-related qdbus commands are provided directly by KWin and can be seen via `qdbus org.kde.KWin /KWin`,
but most shortcuts can be checked with `qdbus org.kde.kglobalaccel /component/kwin org.kde.kglobalaccel.Component.shortcutNames`.

For Wayland users, a tool similar to `xdotool` in functionality is [ydotool](https://github.com/ReimuNotMoe/ydotool).

```toml
[swipe.commands.three]
up = "qdbus org.kde.kglobalaccel /component/kwin invokeShortcut \"Switch One Desktop Up\""
down = "qdbus org.kde.kglobalaccel /component/kwin invokeShortcut \"Switch One Desktop Down\""
left = "qdbus org.kde.kglobalaccel /component/kwin invokeShortcut \"Switch One Desktop to the Left\""
right = "qdbus org.kde.kglobalaccel /component/kwin invokeShortcut \"Switch One Desktop to the Right\""

[swipe.commands.four]
up = "qdbus org.kde.kglobalaccel /component/kwin invokeShortcut \"Window Maximize\""
down = "qdbus org.kde.kglobalaccel /component/kwin invokeShortcut \"Window Minimize\""
left = "xdotool key alt+Left"
right = "xdotool key alt+Right"
```

### State of the project

- [x] Receiving swipe events from libinput
- [ ] Receiving pinch/zoom events from libinput
- [x] Swipe gesture have trigger treshold
- [x] Receiving pinch/zoom events from libinput
- [x] Support continous pinch
- [ ] Support pinch-and-rotate gestures
- [ ] Receiving rotation events from libinput
- [x] Converting libinput events to motions
- [x] Running commands based on motions
- [x] Refactor code to be up to Release standards, instead of testing-hell


25 changes: 25 additions & 0 deletions assets/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Maintainer: Alex Zaslavsky <alex@wall-dev.org>

pkgname=gebaar-libinput
pkgver=0.1.4
pkgrel=1
pkgdesc='A Super Simple WM Independent Touchpad Gesture Daemon for libinput.'
arch=('x86_64')
url="https://github.com/Coffee2CodeNL/$pkgname"
license=('GPL3')
depends=('libinput')
conflicts=('gebaar')
provides=('gebaar')
source=('https://github.com/Coffee2CodeNL/gebaar-libinput/releases/download/v0.1.4/gebaard'
'https://raw.githubusercontent.com/Coffee2CodeNL/gebaar-libinput/master/LICENSE'
'https://raw.githubusercontent.com/Coffee2CodeNL/gebaar-libinput/master/README.md')
md5sums=('74efb11da5bb1714e114e6305d999186'
'SKIP'
'SKIP')


package() {
install -Dm755 gebaard "$pkgdir/usr/bin/gebaard"
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
install -Dm644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md"
}
42 changes: 42 additions & 0 deletions assets/PKGBUILD.git
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Maintainer: Alex Zaslavsky <alex@wall-dev.org>

pkgname=gebaar-libinput-git
pkgver=r47.07b0ca8
pkgrel=1
pkgdesc='A Super Simple WM Independent Touchpad Gesture Daemon for libinput.'
arch=('x86_64')
url="https://github.com/Coffee2CodeNL/gebaar-libinput"
license=('GPL3')
depends=('libinput')
makedepends=('cmake' 'git')
conflicts=('gebaar')
provides=('gebaar')
source=('git+https://github.com/Coffee2CodeNL/gebaar-libinput')
md5sums=('SKIP')


pkgver() {
cd "$srcdir/gebaar-libinput"
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
cd $srcdir/gebaar-libinput
git submodule init
git submodule update
mkdir -p build && cd build
cmake -DCMAKE_INSTALL_PREFIX="/usr" ..
}

build() {
cd $srcdir/gebaar-libinput/build
make -j$(nproc)
}

package() {
cd $srcdir/gebaar-libinput/build
make DESTDIR="$pkgdir" install/strip
cd ..
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
install -Dm644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md"
}
File renamed without changes.
10 changes: 10 additions & 0 deletions assets/gebaard.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[Unit]
Description=Gebaar Daemon
Documentation=https://github.com/Coffee2CodeNL/gebaar-libinput

[Service]
ExecStart=/usr/local/bin/gebaard
Restart=always

[Install]
WantedBy=multi-user.target
7 changes: 7 additions & 0 deletions build.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM debian:stretch

RUN set -ex; \
echo 'deb http://http.us.debian.org/debian/ testing non-free contrib main' > /etc/apt/sources.list.d/debian-testing.list; \
apt-get update -q; \
apt-get install -y git gcc-8 curl make cmake build-essential libinput-dev zlib1g-dev libinput-tools libsystemd-dev

Loading