diff --git a/.gitmodules b/.gitmodules index 1c2462a..92c07ec 100644 --- a/.gitmodules +++ b/.gitmodules @@ -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 diff --git a/.idea/vcs.xml b/.idea/vcs.xml index c2df53a..9c5fe31 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -2,6 +2,7 @@ + \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index dff7a92..81202c5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,11 +1,17 @@ -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) @@ -13,8 +19,9 @@ if (PKG_CONFIG_FOUND) 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) \ No newline at end of file diff --git a/README.md b/README.md index 16f0dbd..713c928 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,81 @@ Gebaar ========= +[![Gitter chat](https://badges.gitter.im/gebaar-libinput/community.png)](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 -![gestures](doc/swipes.png) \ No newline at end of file diff --git a/doc/swipes.png b/doc/swipes.png deleted file mode 100644 index b7b8ff3..0000000 Binary files a/doc/swipes.png and /dev/null differ