qubes-desktop-run: start the Dbus service (if needed)
Much tidier way to solve the issue, provided by @Unman.
qubesos/qubes-issues#1031
(cherry picked from commit 93e090469c
)
This commit is contained in:
parent
e5e01ba89a
commit
fb5e8e85c5
|
@ -2,9 +2,17 @@
|
|||
|
||||
from gi.repository import Gio
|
||||
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__":
|
||||
|
|
Loading…
Reference in New Issue
Block a user