From c3675a8befbc9d76850a0e986e6b0da0b8b43084 Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Thu, 18 Apr 2019 11:52:59 +0200 Subject: [PATCH] Linux: fix icon permissions if installed via sudo --- build/linux/dist/install.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/build/linux/dist/install.sh b/build/linux/dist/install.sh index e02d0d6c4..17c2b090f 100755 --- a/build/linux/dist/install.sh +++ b/build/linux/dist/install.sh @@ -66,6 +66,10 @@ xdg_install_f() { # Make Arduino IDE the default application for *.ino xdg-mime default ${RESOURCE_NAME}.desktop text/x-arduino + if [ x${SUDO_USER} != x ]; then + chown ${SUDO_USER} "${XDG_DESKTOP_DIR}/${RESOURCE_NAME}.desktop" + fi + # Add symlink for arduino so it's in users path echo "" # Ensure password request message is on new line if ! ln -s ${SCRIPT_PATH}/arduino /usr/local/bin/arduino; then @@ -102,6 +106,9 @@ simple_install_f() { cp "${TMP_DIR}/${RESOURCE_NAME}.desktop" "${XDG_DESKTOP_DIR}/" # Altering file permissions to avoid "Untrusted Application Launcher" error on Ubuntu chmod u+x "${XDG_DESKTOP_DIR}/${RESOURCE_NAME}.desktop" + if [ x${SUDO_USER} != x ]; then + chown ${SUDO_USER} "${XDG_DESKTOP_DIR}/${RESOURCE_NAME}.desktop" + fi fi # Add symlink for arduino so it's in users path