Skip to content

Commit 5e9ee59

Browse files
author
Suzanne Soy
committed
Test need for sudo for copying wayfire.desktop to /usr/share/wayland-sessions independently from the rest of the installation to $PREFIX
1 parent 08ebe7d commit 5e9ee59

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

install.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,12 +181,16 @@ if [ $yn = Y ]; then
181181
fi
182182

183183
SESSIONS_DIR=/usr/share/wayland-sessions
184+
SUDO_FOR_SESSIONS=sudo
185+
if [ -w $SESSIONS_DIR ] || ! which sudo > /dev/null; then
186+
SUDO_FOR_SESSIONS=
187+
fi
184188
ask_confirmation "Do you want to install wayfire.desktop to $SESSIONS_DIR/ [y/n]? "
185189
if [ $yn = Y ]; then
186190
cp $BUILDROOT/wayfire.desktop.in $BUILDROOT/wayfire.desktop
187191
sed -i "s@^Exec.*@Exec=$PREFIX/bin/startwayfire@g" $BUILDROOT/wayfire.desktop
188192
sed -i "s@^Icon.*@Icon=$PREFIX/share/wayfire/icons/wayfire.png@g" $BUILDROOT/wayfire.desktop
189-
$SUDO install -m 644 $BUILDROOT/wayfire.desktop $SESSIONS_DIR
193+
$SUDO_FOR_SESSIONS install -m 644 $BUILDROOT/wayfire.desktop $SESSIONS_DIR
190194
fi
191195

192196
echo "Installation done. Run $PREFIX/bin/startwayfire to start wayfire."

0 commit comments

Comments
 (0)