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