From dca5265958cf44b4472240b4103f2af968acf97d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Tue, 2 Feb 2016 03:20:29 +0100 Subject: [PATCH] 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 --- debian/control | 1 + qubes-rpc/qubes-open | 8 +++++--- rpm_spec/core-vm.spec | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/debian/control b/debian/control index f054289..16b0f17 100644 --- a/debian/control +++ b/debian/control @@ -46,6 +46,7 @@ Depends: systemd, x11-xserver-utils, xdg-user-dirs, + xdg-utils, xen-utils-common, xenstore-utils, xinit, diff --git a/qubes-rpc/qubes-open b/qubes-rpc/qubes-open index 1c13b42..4722fe6 100644 --- a/qubes-rpc/qubes-open +++ b/qubes-rpc/qubes-open @@ -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 "$@" diff --git a/rpm_spec/core-vm.spec b/rpm_spec/core-vm.spec index 065efe1..7a32bfc 100644 --- a/rpm_spec/core-vm.spec +++ b/rpm_spec/core-vm.spec @@ -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