Skip to content

Commit

Permalink
add custom install path support
Browse files Browse the repository at this point in the history
  • Loading branch information
cunidev committed May 5, 2018
1 parent 8bd027f commit 3526032
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
A minimal Gtk+ GUI app for libinput-gestures

Use:
- `sudo ./install.sh` to install in /opt/gestures
- `./make.sh; sudo ./install.sh` to install in /usr/local/bin. An alternative path for the binary can be specified as parameter to `install.sh`


## Video demo:
Expand Down
21 changes: 17 additions & 4 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
./make.sh
if ! [ $(id -u) = 0 ]; then
echo "This script must be run as root!"
exit -1
fi

mkdir /opt/gestures
cp ./build/gestures /opt/gestures/
sed -e 's/\/usr\/bin/\/opt\/gestures/g' -i ./build/org.cunidev.gestures.desktop
INSTALL="/usr/local/bin"

if [ -z "$1" ]
then
echo "Notice: Using default install path ($INSTALL)"
else
INSTALL=$1
fi

cp ./build/gestures $INSTALL/gestures
sed -e 's~/usr/bin~$INSTALL~g' -i ./build/org.cunidev.gestures.desktop
cp ./build/org.cunidev.gestures.desktop /usr/share/applications/
cp ./data/org.cunidev.gestures.svg /usr/share/icons/hicolor/scalable/apps

echo "Installed to $INSTALL/gestures!"
3 changes: 1 addition & 2 deletions make.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
if [[ $EUID = 0 ]]; then
if [ $(id -u) = 0 ]; then
echo "Warning: This script shouldn't be run as root!"
echo
fi

rm -rf build
Expand Down

0 comments on commit 3526032

Please sign in to comment.