commit 5e9ee59e7a07e7b65f8400e9dbdb28a9809faccd
parent 08ebe7d3934169cf6ee6de15ebbb85269a2edb12
Author: Suzanne Soy <ligo@suzanne.soy>
Date: Sun, 7 Mar 2021 17:52:04 +0000
Test need for sudo for copying wayfire.desktop to /usr/share/wayland-sessions independently from the rest of the installation to $PREFIX
Diffstat:
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/install.sh b/install.sh
@@ -181,12 +181,16 @@ if [ $yn = Y ]; then
fi
SESSIONS_DIR=/usr/share/wayland-sessions
+SUDO_FOR_SESSIONS=sudo
+if [ -w $SESSIONS_DIR ] || ! which sudo > /dev/null; then
+ SUDO_FOR_SESSIONS=
+fi
ask_confirmation "Do you want to install wayfire.desktop to $SESSIONS_DIR/ [y/n]? "
if [ $yn = Y ]; then
cp $BUILDROOT/wayfire.desktop.in $BUILDROOT/wayfire.desktop
sed -i "s@^Exec.*@Exec=$PREFIX/bin/startwayfire@g" $BUILDROOT/wayfire.desktop
sed -i "s@^Icon.*@Icon=$PREFIX/share/wayfire/icons/wayfire.png@g" $BUILDROOT/wayfire.desktop
- $SUDO install -m 644 $BUILDROOT/wayfire.desktop $SESSIONS_DIR
+ $SUDO_FOR_SESSIONS install -m 644 $BUILDROOT/wayfire.desktop $SESSIONS_DIR
fi
echo "Installation done. Run $PREFIX/bin/startwayfire to start wayfire."