comfortable-swipe/install
2017-11-07 01:29:09 +08:00

22 lines
738 B
Bash
Executable File

#!/bin/bash
DIR=$(dirname $0)
#copy config file
mkdir -p ~/.config
DCONF_PATH=$DIR/src/defaults.conf
CONF_PATH=~/.config/comfortable-swipe.conf
if [ ! -f $CONF_PATH ]; then
cat $DCONF_PATH > $CONF_PATH
else
# config file found, ask user if overwrite
echo "Previous conf file found in $CONF_PATH"
read -r -p "Do you want to overwrite? [Y/n] " response
response=${response,,} # tolower
if [[ "$response" =~ ^(yes|y)$ ]]; then
cat $DCONF_PATH > $CONF_PATH
fi
fi
echo "Installing..."
mkdir -p ~/.local/bin
g++ -std=c++11 -O2 $DIR/src/comfortable-swipe.cpp -lxdo -o ~/.local/bin/comfortable-swipe || exec echo "Installation aborted"
echo "Successfully installed. You may now run 'comfortable-swipe start'."