Modify install script
This commit is contained in:
parent
fbe40b7b24
commit
1d20d3801f
9
install
9
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
|
||||
|
||||
|
||||
2
src/compile
Executable file
2
src/compile
Executable file
@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
g++ $(dirname $0)/main.cpp -std=c++11 -O2 -lxdo -Wno-unused-result -o $1
|
||||
@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user