From f20b437cafba8930ed8c0b72a0898a89fcd3db44 Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Thu, 22 Jul 2010 13:59:06 +0100 Subject: [PATCH] Allow disabling of dbus from the command line, and make use of that when spawning a new terminator process --- terminator | 3 +++ terminatorlib/optionparse.py | 2 ++ terminatorlib/terminal.py | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/terminator b/terminator index 4b919a1e..5c344aca 100755 --- a/terminator +++ b/terminator @@ -56,6 +56,9 @@ if __name__ == '__main__': # being False will cause us to continue without the dbus server and open a # window. try: + if OPTIONS.nodbus: + dbg('dbus disabled by command line') + raise ImportError from terminatorlib import ipc try: ipc.DBusService() diff --git a/terminatorlib/optionparse.py b/terminatorlib/optionparse.py index 3d783cef..55cda32b 100755 --- a/terminatorlib/optionparse.py +++ b/terminatorlib/optionparse.py @@ -68,6 +68,8 @@ WM_WINDOW_ROLE property on the window') parser.add_option('-l', '--layout', dest='layout', help='Select a layout') parser.add_option('-p', '--profile', dest='profile', help='Use a \ different profile as the default') + parser.add_option('-u', '--no-dbus', action='store_true', dest='nodbus', + help='Disable DBus') parser.add_option('-d', '--debug', action='count', dest='debug', help='Enable debugging information (twice for debug server)') parser.add_option('--debug-classes', action='store', dest='debug_classes', diff --git a/terminatorlib/terminal.py b/terminatorlib/terminal.py index 43908c8a..528c8883 100755 --- a/terminatorlib/terminal.py +++ b/terminatorlib/terminal.py @@ -1509,7 +1509,7 @@ for %s (%s)' % (name, urlplugin.__class__.__name__)) return False dbg("Terminal::key_new_window: Spawning: %s" % cmd) - subprocess.Popen([cmd, ]) + subprocess.Popen([cmd, '-u']) def key_broadcast_off(self): self.set_groupsend(None, self.terminator.groupsend_type['off'])