File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -181,12 +181,16 @@ if [ $yn = Y ]; then
181181fi
182182
183183SESSIONS_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
184188ask_confirmation " Do you want to install wayfire.desktop to $SESSIONS_DIR / [y/n]? "
185189if [ $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
190194fi
191195
192196echo " Installation done. Run $PREFIX /bin/startwayfire to start wayfire."
You can’t perform that action at this time.
0 commit comments