Added a parameter to the dbus method new_window, to allow the passing of the
command to execute.
This commit is contained in:
parent
ce9e8d8453
commit
d76b0dee7f
|
@ -66,7 +66,7 @@ if __name__ == '__main__':
|
||||||
dbus_service = ipc.DBusService()
|
dbus_service = ipc.DBusService()
|
||||||
except ipc.DBusException:
|
except ipc.DBusException:
|
||||||
dbg('Unable to become master process, requesting a new window')
|
dbg('Unable to become master process, requesting a new window')
|
||||||
ipc.new_window(OPTIONS.layout)
|
ipc.new_window(OPTIONS.layout, OPTIONS.command or '')
|
||||||
sys.exit()
|
sys.exit()
|
||||||
except ImportError:
|
except ImportError:
|
||||||
dbg('dbus not imported')
|
dbg('dbus not imported')
|
||||||
|
|
|
@ -59,12 +59,17 @@ class DBusService(Borg, dbus.service.Object):
|
||||||
self.terminator = Terminator()
|
self.terminator = Terminator()
|
||||||
|
|
||||||
@dbus.service.method(BUS_NAME)
|
@dbus.service.method(BUS_NAME)
|
||||||
def new_window(self, layout='default'):
|
def new_window(self, layout, command=''):
|
||||||
"""Create a new Window"""
|
"""Create a new Window"""
|
||||||
dbg('dbus method called: new_window')
|
dbg('dbus method called: new_window with parameters %s, %s'%(layout, command))
|
||||||
|
if command:
|
||||||
|
options = self.terminator.config.options_get()
|
||||||
|
options.command = command
|
||||||
|
self.terminator.config.options_set(options)
|
||||||
self.terminator.create_layout(layout)
|
self.terminator.create_layout(layout)
|
||||||
self.terminator.layout_done()
|
self.terminator.layout_done()
|
||||||
|
|
||||||
|
|
||||||
@dbus.service.method(BUS_NAME)
|
@dbus.service.method(BUS_NAME)
|
||||||
def terminal_hsplit(self, uuid=None):
|
def terminal_hsplit(self, uuid=None):
|
||||||
"""Split a terminal horizontally, by UUID"""
|
"""Split a terminal horizontally, by UUID"""
|
||||||
|
@ -103,9 +108,9 @@ def with_proxy(func):
|
||||||
return _exec
|
return _exec
|
||||||
|
|
||||||
@with_proxy
|
@with_proxy
|
||||||
def new_window(session, layout='default'):
|
def new_window(session, layout='default', command=''):
|
||||||
"""Call the dbus method to open a new window"""
|
"""Call the dbus method to open a new window"""
|
||||||
session.new_window(layout)
|
session.new_window(layout, command)
|
||||||
|
|
||||||
@with_proxy
|
@with_proxy
|
||||||
def terminal_hsplit(session, uuid):
|
def terminal_hsplit(session, uuid):
|
||||||
|
|
Loading…
Reference in New Issue