File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -180,13 +180,18 @@ if [ $yn = Y ]; then
180180 $SUDO ninja -C build install
181181fi
182182
183- SESSIONS_DIR=/usr/share/wayland-sessions
183+ 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
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 mkdir -p $SESSIONS_DIR
194+ $SUDO_FOR_SESSIONS install -m 644 $BUILDROOT /wayfire.desktop $SESSIONS_DIR
190195fi
191196
192197echo " Installation done. Run $PREFIX /bin/startwayfire to start wayfire."
You can’t perform that action at this time.
0 commit comments