-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
82 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[submodule "libs/cxxopts"] | ||
path = libs/cxxopts | ||
url = git@github.com:jarro2783/cxxopts.git | ||
url = https://github.com/jarro2783/cxxopts | ||
[submodule "libs/cpptoml"] | ||
path = libs/cpptoml | ||
url = git@github.com:skystrife/cpptoml.git | ||
url = https://github.com/skystrife/cpptoml |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,27 @@ | ||
cmake_minimum_required(VERSION 3.13) | ||
cmake_minimum_required(VERSION 3.12.1) | ||
project(gebaar) | ||
set(CMAKE_VERBOSE_MAKEFILE on) | ||
set(CMAKE_EXPORT_COMPILE_COMMANDS on) | ||
set(CMAKE_CXX_STANDARD 17) | ||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/") | ||
|
||
add_executable(gebaard src/main.cpp src/io/input.cpp src/io/input.h src/config/config.cpp src/config/config.h src/daemonizer.cpp src/daemonizer.h) | ||
add_executable(gebaard | ||
src/main.cpp | ||
src/io/input.cpp | ||
src/io/input.h | ||
src/config/config.cpp | ||
src/config/config.h | ||
src/daemonizer.cpp | ||
src/daemonizer.h) | ||
|
||
find_package(PkgConfig) | ||
if (PKG_CONFIG_FOUND) | ||
pkg_search_module(LIBINPUT REQUIRED libinput) | ||
endif () | ||
|
||
find_package(udev) | ||
find_package(spdlog) | ||
|
||
target_link_libraries(gebaard ${LIBINPUT_LIBRARIES} ${UDEV_LIBRARIES} stdc++fs) | ||
target_include_directories(gebaard PUBLIC ${LIBINPUT_INCLUDE_DIRS} ${UDEV_INCLUDE_DIRS} libs/cxxopts/include libs/cpptoml/include) | ||
target_compile_options(gebaard PUBLIC ${LIBINPUT_CFLAGS_OTHER} ${UDEV_CFLAGS_OTHER}) | ||
|
||
install(TARGETS gebaard DESTINATION bin) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,81 @@ | ||
Gebaar | ||
========= | ||
[](https://gitter.im/gebaar-libinput/community) | ||
|
||
WM Independent Gesture Daemon for libinput | ||
WM Independent Touchpad Gesture Daemon for libinput | ||
|
||
_Gebaar means Gesture in Dutch_ | ||
|
||
Run any command by simply gesturing on your touchpad! | ||
|
||
### What makes this different over the other implementations? | ||
|
||
[libinput-gestures](https://github.com/bulletmark/libinput-gestures) and [fusuma](https://github.com/iberianpig/fusuma) both parse the output of the shell command `libinput debug-events` which is an unstable API and the output just keeps coming, so it'll eat (some) RAM. | ||
|
||
Gebaar directly interfaces with libinput to receive and react to the events. | ||
This is more stable, faster, and more efficient as it **does not parse the output of a program** like the aforementioned projects do. | ||
|
||
|
||
### How to build and install | ||
|
||
1. Clone the repository via `git clone https://github.com/Coffee2CodeNL/gebaar-libinput` | ||
2. Check out the latest version (`git checkout v0.0.1`) | ||
3. Run `git submodule update --init` in the root folder | ||
4. Run `mkdir build && cd build` | ||
5. Run `cmake ..` | ||
6. Run `make -j$(nproc)` | ||
7. Run `sudo make install` to install | ||
8. Run `mkdir -p ~/.config/gebaar` | ||
9. Run `nano ~/.config/gebaar/gebaard.toml` (or vim, if you like it better) | ||
10. Add the snippet below to `gebaard.toml` | ||
11. Configure commands to run per direction | ||
12. Add yourself to the `input` group with `usermod -a -G input $USER` | ||
13. Run Gebaar via some startup file by adding `gebaard -b` to it | ||
14. Reboot and see the magic | ||
|
||
```toml | ||
[commands.swipe.three] | ||
up = "" | ||
down = "" | ||
left = "" | ||
right = "" | ||
|
||
[commands.swipe.four] | ||
up = "" | ||
down = "" | ||
left = "" | ||
right = "" | ||
``` | ||
|
||
|
||
|
||
### Examples | ||
|
||
**bspwm** | ||
|
||
_~/.config/gebaar/gebaard.toml_ | ||
```toml | ||
[commands.swipe.three] | ||
up = "bspc node -f north" | ||
down = "bspc node -f south" | ||
left = "bspc node -f west" | ||
right = "bspc node -f east" | ||
|
||
[commands.swipe.four] | ||
up = "rofi -show combi" | ||
down = "" | ||
left = "bspc desktop -f prev" | ||
right = "bspc desktop -f next" | ||
``` | ||
|
||
Add `gebaard -b` to `~/.config/bspwm/bspwmrc` | ||
|
||
### State of the project | ||
|
||
- [x] Receiving swipe events from libinput | ||
- [ ] Receiving pinch/zoom events from libinput | ||
- [ ] Receiving rotation events from libinput | ||
- [x] Converting libinput events to motions | ||
- [ ] Running commands based on motions | ||
- [ ] Refactor code to be up to Release standards, instead of testing-hell | ||
|
||
### Screenshots of debug/testing output | ||
- [x] Running commands based on motions | ||
- [x] Refactor code to be up to Release standards, instead of testing-hell | ||
|
||
 |
Binary file not shown.