From d710970e4def269e44cb4dd5bed526094c08c5e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Thu, 27 Aug 2015 20:08:33 +0200 Subject: [PATCH 1/7] Move .desktop launching code to python moules so it can be reused --- Makefile | 10 ++++++++++ misc/qubes-desktop-run | 18 +++--------------- misc/xdg.py | 19 +++++++++++++++++++ rpm_spec/core-vm.spec | 1 + 4 files changed, 33 insertions(+), 15 deletions(-) create mode 100755 misc/xdg.py diff --git a/Makefile b/Makefile index 1af2899..02be08f 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,9 @@ SBINDIR ?= /usr/sbin LIBDIR ?= /usr/lib SYSLIBDIR ?= /lib +PYTHON = /usr/bin/python2 +PYTHON_SITEARCH = `python2 -c 'import distutils.sysconfig; print distutils.sysconfig.get_python_lib(1)'` + # This makefile uses some bash-isms, make uses /bin/sh by default. SHELL = /bin/bash @@ -201,6 +204,13 @@ install-common: install -D -m 0755 misc/qubes-desktop-run $(DESTDIR)/usr/bin/qubes-desktop-run + mkdir -p $(DESTDIR)/$(PYTHON_SITEARCH)/qubes/ +ifeq (1,${DEBIANBUILD}) + install -m 0644 misc/xdg.py $(DESTDIR)/$(PYTHON_SITEARCH)/qubes/ +else + install -m 0644 misc/xdg.py* $(DESTDIR)/$(PYTHON_SITEARCH)/qubes/ +endif + install -d $(DESTDIR)/mnt/removable install -D -m 0644 misc/xorg-preload-apps.conf $(DESTDIR)/etc/X11/xorg-preload-apps.conf diff --git a/misc/qubes-desktop-run b/misc/qubes-desktop-run index 6580060..eb79c93 100755 --- a/misc/qubes-desktop-run +++ b/misc/qubes-desktop-run @@ -1,19 +1,7 @@ #!/usr/bin/python -from gi.repository import Gio +from qubes.xdg import launch import sys -import dbus -def main(myname, desktop, *files): - launcher = Gio.DesktopAppInfo.new_from_filename(desktop) - activatable = launcher.get_boolean('DBusActivatable') - if activatable: - bus = dbus.SessionBus() - service_id = launcher.get_id() - # cut the .desktop suffix - service_id = service_id[:-8] - bus.start_service_by_name(service_id) - launcher.launch(files, None) - -if __name__ == "__main__": - main(*sys.argv) +if __name__ == '__main__': + launch(*sys.argv[1:]) diff --git a/misc/xdg.py b/misc/xdg.py new file mode 100755 index 0000000..c070077 --- /dev/null +++ b/misc/xdg.py @@ -0,0 +1,19 @@ +#!/usr/bin/python + +from gi.repository import Gio +import sys +import dbus + +def launch(desktop, *files): + launcher = Gio.DesktopAppInfo.new_from_filename(desktop) + activatable = launcher.get_boolean('DBusActivatable') + if activatable: + bus = dbus.SessionBus() + service_id = launcher.get_id() + # cut the .desktop suffix + service_id = service_id[:-8] + bus.start_service_by_name(service_id) + launcher.launch(files, None) + +if __name__ == "__main__": + launch(*sys.argv[1:]) diff --git a/rpm_spec/core-vm.spec b/rpm_spec/core-vm.spec index 21a968f..8428ba5 100644 --- a/rpm_spec/core-vm.spec +++ b/rpm_spec/core-vm.spec @@ -416,6 +416,7 @@ rm -f %{name}-%{version} /usr/lib/qubes/close-window /usr/lib/qubes/qubes-trigger-desktop-file-install /usr/lib/yum-plugins/yum-qubes-hooks.py* +/usr/lib64/python2.7/site-packages/qubes/xdg.py* /usr/sbin/qubes-firewall /usr/sbin/qubes-netwatcher /usr/share/qubes/serial.conf From 3d06ce1ee906b17cb00d97c548017c845a84681c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Thu, 27 Aug 2015 21:29:32 +0200 Subject: [PATCH 2/7] Implement dropins for /etc/xdg/autostart (#1151) Usage of _static_ files (dropins) to override some of autostart entries (enable/disable them in appropriate VM types) is much simpler and less error prone than automatic generators. Handling code is implemented in qubes-session-autostart, which is called from qubes-session. qubesos/qubes-issues#1151 --- Makefile | 2 + autostart-dropins/Makefile | 6 ++ autostart-dropins/README.txt | 20 +++++ autostart-dropins/deja-dup-monitor.desktop | 2 + autostart-dropins/gcm-apply.desktop | 2 + autostart-dropins/gnome-keyring-gpg.desktop | 2 + .../gnome-keyring-pkcs11.desktop | 2 + .../gnome-keyring-secrets.desktop | 2 + autostart-dropins/gnome-keyring-ssh.desktop | 2 + autostart-dropins/gnome-power-manager.desktop | 2 + autostart-dropins/gnome-screensaver.desktop | 2 + .../gnome-settings-daemon.desktop | 2 + autostart-dropins/gnome-sound-applet.desktop | 2 + autostart-dropins/gpk-update-icon.desktop | 2 + .../gsettings-data-convert.desktop | 2 + autostart-dropins/imsettings-start.desktop | 2 + autostart-dropins/krb5-auth-dialog.desktop | 2 + autostart-dropins/nm-applet.desktop | 2 + autostart-dropins/notify-osd.desktop | 2 + autostart-dropins/orca-autostart.desktop | 2 + autostart-dropins/pulseaudio.desktop | 2 + autostart-dropins/restorecond.desktop | 2 + autostart-dropins/sealertauto.desktop | 2 + .../user-dirs-update-gtk.desktop | 2 + misc/qubes-session-autostart | 84 +++++++++++++++++++ rpm_spec/core-vm.spec | 4 + 26 files changed, 158 insertions(+) create mode 100644 autostart-dropins/Makefile create mode 100644 autostart-dropins/README.txt create mode 100644 autostart-dropins/deja-dup-monitor.desktop create mode 100644 autostart-dropins/gcm-apply.desktop create mode 100644 autostart-dropins/gnome-keyring-gpg.desktop create mode 100644 autostart-dropins/gnome-keyring-pkcs11.desktop create mode 100644 autostart-dropins/gnome-keyring-secrets.desktop create mode 100644 autostart-dropins/gnome-keyring-ssh.desktop create mode 100644 autostart-dropins/gnome-power-manager.desktop create mode 100644 autostart-dropins/gnome-screensaver.desktop create mode 100644 autostart-dropins/gnome-settings-daemon.desktop create mode 100644 autostart-dropins/gnome-sound-applet.desktop create mode 100644 autostart-dropins/gpk-update-icon.desktop create mode 100644 autostart-dropins/gsettings-data-convert.desktop create mode 100644 autostart-dropins/imsettings-start.desktop create mode 100644 autostart-dropins/krb5-auth-dialog.desktop create mode 100644 autostart-dropins/nm-applet.desktop create mode 100644 autostart-dropins/notify-osd.desktop create mode 100644 autostart-dropins/orca-autostart.desktop create mode 100644 autostart-dropins/pulseaudio.desktop create mode 100644 autostart-dropins/restorecond.desktop create mode 100644 autostart-dropins/sealertauto.desktop create mode 100644 autostart-dropins/user-dirs-update-gtk.desktop create mode 100644 misc/qubes-session-autostart diff --git a/Makefile b/Makefile index 02be08f..f2b556c 100644 --- a/Makefile +++ b/Makefile @@ -121,6 +121,7 @@ install-rh: install-systemd install-systemd-dropins install-sysvinit install -m 0400 -D network/ip6tables $(DESTDIR)/usr/lib/qubes/init/ip6tables install-common: + $(MAKE) -C autostart-dropins install install -m 0644 -D misc/fstab $(DESTDIR)/etc/fstab install -D -m 0440 misc/qubes.sudoers $(DESTDIR)/etc/sudoers.d/qubes @@ -171,6 +172,7 @@ install-common: install network/qubes-netwatcher $(DESTDIR)/$(SBINDIR)/ install -d $(DESTDIR)/usr/bin + install -m 0755 misc/qubes-session-autostart $(DESTDIR)/usr/bin/qubes-session-autostart install -m 0755 misc/qubes-desktop-file-install $(DESTDIR)/usr/bin/qubes-desktop-file-install install -m 0755 misc/qubes-trigger-desktop-file-install $(DESTDIR)$(LIBDIR)/qubes/qubes-trigger-desktop-file-install diff --git a/autostart-dropins/Makefile b/autostart-dropins/Makefile new file mode 100644 index 0000000..eee3d53 --- /dev/null +++ b/autostart-dropins/Makefile @@ -0,0 +1,6 @@ + +DROPINS_DIR = /etc/qubes/autostart + +install: + for f in *.desktop; do install -m 0644 -D $$f $(DESTDIR)$(DROPINS_DIR)/$$f.d/30_qubes.conf; done + install -m 0644 README.txt $(DESTDIR)$(DROPINS_DIR)/ diff --git a/autostart-dropins/README.txt b/autostart-dropins/README.txt new file mode 100644 index 0000000..c008f46 --- /dev/null +++ b/autostart-dropins/README.txt @@ -0,0 +1,20 @@ +This directory (/etc/qubes/autostart) is used to override parts of files in +/etc/xdg/autostart. For each desktop file there, you can create directory named +after the file plus ".d", then place files there. All such files will be read +(in lexicographical order) and lines specified there will override respective +entries in the original file. This can be used for example to enable or disable +specific application in particular VM type. + +For example, you can extend `/etc/xdg/autostart/gnome-keyring-ssh.desktop` by +creating `/etc/qubes/autostart/gnome-keyring-ssh.desktop.d/50_user.conf` with: +``` +[Desktop Entry] +OnlyShowIn=X-AppVM; +``` + +This would mean that `OnlyShowIn` key would be read as `X-AppVM;`, regardless +of original entry in `/etc/xdg/autostart/gnome-keyring-ssh.desktop`. + +This mechanism overrides only content of /etc/xdg/autostart, files placed in +~/.config/autostart are unaffected, so can be used to override settings per-VM +basis. diff --git a/autostart-dropins/deja-dup-monitor.desktop b/autostart-dropins/deja-dup-monitor.desktop new file mode 100644 index 0000000..98a3ec9 --- /dev/null +++ b/autostart-dropins/deja-dup-monitor.desktop @@ -0,0 +1,2 @@ +[Desktop Entry] +NotShowIn=X-QUBES; diff --git a/autostart-dropins/gcm-apply.desktop b/autostart-dropins/gcm-apply.desktop new file mode 100644 index 0000000..7f778a1 --- /dev/null +++ b/autostart-dropins/gcm-apply.desktop @@ -0,0 +1,2 @@ +[Desktop Entry] +NotShowIn=X-DisposableVM; diff --git a/autostart-dropins/gnome-keyring-gpg.desktop b/autostart-dropins/gnome-keyring-gpg.desktop new file mode 100644 index 0000000..b60f8d9 --- /dev/null +++ b/autostart-dropins/gnome-keyring-gpg.desktop @@ -0,0 +1,2 @@ +[Desktop Entry] +OnlyShowIn=GNOME;X-AppVM; diff --git a/autostart-dropins/gnome-keyring-pkcs11.desktop b/autostart-dropins/gnome-keyring-pkcs11.desktop new file mode 100644 index 0000000..b60f8d9 --- /dev/null +++ b/autostart-dropins/gnome-keyring-pkcs11.desktop @@ -0,0 +1,2 @@ +[Desktop Entry] +OnlyShowIn=GNOME;X-AppVM; diff --git a/autostart-dropins/gnome-keyring-secrets.desktop b/autostart-dropins/gnome-keyring-secrets.desktop new file mode 100644 index 0000000..b60f8d9 --- /dev/null +++ b/autostart-dropins/gnome-keyring-secrets.desktop @@ -0,0 +1,2 @@ +[Desktop Entry] +OnlyShowIn=GNOME;X-AppVM; diff --git a/autostart-dropins/gnome-keyring-ssh.desktop b/autostart-dropins/gnome-keyring-ssh.desktop new file mode 100644 index 0000000..b60f8d9 --- /dev/null +++ b/autostart-dropins/gnome-keyring-ssh.desktop @@ -0,0 +1,2 @@ +[Desktop Entry] +OnlyShowIn=GNOME;X-AppVM; diff --git a/autostart-dropins/gnome-power-manager.desktop b/autostart-dropins/gnome-power-manager.desktop new file mode 100644 index 0000000..98a3ec9 --- /dev/null +++ b/autostart-dropins/gnome-power-manager.desktop @@ -0,0 +1,2 @@ +[Desktop Entry] +NotShowIn=X-QUBES; diff --git a/autostart-dropins/gnome-screensaver.desktop b/autostart-dropins/gnome-screensaver.desktop new file mode 100644 index 0000000..98a3ec9 --- /dev/null +++ b/autostart-dropins/gnome-screensaver.desktop @@ -0,0 +1,2 @@ +[Desktop Entry] +NotShowIn=X-QUBES; diff --git a/autostart-dropins/gnome-settings-daemon.desktop b/autostart-dropins/gnome-settings-daemon.desktop new file mode 100644 index 0000000..b60f8d9 --- /dev/null +++ b/autostart-dropins/gnome-settings-daemon.desktop @@ -0,0 +1,2 @@ +[Desktop Entry] +OnlyShowIn=GNOME;X-AppVM; diff --git a/autostart-dropins/gnome-sound-applet.desktop b/autostart-dropins/gnome-sound-applet.desktop new file mode 100644 index 0000000..98a3ec9 --- /dev/null +++ b/autostart-dropins/gnome-sound-applet.desktop @@ -0,0 +1,2 @@ +[Desktop Entry] +NotShowIn=X-QUBES; diff --git a/autostart-dropins/gpk-update-icon.desktop b/autostart-dropins/gpk-update-icon.desktop new file mode 100644 index 0000000..d7a864d --- /dev/null +++ b/autostart-dropins/gpk-update-icon.desktop @@ -0,0 +1,2 @@ +[Desktop Entry] +OnlyShowIn=GNOME;X-UpdateableVM; diff --git a/autostart-dropins/gsettings-data-convert.desktop b/autostart-dropins/gsettings-data-convert.desktop new file mode 100644 index 0000000..b60f8d9 --- /dev/null +++ b/autostart-dropins/gsettings-data-convert.desktop @@ -0,0 +1,2 @@ +[Desktop Entry] +OnlyShowIn=GNOME;X-AppVM; diff --git a/autostart-dropins/imsettings-start.desktop b/autostart-dropins/imsettings-start.desktop new file mode 100644 index 0000000..98a3ec9 --- /dev/null +++ b/autostart-dropins/imsettings-start.desktop @@ -0,0 +1,2 @@ +[Desktop Entry] +NotShowIn=X-QUBES; diff --git a/autostart-dropins/krb5-auth-dialog.desktop b/autostart-dropins/krb5-auth-dialog.desktop new file mode 100644 index 0000000..98a3ec9 --- /dev/null +++ b/autostart-dropins/krb5-auth-dialog.desktop @@ -0,0 +1,2 @@ +[Desktop Entry] +NotShowIn=X-QUBES; diff --git a/autostart-dropins/nm-applet.desktop b/autostart-dropins/nm-applet.desktop new file mode 100644 index 0000000..f674213 --- /dev/null +++ b/autostart-dropins/nm-applet.desktop @@ -0,0 +1,2 @@ +[Desktop Entry] +OnlyShowIn=GNOME;X-QUBES diff --git a/autostart-dropins/notify-osd.desktop b/autostart-dropins/notify-osd.desktop new file mode 100644 index 0000000..98a3ec9 --- /dev/null +++ b/autostart-dropins/notify-osd.desktop @@ -0,0 +1,2 @@ +[Desktop Entry] +NotShowIn=X-QUBES; diff --git a/autostart-dropins/orca-autostart.desktop b/autostart-dropins/orca-autostart.desktop new file mode 100644 index 0000000..98a3ec9 --- /dev/null +++ b/autostart-dropins/orca-autostart.desktop @@ -0,0 +1,2 @@ +[Desktop Entry] +NotShowIn=X-QUBES; diff --git a/autostart-dropins/pulseaudio.desktop b/autostart-dropins/pulseaudio.desktop new file mode 100644 index 0000000..98a3ec9 --- /dev/null +++ b/autostart-dropins/pulseaudio.desktop @@ -0,0 +1,2 @@ +[Desktop Entry] +NotShowIn=X-QUBES; diff --git a/autostart-dropins/restorecond.desktop b/autostart-dropins/restorecond.desktop new file mode 100644 index 0000000..98a3ec9 --- /dev/null +++ b/autostart-dropins/restorecond.desktop @@ -0,0 +1,2 @@ +[Desktop Entry] +NotShowIn=X-QUBES; diff --git a/autostart-dropins/sealertauto.desktop b/autostart-dropins/sealertauto.desktop new file mode 100644 index 0000000..98a3ec9 --- /dev/null +++ b/autostart-dropins/sealertauto.desktop @@ -0,0 +1,2 @@ +[Desktop Entry] +NotShowIn=X-QUBES; diff --git a/autostart-dropins/user-dirs-update-gtk.desktop b/autostart-dropins/user-dirs-update-gtk.desktop new file mode 100644 index 0000000..b60f8d9 --- /dev/null +++ b/autostart-dropins/user-dirs-update-gtk.desktop @@ -0,0 +1,2 @@ +[Desktop Entry] +OnlyShowIn=GNOME;X-AppVM; diff --git a/misc/qubes-session-autostart b/misc/qubes-session-autostart new file mode 100644 index 0000000..12c9a05 --- /dev/null +++ b/misc/qubes-session-autostart @@ -0,0 +1,84 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# +# The Qubes OS Project, http://www.qubes-os.org +# +# Copyright (C) 2015 Marek Marczykowski-Górecki +# +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# +import subprocess +import sys + +from xdg.DesktopEntry import DesktopEntry +from qubes.xdg import launch +import xdg.BaseDirectory +import os + +QUBES_XDG_CONFIG_DROPINS = '/etc/qubes/autostart' + +def open_desktop_entry_and_dropins(filename): + desktop_entry = DesktopEntry(filename) + dropins_dir = os.path.join(QUBES_XDG_CONFIG_DROPINS, + os.path.basename(filename) + '.d') + if os.path.isdir(dropins_dir): + for dropin in sorted(os.listdir(dropins_dir)): + dropin_content = DesktopEntry(os.path.join(dropins_dir, dropin)) + desktop_entry.content.update(dropin_content.content) + + return desktop_entry + + +def entry_should_be_started(entry, environments): + """ + + :type entry: DesktopEntry + """ + if entry.getHidden(): + return False + if entry.getOnlyShowIn(): + return bool(set(entry.getOnlyShowIn()).intersection(environments)) + if entry.getNotShowIn(): + return not bool(set(entry.getNotShowIn()).intersection(environments)) + return True + + +def process_autostart(environments): + # handle only "most important" entry + processed_entries = {} + for path in xdg.BaseDirectory.load_config_paths('autostart'): + for entry_name in os.listdir(path): + if entry_name in processed_entries: + continue + + # make the entry as processed, even if not actually started + processed_entries[entry_name] = True + + entry_path = os.path.join(path, entry_name) + # files in $HOME have higher priority than dropins + if not path.startswith(xdg.BaseDirectory.xdg_config_home): + entry = open_desktop_entry_and_dropins(entry_path) + else: + entry = DesktopEntry(entry_path) + if entry_should_be_started(entry, environments): + launch(entry_path) + +def main(): + process_autostart(sys.argv[1:]) + +if __name__ == '__main__': + main() \ No newline at end of file diff --git a/rpm_spec/core-vm.spec b/rpm_spec/core-vm.spec index 8428ba5..9477f8d 100644 --- a/rpm_spec/core-vm.spec +++ b/rpm_spec/core-vm.spec @@ -356,6 +356,9 @@ rm -f %{name}-%{version} %config(noreplace) /etc/qubes-rpc/qubes.SelectDirectory %config(noreplace) /etc/qubes-rpc/qubes.GetImageRGBA %config(noreplace) /etc/qubes-rpc/qubes.SetDateTime +%dir /etc/qubes/autostart +/etc/qubes/autostart/README.txt +%config /etc/qubes/autostart/*.desktop.d/30_qubes.conf %config(noreplace) /etc/sudoers.d/qubes %config(noreplace) /etc/sysconfig/iptables.qubes %config(noreplace) /etc/sysconfig/ip6tables.qubes @@ -384,6 +387,7 @@ rm -f %{name}-%{version} /usr/bin/qubes-desktop-run /usr/bin/qrexec-fork-server /usr/bin/qrexec-client-vm +/usr/bin/qubes-session-autostart /usr/bin/qubes-desktop-file-install %dir /usr/lib/qubes /usr/lib/qubes/vusb-ctl.py* From 4703e3fca73af9b2c7fd82f3a955bc4a74d88e61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Thu, 27 Aug 2015 22:05:48 +0200 Subject: [PATCH 3/7] Remove dynamically generated autostart desktop files qubesos/qubes-issues#1151 --- Makefile | 3 - debian/qubes-core-agent.postinst | 12 - debian/qubes-core-agent.triggers | 1 - misc/qubes-desktop-file-install | 367 ------------------ misc/qubes-trigger-desktop-file-install | 94 ----- .../qubes-trigger-desktop-file-install.action | 1 - rpm_spec/core-vm.spec | 12 +- vm-systemd/misc-post.sh | 15 - 8 files changed, 1 insertion(+), 504 deletions(-) delete mode 100755 misc/qubes-desktop-file-install delete mode 100755 misc/qubes-trigger-desktop-file-install delete mode 100644 misc/qubes-trigger-desktop-file-install.action diff --git a/Makefile b/Makefile index f2b556c..dbb3f2b 100644 --- a/Makefile +++ b/Makefile @@ -112,7 +112,6 @@ install-rh: install-systemd install-systemd-dropins install-sysvinit touch $(DESTDIR)/etc/yum.conf.d/qubes-proxy.conf install -D -m 0644 misc/qubes-trigger-sync-appmenus.action $(DESTDIR)/etc/yum/post-actions/qubes-trigger-sync-appmenus.action - install -D -m 0644 misc/qubes-trigger-desktop-file-install.action $(DESTDIR)/etc/yum/post-actions/qubes-trigger-desktop-file-install.action install -D -m 0644 misc/serial.conf $(DESTDIR)/usr/share/qubes/serial.conf install -D misc/qubes-serial-login $(DESTDIR)/$(SBINDIR)/qubes-serial-login @@ -173,8 +172,6 @@ install-common: install -d $(DESTDIR)/usr/bin install -m 0755 misc/qubes-session-autostart $(DESTDIR)/usr/bin/qubes-session-autostart - install -m 0755 misc/qubes-desktop-file-install $(DESTDIR)/usr/bin/qubes-desktop-file-install - install -m 0755 misc/qubes-trigger-desktop-file-install $(DESTDIR)$(LIBDIR)/qubes/qubes-trigger-desktop-file-install install qubes-rpc/{qvm-open-in-dvm,qvm-open-in-vm,qvm-copy-to-vm,qvm-move-to-vm,qvm-run,qvm-mru-entry} $(DESTDIR)/usr/bin install qubes-rpc/wrap-in-html-if-url.sh $(DESTDIR)$(LIBDIR)/qubes diff --git a/debian/qubes-core-agent.postinst b/debian/qubes-core-agent.postinst index ae96137..72687f5 100755 --- a/debian/qubes-core-agent.postinst +++ b/debian/qubes-core-agent.postinst @@ -143,10 +143,6 @@ case "${1}" in # Update Qubes App Menus" /usr/lib/qubes/qubes-trigger-sync-appmenus.sh || true - - ## Update all xdg autostart desktop entries - /usr/lib/qubes/qubes-trigger-desktop-file-install clean || true - ;; abort-upgrade|abort-remove|abort-deconfigure) @@ -160,14 +156,6 @@ case "${1}" in /usr/share/applications) debug "Updating Qubes App Menus..." /usr/lib/qubes/qubes-trigger-sync-appmenus.sh || true - - debug "Updating XDG Config..." - /usr/lib/qubes/qubes-trigger-desktop-file-install || true - ;; - - /etc/xdg) - debug "Updating XDG Config..." - /usr/lib/qubes/qubes-trigger-desktop-file-install || true ;; # Install overridden serial.conf init script diff --git a/debian/qubes-core-agent.triggers b/debian/qubes-core-agent.triggers index a970467..761d44e 100644 --- a/debian/qubes-core-agent.triggers +++ b/debian/qubes-core-agent.triggers @@ -1,3 +1,2 @@ interest-noawait /usr/share/applications -interest-noawait /etc/xdg interest-noawait /etc/init/serial.conf diff --git a/misc/qubes-desktop-file-install b/misc/qubes-desktop-file-install deleted file mode 100755 index 5b551ae..0000000 --- a/misc/qubes-desktop-file-install +++ /dev/null @@ -1,367 +0,0 @@ -#! /usr/bin/env python -# -*- coding: utf-8 -*- -# vim: set ft=python ts=4 sw=4 sts=4 et : - -# Copyright (C) 2015 Jason Mehring -# License: GPL-2+ -# Authors: Jason Mehring -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -'''Installation and edition of desktop files. - -Description: - The desktop-file-install program is a tool to install, and optionally edit, - desktop files. They are mostly useful for developers and packagers. - - Various options are available to edit the desktop files. The edit options can - be specified more than once and will be processed in the same order as the - options passed to the program. - - The original .desktop files are left untouched and left in place. - - Qubes modifies the XDG_CONFIG_DIRS to first include the `/var/lib/qubes/xdg` - directory (XDG_CONFIG_DIRS=/var/lib/qubes/xdg:/etc/xdg). - -Usage: - qubes-desktop-file-install [--dir DIR] [--force] - [--remove-show-in] - [--remove-key KEY] - [--remove-only-show-in ENVIRONMENT] - [--add-only-show-in ENVIRONMENT] - [--remove-not-show-in ENVIRONMENT] - [--add-not-show-in ENVIRONMENT] - [(--set-key KEY VALUE)] - FILE - qubes-desktop-file-install -h | --help - qubes-desktop-file-install --version - -Examples: - qubes-desktop-file-install --dir /var/lib/qubes/xdg/autostart --add-only-show-in X-QUBES /etc/xdg/autostart/pulseaudio.desktop - -Arguments: - FILE Path to desktop entry file - -Help Options: - -h, --help show this help message and exit - -Installation options for desktop file: - --dir DIR Install desktop files to the DIR directory (default: ) - --force Force overwrite of existing desktop files (default: False) - -Edition options for desktop file: - --remove-show-in Remove the "OnlyShowIn" and "NotShowIn" entries from the desktop file (default: False) - --remove-key KEY Remove the KEY key from the desktop files, if present - --set-key (KEY VALUE) Set the KEY key to VALUE - --remove-only-show-in ENVIRONMENT Remove ENVIRONMENT from the list of desktop environment where the desktop files should be displayed - --add-only-show-in ENVIRONMENT Add ENVIRONMENT to the list of desktop environment where the desktop files should be displayed - --remove-not-show-in ENVIRONMENT Remove ENVIRONMENT from the list of desktop environment where the desktop files should not be displayed - --add-not-show-in ENVIRONMENT Add ENVIRONMENT to the list of desktop environment where the desktop files should not be displayed -''' - -import argparse -import codecs -import io -import locale -import os -import sys - -try: - import ConfigParser as configparser -except ImportError: - import configparser - -from collections import OrderedDict - -# Third party libs -import xdg.DesktopEntry - -__all__ = [] -__version__ = '1.0.0' - -# This is almost always a good thing to do at the beginning of your programs. -locale.setlocale(locale.LC_ALL, '') - -# Default Qubes directory that modified desktop entry config files are stored in -QUBES_XDG_CONFIG_DIR = '/vat/lib/qubes/xdg' - - -class DesktopEntry(xdg.DesktopEntry.DesktopEntry): - '''Class to parse and validate Desktop Entries (OVERRIDE). - - xdg.DesktopEntry.DesktopEntry does not maintain order of content - ''' - - defaultGroup = 'Desktop Entry' - - def __init__(self, filename=None): - """Create a new DesktopEntry - - If filename exists, it will be parsed as a desktop entry file. If not, - or if filename is None, a blank DesktopEntry is created. - """ - self.content = OrderedDict() - if filename and os.path.exists(filename): - self.parse(filename) - elif filename: - self.new(filename) - - def parse(self, filename): - '''Parse a desktop entry file.''' - headers = [u'Desktop Entry', u'KDE Desktop Entry'] - cfgparser = configparser.RawConfigParser() - cfgparser.optionxform = unicode - - try: - cfgparser.readfp(codecs.open(filename, 'r', 'utf8')) - except configparser.MissingSectionHeaderError: - sys.exit('{0} missing header!'.format(filename, headers[0])) - - self.filename = filename - self.tainted = False - - for header in headers: - if cfgparser.has_section(header): - self.content[header] = OrderedDict(cfgparser.items(header)) - if not self.defaultGroup: - self.defaultGroup = header - - if not self.defaultGroup: - sys.exit('{0} missing header!'.format(filename, headers[0])) - - # Write support broken in Wheezy; override here - def write(self, filename=None, trusted=False): - if not filename and not self.filename: - raise ParsingError("File not found", "") - - if filename: - self.filename = filename - else: - filename = self.filename - - if os.path.dirname(filename) and not os.path.isdir(os.path.dirname(filename)): - os.makedirs(os.path.dirname(filename)) - - with io.open(filename, 'w', encoding='utf-8') as fp: - - # An executable bit signifies that the desktop file is - # trusted, but then the file can be executed. Add hashbang to - # make sure that the file is opened by something that - # understands desktop files. - if trusted: - fp.write(u("#!/usr/bin/env xdg-open\n")) - - if self.defaultGroup: - fp.write(unicode("[%s]\n") % self.defaultGroup) - for (key, value) in self.content[self.defaultGroup].items(): - fp.write(unicode("%s=%s\n") % (key, value)) - fp.write(unicode("\n")) - for (name, group) in self.content.items(): - if name != self.defaultGroup: - fp.write(unicode("[%s]\n") % name) - for (key, value) in group.items(): - fp.write(unicode("%s=%s\n") % (key, value)) - fp.write(unicode("\n")) - - # Add executable bits to the file to show that it's trusted. - if trusted: - oldmode = os.stat(filename).st_mode - mode = oldmode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH - os.chmod(filename, mode) - - self.tainted = False - - -def delete(path): - '''Delete a file. - ''' - if os.path.exists(path): - try: - os.unlink(os.path.abspath(path)) - except IOError as error: - sys.exit('Unable to delete file: {0}\n{1}'.format(path, error)) - - -def set_key(entry, key, value): - '''Set a key with value within an desktop-file entry object. - ''' - key = unicode(key) - if isinstance(value, list): - entry.set(key, u';'.join(value)) - else: - entry.set(key, unicode(value)) - - -def remove_key(entry, key): - '''Remove a key within an desktop-file entry object. - ''' - entry.removeKey(unicode(key)) - - -def add_value(entry, key, value): - '''Add a value to a desktop-file entry object. - ''' - values = entry.getList(unicode(value)) - for value in values: - entry_values = entry.get(key, list=True) - if value not in entry_values: - entry_values.append(value) - set_key(entry, key, entry_values) - - -def remove_value(entry, key, value): - '''Remove a value to a desktop-file entry object. - ''' - value = unicode(value) - entry_values = entry.get(key, list=True) - if value in entry_values: - entry_values.remove(value) - if entry_values: - set_key(entry, key, entry_values) - else: - remove_key(entry, key) - - -def install(**kwargs): - '''Install a copy of a desktop-file entry file to a new location and - optionally edit it. - ''' - paths = kwargs.get('path', []) - for path in paths: - if not path: - sys.exit('No path selected!') - - filename, extension = os.path.splitext(path) - if extension.lower() not in ['.desktop']: - sys.exit("Invalid desktop extenstion '{0}'! Was expecting '.desktop'.".format(extension)) - - new_path = os.path.join(kwargs['dir'], os.path.basename(path)) - - if os.path.exists(path) and os.path.isfile(path): - stat_info = os.stat(path) - - # Don't update if file has previously been updated unless force is True - if os.path.exists(new_path) and not kwargs['force']: - if os.stat(new_path).st_mtime == stat_info.st_mtime: - continue - else: - if os.path.exists(new_path) and os.path.isfile(new_path): - delete(new_path) - continue - - entry = DesktopEntry(path) - - if kwargs['remove_show_in']: - kwargs['remove_key'].append(u'OnlyShowIn') - kwargs['remove_key'].append(u'NotShowIn') - - if kwargs['remove_key']: - for value in kwargs['remove_key']: - remove_key(entry, value) - - if kwargs['remove_only_show_in']: - for value in kwargs['remove_only_show_in']: - remove_value(entry, u'OnlyShowIn', value) - - if kwargs['add_only_show_in']: - for value in kwargs['add_only_show_in']: - add_value(entry, u'OnlyShowIn', value) - - if kwargs['remove_not_show_in']: - for value in kwargs['remove_not_show_in']: - remove_value(entry, u'NotShowIn', value) - - if kwargs['add_not_show_in']: - for value in kwargs['add_not_show_in']: - add_value(entry, u'NotShowIn', value) - - if kwargs['set_key']: - for key, value in kwargs['set_key']: - set_key(entry, key, value) - - entry.write(new_path) - if stat_info: - os.utime(new_path, (stat_info.st_atime, stat_info.st_mtime)) - - - -def parse(args): - '''Argparse configuration. - ''' - parser = argparse.ArgumentParser() - - parser.add_argument('--version', action='version', version='%(prog)s (version {0})'.format(__version__)) - - parser.add_argument('--force', action='store_true', default=False, help='\ - Force overwrite of existing desktop files.') - - parser.add_argument('--dir', default=QUBES_XDG_CONFIG_DIR, help='\ - Install desktop files to the DIR directory.') - - parser.add_argument('--remove-show-in', action='store_true', default=False, help='\ - Remove the "OnlyShowIn" and "NotShowIn" entries from the desktop file') - - parser.add_argument('--remove-key', action='append', metavar='KEY', default=[], help='\ - Remove the KEY key from the desktop file') - - parser.add_argument('--remove-only-show-in', action='append', metavar='ENVIRONMENT', default=[], help='\ - Remove ENVIRONMENT from the list of desktop environments where the\ - desktop files should be displayed (key OnlyShowIn). If ENVIRONMENT was\ - not present in the list, this operation is a no-op.') - - parser.add_argument('--add-only-show-in', action='append', metavar='ENVIRONMENT', default=[], help='\ - Add ENVIRONMENT to the list of desktop environments where the desktop\ - files should be displayed (key OnlyShowIn). If ENVIRONMENT was already\ - present in the list, this operation is a no-op. A non-registered desktop\ - environment should be prefixed with X-. Note that an empty OnlyShowIn\ - key in a desktop file means that the desktop file will be displayed in\ - all environments.') - - parser.add_argument('--remove-not-show-in', action='append', metavar='ENVIRONMENT', default=[], help='\ - Remove ENVIRONMENT from the list of desktop environments where the\ - desktop files should not be displayed (key NotShowIn). If\ - ENVIRONMENT was not present in the list, this operation is a no-op.') - - parser.add_argument('--add-not-show-in', action='append', metavar='ENVIRONMENT', default=[], help='\ - Add ENVIRONMENT to the list of desktop environments where the desktop\ - files should not be displayed (key NotShowIn). If ENVIRONMENT was\ - already present in the list, this operation is a no-op. A non-registered\ - desktop environment should be prefixed with X-. Note that an empty\ - NotShowIn key in a desktop file means that the desktop file will be\ - displayed in all environments.') - - parser.add_argument('--set-key', action='append', nargs=2, metavar=('KEY', 'VALUE'), default=[], help='\ - Set the KEY key to the VALUE passed.') - - parser.add_argument('path', action='store', nargs='+', metavar='FILE', default=None, - help='Path to desktop entry file') - - args = parser.parse_args(args) - - if not os.path.isabs(args.dir): - args.dir = os.path.join(QUBES_XDG_CONFIG_DIR, args.dir) - - return args - - -def main(argv): - '''Main function. - ''' - args = parse(argv[1:]) - install(**vars(args)) - - -if __name__ == '__main__': - main(sys.argv) - sys.exit(0) diff --git a/misc/qubes-trigger-desktop-file-install b/misc/qubes-trigger-desktop-file-install deleted file mode 100755 index d7af239..0000000 --- a/misc/qubes-trigger-desktop-file-install +++ /dev/null @@ -1,94 +0,0 @@ -#!/bin/bash -e -# vim: set ts=4 sw=4 sts=4 et : - -# -# qubes-trigger-desktop-file-install -# -# This trigger script calls qubes-desktop-file-install to installation and edit -# desktop file overrides, leaving the original desktop file in-place and -# untouched. -# -# 'qubes-desktop-file-install' options: -# --dir DIR Install desktop files to the DIR directory (default: ) -# --force Force overwrite of existing desktop files (default: False) -# --remove-show-in Remove the "OnlyShowIn" and "NotShowIn" entries from the desktop file (default: False) -# --remove-key KEY Remove the KEY key from the desktop files, if present -# --set-key (KEY VALUE) Set the KEY key to VALUE -# --remove-only-show-in ENVIRONMENT Remove ENVIRONMENT from the list of desktop environment where the desktop files should be displayed -# --add-only-show-in ENVIRONMENT Add ENVIRONMENT to the list of desktop environment where the desktop files should be displayed -# --remove-not-show-in ENVIRONMENT Remove ENVIRONMENT from the list of desktop environment where the desktop files should not be displayed -# --add-not-show-in ENVIRONMENT Add ENVIRONMENT to the list of desktop environment where the desktop files should not be displayed - -QUBES_DESKTOP_FILE_INSTALL='/usr/bin/qubes-desktop-file-install' -QUBES_XDG_CONFIG_DIR=/var/lib/qubes/xdg/autostart -XDG_CONFIG_DIR=/etc/xdg/autostart - -INSTALL_CMD=""${QUBES_DESKTOP_FILE_INSTALL}" --force --dir "${QUBES_XDG_CONFIG_DIR}"" - -# Remove all current Qubes desktop entry files -if [ "${1}" == "clean" ]; then - rm -f "${QUBES_XDG_CONFIG_DIR}"/* -fi - -generatePath () { - echo "${XDG_CONFIG_DIR}/${1}.desktop" - -} - -generateFileList () { - for key in "${!FILES[@]}"; do - FILES[${key}]="$(generatePath ${FILES[key]})" - done -} - -install () { - local options="${@}" - - # Install an edited version of desktop file in $QUBES_XDG_CONFIG_DIR - generateFileList - $INSTALL_CMD "${@}" "${FILES[@]}" || true - -} - -# Desktop Entry Modification - NotShowIn=QUBES -FILES=( - 'pulseaudio' - 'deja-dup-monitor' - 'imsettings-start' - 'krb5-auth-dialog' - 'restorecond' - 'sealertauto' - 'gnome-power-manager' - 'gnome-sound-applet' - 'gnome-screensaver' - 'orca-autostart' - 'notify-osd' -); install --remove-show-in --add-not-show-in X-QUBES - -# Desktop Entry Modification - NotShowIn=DisposableVM -FILES=('gcm-apply') -install --remove-show-in --add-not-show-in X-DisposableVM - -# Desktop Entry Modification - OnlyShowIn=GNOME;AppVM; -FILES=( - 'gnome-keyring-gpg' - 'gnome-keyring-pkcs11' - 'gnome-keyring-secrets' - 'gnome-keyring-ssh' - 'gnome-settings-daemon' - 'user-dirs-update-gtk' - 'gsettings-data-convert' -); install --remove-show-in --add-only-show-in 'GNOME;X-AppVM' - -# Desktop Entry Modification - OnlyShowIn=GNOME;UpdateableVM -FILES=('gpk-update-icon') -install --remove-show-in --add-only-show-in 'GNOME;X-UpdateableVM' - -# Desktop Entry Modification - OnlyShowIn=GNOME;QUBES -FILES=('nm-applet') - install --remove-show-in --add-only-show-in 'GNOME;X-QUBES' - -# Desktop Entry Modification - Remove existing rules -FILES=( - 'abrt-applet' -); install --remove-show-in diff --git a/misc/qubes-trigger-desktop-file-install.action b/misc/qubes-trigger-desktop-file-install.action deleted file mode 100644 index c76ce07..0000000 --- a/misc/qubes-trigger-desktop-file-install.action +++ /dev/null @@ -1 +0,0 @@ -*:any:/usr/lib/qubes/qubes-trigger-desktop-file-install diff --git a/rpm_spec/core-vm.spec b/rpm_spec/core-vm.spec index 9477f8d..7ba394b 100644 --- a/rpm_spec/core-vm.spec +++ b/rpm_spec/core-vm.spec @@ -51,7 +51,7 @@ Requires: qubes-utils Requires: initscripts # for qubes-desktop-run Requires: pygobject3-base -# for qubes-desktop-file-install +# for qubes-session-autostart Requires: pyxdg %if %{fedora} >= 20 # gpk-update-viewer required by qubes-manager @@ -128,9 +128,6 @@ if [ -e /etc/init/serial.conf ]; then cp /usr/share/qubes/serial.conf /etc/init/serial.conf fi -%triggerin -- pulseaudio-module-x11 -/usr/bin/qubes-desktop-file-install --force --dir /var/lib/qubes/xdg/autostart --remove-show-in --add-not-show-in X-QUBES /etc/xdg/autostart/pulseaudio.desktop - %triggerin -- iptables if ! grep -q IPTABLES_DATA /etc/sysconfig/iptables-config; then cat <>/etc/sysconfig/iptables-config @@ -159,10 +156,6 @@ for F in plymouth-shutdown prefdm splash-manager start-ttys tty ; do fi done -# Update all autostart xdg desktop configuration files (modified copies are -# placed in /var/lib/qubes/xdg/autostart) -/usr/lib/qubes/qubes-trigger-desktop-file-install clean - # Create NetworkManager configuration if we do not have it if ! [ -e /etc/NetworkManager/NetworkManager.conf ]; then echo '[main]' > /etc/NetworkManager/NetworkManager.conf @@ -374,7 +367,6 @@ rm -f %{name}-%{version} %config(noreplace) /etc/yum.repos.d/qubes-r3.repo /etc/yum/pluginconf.d/yum-qubes-hooks.conf /etc/yum/post-actions/qubes-trigger-sync-appmenus.action -/etc/yum/post-actions/qubes-trigger-desktop-file-install.action /usr/lib/systemd/system/user@.service.d/90-session-stop-timeout.conf /usr/sbin/qubes-serial-login /usr/bin/qvm-copy-to-vm @@ -388,7 +380,6 @@ rm -f %{name}-%{version} /usr/bin/qrexec-fork-server /usr/bin/qrexec-client-vm /usr/bin/qubes-session-autostart -/usr/bin/qubes-desktop-file-install %dir /usr/lib/qubes /usr/lib/qubes/vusb-ctl.py* /usr/lib/qubes/dispvm-prerun.sh @@ -418,7 +409,6 @@ rm -f %{name}-%{version} /usr/lib/qubes/wrap-in-html-if-url.sh /usr/lib/qubes/iptables-updates-proxy /usr/lib/qubes/close-window -/usr/lib/qubes/qubes-trigger-desktop-file-install /usr/lib/yum-plugins/yum-qubes-hooks.py* /usr/lib64/python2.7/site-packages/qubes/xdg.py* /usr/sbin/qubes-firewall diff --git a/vm-systemd/misc-post.sh b/vm-systemd/misc-post.sh index e5c35e8..7f0659f 100755 --- a/vm-systemd/misc-post.sh +++ b/vm-systemd/misc-post.sh @@ -26,25 +26,10 @@ INTERFACE=eth0 /usr/lib/qubes/setup-ip # Start services which haven't own proper systemd unit: -# Start AppVM specific services -INSTALL_CMD='/usr/bin/qubes-desktop-file-install --force --dir /var/lib/qubes/xdg/autostart' - if [ ! -f /etc/systemd/system/cups.service ]; then if [ -f /var/run/qubes-service/cups ]; then /usr/sbin/service cups start - # Allow also notification icon - $INSTALL_CMD --remove-not-show-in X-QUBES /etc/xdg/autostart/print-applet.desktop - else - # Disable notification icon - $INSTALL_CMD --add-not-show-in X-QUBES /etc/xdg/autostart/print-applet.desktop fi fi -if [ -f /var/run/qubes-service/network-manager ]; then - # Allow also notification icon - $INSTALL_CMD --remove-not-show-in X-QUBES --add-only-show-in X-QUBES /etc/xdg/autostart/nm-applet.desktop -else - # Disable notification icon - $INSTALL_CMD --remove-only-show-in X-QUBES --add-not-show-in X-QUBES /etc/xdg/autostart/nm-applet.desktop -fi exit 0 From 67357e051f88571638a7a809eb30497ad65424eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Thu, 27 Aug 2015 22:41:51 +0200 Subject: [PATCH 4/7] qubes-session-autostart: do not abort the whole process on invalid file --- misc/qubes-session-autostart | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/misc/qubes-session-autostart b/misc/qubes-session-autostart index 12c9a05..fcf3439 100644 --- a/misc/qubes-session-autostart +++ b/misc/qubes-session-autostart @@ -68,14 +68,19 @@ def process_autostart(environments): # make the entry as processed, even if not actually started processed_entries[entry_name] = True - entry_path = os.path.join(path, entry_name) - # files in $HOME have higher priority than dropins - if not path.startswith(xdg.BaseDirectory.xdg_config_home): - entry = open_desktop_entry_and_dropins(entry_path) - else: - entry = DesktopEntry(entry_path) - if entry_should_be_started(entry, environments): - launch(entry_path) + try: + entry_path = os.path.join(path, entry_name) + # files in $HOME have higher priority than dropins + if not path.startswith(xdg.BaseDirectory.xdg_config_home): + entry = open_desktop_entry_and_dropins(entry_path) + else: + entry = DesktopEntry(entry_path) + if entry_should_be_started(entry, environments): + launch(entry_path) + except Exception as e: + print >>sys.stderr, "Failed to process '{}': {}".format( + entry_name, str(e) + ) def main(): process_autostart(sys.argv[1:]) From 0b7ade11b868babe44c73e1a502cdd44487abac9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Fri, 28 Aug 2015 02:02:19 +0200 Subject: [PATCH 5/7] qubes-desktop-run: don't crash on Debian wheezy (glib < 2.36) Gio.DesktopAppInfo.get_boolean was introduced in glib 2.36. Instead of crashing simply do not support DBusActivatable there. There is no such application in default Debian wheezy template anyway. --- misc/xdg.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/misc/xdg.py b/misc/xdg.py index c070077..205602f 100755 --- a/misc/xdg.py +++ b/misc/xdg.py @@ -6,13 +6,14 @@ import dbus def launch(desktop, *files): launcher = Gio.DesktopAppInfo.new_from_filename(desktop) - activatable = launcher.get_boolean('DBusActivatable') - if activatable: - bus = dbus.SessionBus() - service_id = launcher.get_id() - # cut the .desktop suffix - service_id = service_id[:-8] - bus.start_service_by_name(service_id) + if hasattr(launcher, 'get_boolean'): + activatable = launcher.get_boolean('DBusActivatable') + if activatable: + bus = dbus.SessionBus() + service_id = launcher.get_id() + # cut the .desktop suffix + service_id = service_id[:-8] + bus.start_service_by_name(service_id) launcher.launch(files, None) if __name__ == "__main__": From 4f26006fa1f219ecefc271efa08a0d6181e8a3c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Tue, 1 Sep 2015 17:19:38 +0200 Subject: [PATCH 6/7] debian: fix /dev permissions on upgrade --- debian/qubes-core-agent.preinst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/debian/qubes-core-agent.preinst b/debian/qubes-core-agent.preinst index 9203259..9c81507 100755 --- a/debian/qubes-core-agent.preinst +++ b/debian/qubes-core-agent.preinst @@ -64,6 +64,8 @@ if [ "$1" = "upgrade" ] ; then if grep -q ^qubes:x:98: /etc/group ; then if ! grep -q :980: /etc/group ; then if groupmod -g 980 qubes ; then + # make sure that vchan will still work until VM start + chmod 666 /dev/xen/* /proc/xen/privcmd find / -gid 98 ! -type l -exec chgrp --verbose qubes {} \; 2>/dev/null || true fi fi From c09d1d9d61baab022110adf597af2eb8b6d2a754 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Tue, 1 Sep 2015 17:19:59 +0200 Subject: [PATCH 7/7] systemd: fix starting cups --- vm-systemd/misc-post.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vm-systemd/misc-post.sh b/vm-systemd/misc-post.sh index 7f0659f..f5c0025 100755 --- a/vm-systemd/misc-post.sh +++ b/vm-systemd/misc-post.sh @@ -26,7 +26,7 @@ INTERFACE=eth0 /usr/lib/qubes/setup-ip # Start services which haven't own proper systemd unit: -if [ ! -f /etc/systemd/system/cups.service ]; then +if [ ! -f /usr/lib/systemd/system/cups.service ]; then if [ -f /var/run/qubes-service/cups ]; then /usr/sbin/service cups start fi