Reorganize source files (#41)

* Remove unused device and stamp from swipe_impl

* Use constants for regex patterns

* Compile regex outside of buffer function to avoid runtime hiccup

* Optimize reading of config file

* Revert "Optimize reading of config file"

This reverts commit 88b85d3941.

* Improve tokenizing of config file

* Make sentence string static

* Improve README; change default threshold to 20.0

* Add a flag for gesture begin to ignore unneeded update/end

* Pre-compute for square of threshold and scale to lessen computation

* Compare fingers string with only one digit

* Use fgets_unlocked for faster input stream reading

* Don't buffer error stream

* Set some variables to static

* Catch dash symbol before event, remove trimming

* Use const char* for conf_filename

* Fix error in printing help

* Add some test scripts

* Add service module

* Add gesture module

* Add util module

* Add index files

* Decouple header files

* Add licenses in headers

* Move files to lib

* Modify install script

* Update install script
This commit is contained in:
Rico Tiongson authored and GitHub committed 2019-02-07 17:56:58 +08:00
1 parent e3453c1bbb
commit e2e534ea2f
20 files changed
+1042 -463

No files matched your search

+13 -7
View File
@@ -9,8 +9,6 @@ OLD_CONF_PATH=${XDG_CONFIG_HOME:-$HOME/.config}/comfortable-swipe.conf
if [ -x "$(command -v $PROGRAM)" ]; then
# stop any running comfortable-swipe if it exists
$PROGRAM stop
# remove existing comfortable-swipe
rm $(which comfortable-swipe)
fi
#copy config file
@@ -43,11 +41,19 @@ else
fi
fi
fi
echo "Installing..."
# mkdir -p ~/.local/bin
sudo g++ -std=c++11 -O2 $DIR/src/comfortable-swipe.cpp -lxdo -o $PROGRAM || exec echo "Installation aborted"
GROUP=$(ls -l /dev/input/event* | awk '{print $4}' | head --line=1) || abort
echo "Installing..."
# remove existing comfortable-swipe
if [ -x "$(command -v $PROGRAM)" ]; then
sudo rm -f $(which comfortable-swipe)
fi
# compile library
sudo $DIR/src/compile $PROGRAM || abort
# add permissions to input group (defer)
# GROUP=$(ls -l /dev/input/event* | awk '{print $4}' | head --line=1) || abort
# toggle autostart twice to refresh any changes
$PROGRAM autostart > /dev/null || abort
@@ -56,4 +62,4 @@ $PROGRAM autostart > /dev/null || abort
echo "Successfully installed comfortable-swipe."
echo "Configuration file is located at $CONF_PATH"
echo ""
echo "Try running 'comfortable-swipe start' to test."
echo "Try running 'comfortable-swipe start' to test."