diff --git a/install b/install index 3b1cd86..cb0928e 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 @@ -44,8 +42,11 @@ else 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" +# remove existing comfortable-swipe +if [ -x "$(command -v $PROGRAM)" ]; then + sudo rm -f $(which comfortable-swipe) +fi +sudo $DIR/src/compile $PROGRAM || abort GROUP=$(ls -l /dev/input/event* | awk '{print $4}' | head --line=1) || abort diff --git a/src/compile b/src/compile new file mode 100755 index 0000000..d426b80 --- /dev/null +++ b/src/compile @@ -0,0 +1,2 @@ +#!/bin/sh +g++ $(dirname $0)/main.cpp -std=c++11 -O2 -lxdo -Wno-unused-result -o $1 diff --git a/src/lib/service/start.cpp b/src/lib/service/start.cpp index 82b8b32..61996fc 100644 --- a/src/lib/service/start.cpp +++ b/src/lib/service/start.cpp @@ -29,7 +29,7 @@ namespace comfortable_swipe::service */ void start() { - std::system("stdbuf -oL -e0 libinput debug-events | " __COMFORTABLE_SWIPE__PROGRAM__ " buffer"); + (void) std::system("stdbuf -oL -e0 libinput debug-events | " __COMFORTABLE_SWIPE__PROGRAM__ " buffer"); } } diff --git a/src/lib/service/stop.cpp b/src/lib/service/stop.cpp index 68bc025..655a6d2 100644 --- a/src/lib/service/stop.cpp +++ b/src/lib/service/stop.cpp @@ -61,7 +61,7 @@ namespace comfortable_swipe::service } // run "kill {pid1} {pid2}..." - std::system(kill.data()); + (void) std::system(kill.data()); delete[] buffer; // close the pipe