Skip to content

Commit

Permalink
Merge pull request #25 from jsmaniac/patch-sudo-install
Browse files Browse the repository at this point in the history
Test need for sudo for copying wayfire.desktop to /usr/share/wayland-sessions
  • Loading branch information
ammen99 authored Mar 8, 2021
2 parents 08ebe7d + ab7b3fc commit 2837e64
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,18 @@ if [ $yn = Y ]; then
$SUDO ninja -C build install
fi

SESSIONS_DIR=/usr/share/wayland-sessions
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 mkdir -p $SESSIONS_DIR
$SUDO_FOR_SESSIONS install -m 644 $BUILDROOT/wayfire.desktop $SESSIONS_DIR
fi

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

0 comments on commit 2837e64

Please sign in to comment.