diff --git a/Makefile b/Makefile index cb73fd8..dd76e2a 100644 --- a/Makefile +++ b/Makefile @@ -76,6 +76,8 @@ install-vm: install -D -m 0644 misc/qubes-trigger-sync-appmenus.action $(DESTDIR)/etc/yum/post-actions/qubes-trigger-sync-appmenus.action install -D misc/polkit-1-qubes-allow-all.pkla $(DESTDIR)/etc/polkit-1/localauthority/50-local.d/qubes-allow-all.pkla install -D misc/polkit-1-qubes-allow-all.rules $(DESTDIR)/etc/polkit-1/rules.d/00-qubes-allow-all.rules + install -D -m 0644 misc/mime-globs $(DESTDIR)/usr/share/qubes/mime-override/globs + mkdir -p $(DESTDIR)/usr/lib/qubes if [ -r misc/dispvm-dotfiles.$(DIST).tbz ] ; \ diff --git a/misc/mime-globs b/misc/mime-globs new file mode 100644 index 0000000..2bc7b9d --- /dev/null +++ b/misc/mime-globs @@ -0,0 +1 @@ +image/png:*.png diff --git a/qubes-rpc/vm-file-editor.c b/qubes-rpc/vm-file-editor.c index a4e53df..657d87c 100644 --- a/qubes-rpc/vm-file-editor.c +++ b/qubes-rpc/vm-file-editor.c @@ -8,6 +8,9 @@ #include #include "dvm2.h" +#define USER_HOME "/home/user" +#define MIMEINFO_DATABASES "/usr/share/mime:/usr/local/share:" USER_HOME "/.local/share:/usr/share/qubes/mime-override" + char *gettime() { static char retbuf[60]; @@ -130,9 +133,10 @@ main() dup2(log_fd, 1); close(log_fd); - setenv("HOME", "/home/user", 1); + setenv("HOME", USER_HOME, 1); setenv("DISPLAY", ":0", 1); - execl("/usr/bin/mimeopen", "mimeopen", "-n", filename, (char*)NULL); + execl("/usr/bin/mimeopen", "mimeopen", "-n", + "--database", MIMEINFO_DATABASES, filename, (char*)NULL); perror("execl"); exit(1); default: diff --git a/rpm_spec/core-vm.spec b/rpm_spec/core-vm.spec index 9d5f2fa..563aa15 100644 --- a/rpm_spec/core-vm.spec +++ b/rpm_spec/core-vm.spec @@ -331,6 +331,8 @@ rm -f %{name}-%{version} /usr/share/glib-2.0/schemas/org.gnome.settings-daemon.plugins.updates.gschema.override /usr/share/file-manager/actions/qvm-copy-gnome.desktop /usr/share/file-manager/actions/qvm-dvm-gnome.desktop +%dir /usr/share/qubes +/usr/share/qubes/mime-override/globs %dir /home_volatile %attr(700,user,user) /home_volatile/user %dir /mnt/removable