diff options
| author | Glenn Smith <glenn@vector35.com> | 2024-07-12 13:46:36 -0400 |
|---|---|---|
| committer | Glenn Smith <glenn@vector35.com> | 2024-10-24 16:34:40 -0400 |
| commit | 3579403656917523013894285798585079785251 (patch) | |
| tree | 861a9840f9a32b80e6eda912cd8577514723231f /scripts | |
| parent | 3c135476da081b47cfa4367ab722ce4973836186 (diff) | |
Fix linux-setup.sh not making a valid desktop icon on 24.04
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/linux-setup.sh | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/scripts/linux-setup.sh b/scripts/linux-setup.sh index 4037a419..0bdf95ad 100755 --- a/scripts/linux-setup.sh +++ b/scripts/linux-setup.sh @@ -100,11 +100,17 @@ application/x-sharedlib=${APP}.desktop EOF echo "${DESKTOP}" | $SUDO tee ${DESKTOPFILE} >/dev/null echo "${MIMEAPPS}" | $SUDO tee -a ${MIMEFILE} >/dev/null - $SUDO chmod +x ${DESKTOPFILE} if [ -f ${OLDDESKTOPFILE} ] then rm ${OLDDESKTOPFILE} fi + settrusted "${DESKTOPFILE}" + $SUDO update-desktop-database ${SHARE}/applications +} + +settrusted() +{ + $SUDO chmod +x "$1" GNOMEVERSION=`gnome-shell --version|awk '{print $3}'` MINVERSION=3.36 # This check is dumb. Thanks Gnome for not only imitating the worst @@ -119,8 +125,11 @@ EOF 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 + DBUS_LAUNCH=dbus-launch + if ! (which dbus-launch > /dev/null); then + DBUS_LAUNCH="" + fi + $SUDO $DBUS_LAUNCH gio set "$1" "metadata::trusted" $DBFLAG } createmime() @@ -153,6 +162,7 @@ createmime() addtodesktop() { cp "$DESKTOPFILE" "${HOME}/Desktop/${APP}.desktop" + settrusted "${HOME}/Desktop/${APP}.desktop" } uninstall() |
