[config] Change program location from ~/.local/bin to /usr/local/bin

This commit is contained in:
Rico Tiongson 2017-11-11 13:54:27 +08:00
parent a57f7f50e3
commit 49a7eb4591
3 changed files with 7 additions and 4 deletions

View File

@ -1,10 +1,12 @@
#!/bin/bash #!/bin/bash
DIR=$(dirname $0) DIR=$(dirname $0)
PROGRAM=$HOME/.local/bin/comfortable-swipe PROGRAM=/usr/local/bin/comfortable-swipe
if [ -x "$(command -v $PROGRAM)" ]; then if [ -x "$(command -v $PROGRAM)" ]; then
# stop any running comfortable-swipe if it exists # stop any running comfortable-swipe if it exists
$PROGRAM stop $PROGRAM stop
# remove existing comfortable-swipe
rm $(which comfortable-swipe)
fi fi
#copy config file #copy config file
@ -29,7 +31,7 @@ else
fi fi
fi fi
echo "Installing..." echo "Installing..."
mkdir -p ~/.local/bin # mkdir -p ~/.local/bin
g++ -std=c++11 -O2 $DIR/src/comfortable-swipe.cpp -lxdo -o $PROGRAM || exec echo "Installation aborted" g++ -std=c++11 -O2 $DIR/src/comfortable-swipe.cpp -lxdo -o $PROGRAM || exec echo "Installation aborted"
# toggle autostart twice to refresh any changes # toggle autostart twice to refresh any changes

View File

@ -31,7 +31,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <ctime> #include <ctime>
#include <unistd.h> #include <unistd.h>
#define cstr const string& #define cstr const string&
#define PROGRAM "$HOME/.local/bin/comfortable-swipe" #define PROGRAM "/usr/local/bin/comfortable-swipe"
using namespace std; using namespace std;
extern "C" { extern "C" {

View File

@ -2,5 +2,6 @@
echo "Uninstalling..." echo "Uninstalling..."
rm ${XDG_CONFIG_HOME:-$HOME/.config}/autostart/comfortable-swipe.desktop 2> /dev/null rm ${XDG_CONFIG_HOME:-$HOME/.config}/autostart/comfortable-swipe.desktop 2> /dev/null
comfortable-swipe stop 2> /dev/null comfortable-swipe stop 2> /dev/null
rm $HOME/.local/bin/comfortable-swipe 2> /dev/null rm $HOME/.local/bin/comfortable-swipe 2> /dev/null # compat
rm /usr/local/bin/comfortable-swipe 2> /dev/null
echo "Successfully uninstalled comfortable-swipe" echo "Successfully uninstalled comfortable-swipe"