Skip to content

Commit c3675a8

Browse files
committed
Linux: fix icon permissions if installed via sudo
1 parent 6b770d0 commit c3675a8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Diff for: build/linux/dist/install.sh

+7
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ xdg_install_f() {
6666
# Make Arduino IDE the default application for *.ino
6767
xdg-mime default ${RESOURCE_NAME}.desktop text/x-arduino
6868

69+
if [ x${SUDO_USER} != x ]; then
70+
chown ${SUDO_USER} "${XDG_DESKTOP_DIR}/${RESOURCE_NAME}.desktop"
71+
fi
72+
6973
# Add symlink for arduino so it's in users path
7074
echo "" # Ensure password request message is on new line
7175
if ! ln -s ${SCRIPT_PATH}/arduino /usr/local/bin/arduino; then
@@ -102,6 +106,9 @@ simple_install_f() {
102106
cp "${TMP_DIR}/${RESOURCE_NAME}.desktop" "${XDG_DESKTOP_DIR}/"
103107
# Altering file permissions to avoid "Untrusted Application Launcher" error on Ubuntu
104108
chmod u+x "${XDG_DESKTOP_DIR}/${RESOURCE_NAME}.desktop"
109+
if [ x${SUDO_USER} != x ]; then
110+
chown ${SUDO_USER} "${XDG_DESKTOP_DIR}/${RESOURCE_NAME}.desktop"
111+
fi
105112
fi
106113

107114
# Add symlink for arduino so it's in users path

0 commit comments

Comments
 (0)