Skip to content

Commit

Permalink
Release v0.0.5 (#18)
Browse files Browse the repository at this point in the history
* Update README.md to reflect version bump

* Update to README.md, new shields

Added AUR Package shield
Changed gitter.im shield

* Added support for oblique gesture swipes.

To add the support the config class was modified to include the new
gestures types: left_up, right_up, left_down, right_down.
Also changed the way the commands are saved in the config class, so
there won't be a need for a lot of if statements to handle 4 finger
swipes and 3 finger swipes.
Finally, the handle_swipe_event_without_coords was modified to detect
the oblique swipes.

* Commenting the code a bit and some minor cosmetic and semantic changes

- Added comments to each function
- Increased string array size to 10 in config.h even though we only need 9 slots, I'm being a bit pedantic about this
- Adding some build flags to CMakeLists.txt to show every error, preferably we'd get clean output eventually
- Renamed find_gesture_device to gesture_device_exists in Input class
- Renamed find_config_file to config_file_exists as this actually describes the logic of this function in Config class
- Renamed find_home_folder to find_config_file in Config class in preparation to adding /etc/gebaar/gebaard.toml to list of possible config file locations

* Prepare for release by bumping up version in README.md

* Let warnings be warnings, release v0.0.4

* Goodbye Gitter, Hello Discord.

* Fix config location (#13)

If XDG_CONFIG_HOME is set, .config will be appended a second time
resulting in /home/example/.config/.config/gebaar/gebaard.toml

This is fixed by only appending .config, when the HOME directory
workaround is used.

Fixes #12

* Fix nullptr conversion to std::string (#16)

Instead of using the result of getenv directly, we must check first, if
getenv returned a nullptr, otherwise the program will crash.

Regression from 41c7c05

* Add the build directory to gitignore (#15)

The README build instructions use this directory.

* Add a desktop file (#14)

Users can copy this desktop file to $XDG_CONFIG_HOME/autostart to enable
autostart on most desktop environments.
  • Loading branch information
Coffee2CodeNL authored Mar 27, 2019
1 parent ca51681 commit 2c6f74a
Show file tree
Hide file tree
Showing 7 changed files with 84 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ cmake_install.cmake
install_manifest.txt
compile_commands.json
CTestTestfile.cmake
/build/*
### C template
# Prerequisites
*.d
Expand Down
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ add_executable(gebaard
src/config/config.cpp
src/config/config.h
src/daemonizer.cpp
src/daemonizer.h)
src/daemonizer.h
src/util.cpp
src/util.h)

find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
Gebaar
=========
[![](https://img.shields.io/gitter/room/gebaar-libinput/community.svg?style=flat)](https://gitter.im/gebaar-libinput/community)

WM Independent Touchpad Gesture Daemon for libinput

Expand All @@ -15,6 +14,9 @@ Run any command by simply gesturing on your touchpad!
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.

### Getting support (or talking about the project's future)

Click to join: [![Discord](https://img.shields.io/discord/548978799136473106.svg?label=Discord)](https://discord.gg/9mbKhFR)

### How to build and install

Expand Down
8 changes: 8 additions & 0 deletions gebaar-libinput.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[Desktop Entry]
Name=gebaar-libinput
Comment=Touchpad Gesture Daemon for libinput
Exec=/usr/bin/gebaard -b
StartupNotify=false
Terminal=false
Type=Application
X-GNOME-Autostart-enabled=true
19 changes: 12 additions & 7 deletions src/config/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#include <zconf.h>
#include "config.h"
#include "../util.h"

/**
* Check if config file exists at current path
Expand Down Expand Up @@ -68,17 +69,21 @@ void gebaar::config::Config::load_config()
*/
bool gebaar::config::Config::find_config_file()
{
const char* temp_path;
temp_path = getenv("XDG_CONFIG_HOME");
if (temp_path==nullptr) {
temp_path = getenv("HOME");
if (temp_path==nullptr) {
std::string temp_path = gebaar::util::stringFromCharArray(getenv("XDG_CONFIG_HOME"));
if (temp_path.empty()) {
// first get the path to HOME
temp_path = gebaar::util::stringFromCharArray(getenv("HOME"));
if (temp_path.empty()) {
temp_path = getpwuid(getuid())->pw_dir;
}
// then append .config
if (!temp_path.empty()) {
temp_path.append("/.config");
}
}
if (temp_path!=nullptr) {
if (!temp_path.empty()) {
config_file_path = temp_path;
config_file_path.append("/.config/gebaar/gebaard.toml");
config_file_path.append("/gebaar/gebaard.toml");
return true;
}
return false;
Expand Down
29 changes: 29 additions & 0 deletions src/util.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
gebaar
Copyright (C) 2019 coffee2code
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include "util.h"

/**
* @brief Safely converts a char array to a std::string
* @param charArr The char array to convert
* @return charArr or an empty string, if charArr is a nullptr
*/
std::string gebaar::util::stringFromCharArray(char* charArr)
{
return charArr == nullptr ? "" : charArr;
}
28 changes: 28 additions & 0 deletions src/util.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
gebaar
Copyright (C) 2019 coffee2code
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef UTIL_H
#define UTIL_H

#include <string>

namespace gebaar::util {
std::string stringFromCharArray(char* charArr);
}

#endif // UTIL_H

0 comments on commit 2c6f74a

Please sign in to comment.