qubes-open: switch from mimeopen to xdg-open

xdg-open is more robust in choosing default application for particular
file type: it supports fallback if the preferred application isn't
working, and most importantly it support system-wide defaults
(/usr/share/applications/defaults.list,
 /usr/share/applications/mimeapps.list), so no "random" application is
chosen.

By default xdg-open tries to use environment-specific tool, like
gvfs-open - which isn't good for us, because many such tools do not wait
for editor/viewer termination. That would mean that DisposableVM would
be destroyed just after opening the file.
To avoid such effect, we set DE=generic.

Fixes QubesOS/qubes-issues#1621
This commit is contained in:
Marek Marczykowski-Górecki 2016-02-02 03:20:29 +01:00
parent 0211ea5d1d
commit dca5265958
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724
3 changed files with 7 additions and 4 deletions

1
debian/control vendored
View File

@ -46,6 +46,7 @@ Depends:
systemd,
x11-xserver-utils,
xdg-user-dirs,
xdg-utils,
xen-utils-common,
xenstore-utils,
xinit,

View File

@ -4,6 +4,8 @@ if [ -r /etc/profile.d/qubes-session.sh ]; then
. /etc/profile.d/qubes-session.sh
fi
MIMEINFO_DATABASES="/usr/share/mime:/usr/local/share/mime:$HOME/.local/share/mime:/usr/share/qubes/mime-override"
exec mimeopen -n --database "$MIMEINFO_DATABASES" "$@"
# gvfs-open, kde-open, and possibly others don't wait for editor to be
# closed, which is critical behaviour for DisposableVM (which gets destroyed
# after this process exits)
export DE=generic
exec xdg-open "$@"

View File

@ -41,7 +41,7 @@ Requires: NetworkManager >= 0.8.1-1
# Fedora >= 18 defaults to firewalld, which isn't supported nor needed by Qubes
Conflicts: firewalld
%endif
Requires: /usr/bin/mimeopen
Requires: xdg-utils
Requires: ethtool
Requires: tinyproxy
Requires: ntpdate