summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorJordan Wiens <jordan@psifertex.com>2020-10-05 13:15:06 -0400
committerJordan Wiens <jordan@psifertex.com>2020-10-05 13:15:06 -0400
commit0e10983e83fbd5980aa4d2aed06057c3676bf402 (patch)
tree8b0523849991a203f094bac950ddf15bec391245 /scripts
parent9d56b84108d9ff110727e431766ee29669aee0a9 (diff)
fix desktop icon creation
Diffstat (limited to 'scripts')
-rw-r--r--scripts/linux-setup.sh19
1 files changed, 17 insertions, 2 deletions
diff --git a/scripts/linux-setup.sh b/scripts/linux-setup.sh
index 3c0d58f1..6f4575d7 100644
--- a/scripts/linux-setup.sh
+++ b/scripts/linux-setup.sh
@@ -90,9 +90,9 @@ createdesktopfile()
read -d '' DESKTOP << EOF
[Desktop Entry]
Name=${APP}
-Exec=${EXEC// /\s} %u
+Exec=${EXEC// /\\\\ } %u
MimeType=application/x-${APP};x-scheme-handler/${APP};
-Icon=${PNG// /\s}
+Icon=${PNG// /\\\\s}
Terminal=false
Type=Application
Categories=Utility;
@@ -107,6 +107,21 @@ EOF
echo "${DESKTOP}" | $SUDO tee ${DESKTOPFILE} >/dev/null
echo "${MIMEAPPS}" | $SUDO tee -a ${MIMEFILE} >/dev/null
$SUDO chmod +x ${DESKTOPFILE}
+ GNOMEVERSION=`gnome-shell --version|awk '{print $3}'`
+ MINVERSION=3.36
+ # This check is dumb. Thanks Gnome for not only imitating the worst
+ # permission models of MacOS and Windows but doing it in a way that isn't
+ # even consistent between adjacent LTS versions :facepalm: Note that a
+ # reboot or reload of Gnome is required but I'm not going to do it here
+ # because the experience is poor.
+ if [ $(echo -en "$GNOMEVERSION\n$MINVERSION" | sort -t '.' -k 1,1 -k 2,2 -k 3,3 -g | tail -n1) != $MINVERSION ]
+ then
+ DBFLAG="true"
+ else
+ DBFLAG="yes"
+ fi
+ echo -e "\n\nWARNING: Note that the desktop icon that was created may not be usable until you login again or reboot depending on your GNOME version.\n"
+ $SUDO dbus-launch gio set "${DESKTOPFILE}" "metadata::trusted" $DBFLAG
$SUDO update-desktop-database ${SHARE}/applications
}