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()
|
||||
except ipc.DBusException:
|
||||
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()
|
||||
except ImportError:
|
||||
dbg('dbus not imported')
|
||||
|
|
|
@ -59,12 +59,17 @@ class DBusService(Borg, dbus.service.Object):
|
|||
self.terminator = Terminator()
|
||||
|
||||
@dbus.service.method(BUS_NAME)
|
||||
def new_window(self, layout='default'):
|
||||
def new_window(self, layout, command=''):
|
||||
"""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.layout_done()
|
||||
|
||||
|
||||
@dbus.service.method(BUS_NAME)
|
||||
def terminal_hsplit(self, uuid=None):
|
||||
"""Split a terminal horizontally, by UUID"""
|
||||
|
@ -103,9 +108,9 @@ def with_proxy(func):
|
|||
return _exec
|
||||
|
||||
@with_proxy
|
||||
def new_window(session, layout='default'):
|
||||
def new_window(session, layout='default', command=''):
|
||||
"""Call the dbus method to open a new window"""
|
||||
session.new_window(layout)
|
||||
session.new_window(layout, command)
|
||||
|
||||
@with_proxy
|
||||
def terminal_hsplit(session, uuid):
|
||||
|
|
Loading…
Reference in New Issue