From 5e9ee59e7a07e7b65f8400e9dbdb28a9809faccd Mon Sep 17 00:00:00 2001 From: Suzanne Soy Date: Sun, 7 Mar 2021 17:52:04 +0000 Subject: [PATCH 1/3] Test need for sudo for copying wayfire.desktop to /usr/share/wayland-sessions independently from the rest of the installation to $PREFIX --- install.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 597e3ee..1e614de 100755 --- 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." From aa10d5aa8c8b36d78ab595abfd0bf4f199164bbc Mon Sep 17 00:00:00 2001 From: Suzanne Soy Date: Mon, 8 Mar 2021 03:57:01 +0000 Subject: [PATCH 2/3] Create /usr/share/wayland-sessions/ if it does not exist --- install.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 1e614de..c5a45c7 100755 --- a/install.sh +++ b/install.sh @@ -180,7 +180,7 @@ 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= @@ -190,6 +190,7 @@ 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 mkdir -p $SESSIONS_DIR $SUDO_FOR_SESSIONS install -m 644 $BUILDROOT/wayfire.desktop $SESSIONS_DIR fi From ab7b3fc2ebd24aeb90bb075c1e274f35676a4b56 Mon Sep 17 00:00:00 2001 From: Suzanne Soy Date: Mon, 8 Mar 2021 16:22:28 +0000 Subject: [PATCH 3/3] PR review --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index c5a45c7..06771f3 100755 --- a/install.sh +++ b/install.sh @@ -190,7 +190,7 @@ 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 mkdir -p $SESSIONS_DIR + $SUDO_FOR_SESSIONS mkdir -p $SESSIONS_DIR $SUDO_FOR_SESSIONS install -m 644 $BUILDROOT/wayfire.desktop $SESSIONS_DIR fi