Revert "qubes-desktop-run: Activate via DBUS when desktop file contains DBusActivatable"
This reverts commit a5ee90b420
.
Lets start the Dbus service the proper way.
This commit is contained in:
parent
c6fa6c9b19
commit
0c2306dd0a
@ -1,36 +1,11 @@
|
|||||||
#! /usr/bin/env python
|
#!/usr/bin/python
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
# vim: set ft=python ts=4 sw=4 sts=4 et :
|
|
||||||
|
|
||||||
import sys
|
|
||||||
import subprocess
|
|
||||||
|
|
||||||
from gi.repository import Gio
|
from gi.repository import Gio
|
||||||
|
import sys
|
||||||
|
|
||||||
def main(myname, desktop, *files):
|
def main(myname, desktop, *files):
|
||||||
info = Gio.DesktopAppInfo()
|
launcher = Gio.DesktopAppInfo.new_from_filename(desktop)
|
||||||
dbus_activate = False
|
launcher.launch(files, None)
|
||||||
|
|
||||||
try:
|
|
||||||
launcher = info.new_from_filename(desktop)
|
|
||||||
except TypeError:
|
|
||||||
launcher = None
|
|
||||||
|
|
||||||
if launcher:
|
|
||||||
try:
|
|
||||||
dbus_activate = launcher.get_boolean('DBusActivatable')
|
|
||||||
except AttributeError:
|
|
||||||
dbus_activate = False
|
|
||||||
|
|
||||||
if not dbus_activate:
|
|
||||||
launcher.launch(files, None)
|
|
||||||
|
|
||||||
else:
|
|
||||||
if dbus_activate:
|
|
||||||
cmd = ['gapplication', 'launch', launcher.get_id().replace('.desktop', '')]
|
|
||||||
if files:
|
|
||||||
cmd.extend(files)
|
|
||||||
process = subprocess.Popen(cmd, close_fds=True)
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main(*sys.argv)
|
main(*sys.argv)
|
||||||
|
Loading…
Reference in New Issue
Block a user