diff --git a/README.md b/README.md index fdf241e..bebac8b 100644 --- a/README.md +++ b/README.md @@ -1 +1,7 @@ -Run install.sh to install the icon for all the users. +Run install.sh without any arguments to install the extension for all the users. + +If you want to install the extension only for the current user, run + +install.sh local + +instead. diff --git a/install.sh b/install.sh index 65a5fab..847d396 100755 --- a/install.sh +++ b/install.sh @@ -1,11 +1,23 @@ NAME="TeaTime@oleid.mescharet.de" -INST_DIR="$HOME/.local/share/gnome-shell-extensions/$NAME" -echo "Installing icon" -sudo cp utilities-teatime.svg /usr/share/icons/hicolor/scalable/apps/ -sudo gtk-update-icon-cache /usr/share/icons/hicolor/ +if [ "$1" = "local" ] ; then + INST_DIR="$HOME/.local/gnome-shell/extensions/$NAME" + SUDO="" +else + INST_DIR="/usr/share/gnome-shell/extensions/$NAME" + SUDO="sudo" + + echo "Installing icon" + $SUDO cp utilities-teatime.svg /usr/share/icons/hicolor/scalable/apps/ + $SUDO gtk-update-icon-cache /usr/share/icons/hicolor/ +fi + echo "Installing extension" -mkdir -p "$INST_DIR" +$SUDO mkdir -p "$INST_DIR" -cp *.js *.json "$INST_DIR" +$SUDO cp *.js *.json "$INST_DIR" + +if [ "$1" = "local" ]; then + $SUDO cp *.svg "$INST_DIR" +fi