Skip to content

Commit 10b84ee

Browse files
committed
Install MIME information
1 parent 75caf13 commit 10b84ee

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

desktopintegration

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
# and set it as the Exec= line of the .desktop file in the AppImage.
77

88
# TODO:
9-
# Handle mime types as well
9+
# Handle icons for mime types as well using xdg-icon-resource
1010
# Handle multiple versions of the same AppImage?
11-
# Handle removed AppImages. Currently we are just setting TryExec=
11+
# Handle removed AppImages? Currently we are just setting TryExec=
1212
# See http://specifications.freedesktop.org/thumbnail-spec/thumbnail-spec-latest.html#DELETE
1313
# Possibly move this to the C runtime that is part of every AppImage?
1414

@@ -114,9 +114,11 @@ fi
114114
# Determine where the desktop file should be installed
115115
if [[ $EUID -ne 0 ]]; then
116116
DESTINATION_DIR_DESKTOP="$HOME/.local/share/applications"
117+
SYSTEM_WIDE=""
117118
else
118119
# TODO: Check $XDG_DATA_DIRS
119120
DESTINATION_DIR_DESKTOP="/usr/local/share/applications"
121+
SYSTEM_WIDE="--mode system" # for xdg-mime and xdg-icon-resource
120122
fi
121123

122124
# Check if the desktop file is already there
@@ -135,8 +137,9 @@ if [ -z "$SKIP" ] ; then
135137
yesno "Install" "Should a desktop file for $APPIMAGE be installed?"
136138
fi
137139

138-
# If the user has agreed, rewrite and install the desktop file
140+
# If the user has agreed, rewrite and install the desktop file, and the MIME information
139141
if [ -z "$SKIP" ] ; then
142+
find ./share/mime/ -type f -name *xml -exec xdg-mime install $SYSTEM_WIDE --novendor {} \;
140143
# desktop-file-install is supposed to install
141144
# .desktop files to the user's
142145
# applications directory when run as a non-root user,

0 commit comments

Comments
 (0)