6
6
# and set it as the Exec= line of the .desktop file in the AppImage.
7
7
8
8
# TODO:
9
- # Handle mime types as well
9
+ # Handle icons for mime types as well using xdg-icon-resource
10
10
# 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=
12
12
# See http://specifications.freedesktop.org/thumbnail-spec/thumbnail-spec-latest.html#DELETE
13
13
# Possibly move this to the C runtime that is part of every AppImage?
14
14
114
114
# Determine where the desktop file should be installed
115
115
if [[ $EUID -ne 0 ]]; then
116
116
DESTINATION_DIR_DESKTOP=" $HOME /.local/share/applications"
117
+ SYSTEM_WIDE=" "
117
118
else
118
119
# TODO: Check $XDG_DATA_DIRS
119
120
DESTINATION_DIR_DESKTOP=" /usr/local/share/applications"
121
+ SYSTEM_WIDE=" --mode system" # for xdg-mime and xdg-icon-resource
120
122
fi
121
123
122
124
# Check if the desktop file is already there
@@ -135,8 +137,9 @@ if [ -z "$SKIP" ] ; then
135
137
yesno " Install" " Should a desktop file for $APPIMAGE be installed?"
136
138
fi
137
139
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
139
141
if [ -z " $SKIP " ] ; then
142
+ find ./share/mime/ -type f -name * xml -exec xdg-mime install $SYSTEM_WIDE --novendor {} \;
140
143
# desktop-file-install is supposed to install
141
144
# .desktop files to the user's
142
145
# applications directory when run as a non-root user,
0 commit comments