diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..4753a05
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+# C++ generated headers
+*.gch
diff --git a/install b/install
index 3b1cd86..d81d328 100755
--- a/install
+++ b/install
@@ -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."
\ No newline at end of file
+echo "Try running 'comfortable-swipe start' to test."
diff --git a/src/comfortable-swipe.cpp b/src/comfortable-swipe.cpp
deleted file mode 100644
index 18203a1..0000000
--- a/src/comfortable-swipe.cpp
+++ /dev/null
@@ -1,17 +0,0 @@
-#include "comfortable-swipe.hpp"
-/* MAIN DRIVER FUNCTION */
-
-int main(int argc, char** args) {
- if (argc > 1) {
- string arg = args[1];
- // select based on argument
- if (arg == "start") service::start();
- else if (arg == "stop") service::stop();
- else if (arg == "restart") service::restart();
- else if (arg == "buffer") service::buffer();
- else if (arg == "autostart") service::autostart();
- else service::help();
- } else {
- service::help();
- }
-}
diff --git a/src/comfortable-swipe.hpp b/src/comfortable-swipe.hpp
deleted file mode 100644
index 9b87052..0000000
--- a/src/comfortable-swipe.hpp
+++ /dev/null
@@ -1,439 +0,0 @@
-/*
-Comfortable Swipe
-by Rico Tiongson
-
-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 .
-*/
-
-#include
-#include
-#include
-#include