From a7efce596d52bcdcce271aa0b68b0fbb59490626 Mon Sep 17 00:00:00 2001 From: Olaf Leidinger Date: Wed, 22 May 2013 08:09:59 +0200 Subject: [PATCH] Change default installation to home directory; fix global schema installation --- README.md | 6 +++--- install.sh | 17 ++++++++++++----- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index bebac8b..d060d58 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ -Run install.sh without any arguments to install the extension for all the users. +Run install.sh without any arguments to install the extension into your home directory. -If you want to install the extension only for the current user, run +If you want to install the extension for all users, run -install.sh local +install.sh global instead. diff --git a/install.sh b/install.sh index 04880f5..f131aa6 100755 --- a/install.sh +++ b/install.sh @@ -1,12 +1,16 @@ NAME="TeaTime@oleid.mescharet.de" -if [ "$1" = "local" ] ; then +if [ "$1" != "global" ] ; then INST_DIR="$HOME/.local/share/gnome-shell/extensions/$NAME" SUDO="" + + echo "Installing extension locally..." else INST_DIR="/usr/share/gnome-shell/extensions/$NAME" SUDO="sudo" + echo "Installing extension globally..." + echo "Installing icon" $SUDO cp utilities-teatime.svg /usr/share/icons/hicolor/scalable/apps/ $SUDO gtk-update-icon-cache /usr/share/icons/hicolor/ @@ -14,11 +18,14 @@ fi echo "Installing extension" -glib-compile-schemas schemas $SUDO mkdir -p "$INST_DIR" -$SUDO cp -ax *.js *.json schemas "$INST_DIR" +$SUDO cp *.js *.json "$INST_DIR" -if [ "$1" = "local" ]; then - $SUDO cp *.svg "$INST_DIR" +if [ "$1" != "global" ]; then + $SUDO cp -ax *.svg schemas "$INST_DIR" +else + echo "Installing schema" + $SUDO cp schemas/*.xml /usr/share/glib-2.0/schemas/ && \ + $SUDO glib-compile-schemas /usr/share/glib-2.0/schemas/ 2> /dev/null fi