Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add parameters to remotinator split commands #472

Merged
merged 1 commit into from
Jul 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions remotinator
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,15 @@ if __name__ == '__main__':
parser.add_argument('-p', '--profile', dest='profile', type=str, default=argparse.SUPPRESS,
help=_('Terminal UUID for when not in env var TERMINATOR_UUID'))

parser.add_argument('-x', '--execute', dest='execute', type=str, default=argparse.SUPPRESS,
help=_('Terminal UUID for when not in env var TERMINATOR_UUID'))

parser.add_argument('-t', '--tab-title', dest='tab-title', type=str, default="Missing Tab Title! Use -t argument!",
help=_('Tab name to set. Only used with "set_tab_title" command.'))

parser.add_argument('-T', '--title', dest='title', type=str, default=argparse.SUPPRESS,
help=_('Tab name to set.'))

parser.add_argument('-v', '--version', action='version', version='%%(prog)s %s' %(APP_VERSION))

options = vars(parser.parse_args()) # Straight to dict
Expand Down
22 changes: 16 additions & 6 deletions terminatorlib/ipc.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,24 @@ def new_tab(self, uuid=None):
return self.new_terminal(uuid, 'tab')

@dbus.service.method(BUS_NAME)
def hsplit(self, uuid=None):
def hsplit(self, uuid=None,options=None):
"""Split a terminal horizontally, by UUID"""
return self.new_terminal(uuid, 'hsplit')
if options:
cmd = options.get('execute')
title = options.get('title')
return self.new_terminal_cmd(uuid=uuid, title=title, cmd=cmd, split_vert=True)
else:
return self.new_terminal(uuid, 'hsplit')

@dbus.service.method(BUS_NAME)
def vsplit(self, uuid=None):
def vsplit(self, uuid=None,options=None):
"""Split a terminal vertically, by UUID"""
return self.new_terminal(uuid, 'vsplit')
if options:
cmd = options.get('execute')
title = options.get('title')
return self.new_terminal_cmd(uuid=uuid, title=title, cmd=cmd, split_vert=False)
else:
return self.new_terminal(uuid, 'vsplit')

def get_terminal_container(self, terminal, container=None):
terminator = Terminator()
Expand Down Expand Up @@ -341,12 +351,12 @@ def new_tab(session, uuid, options):
@with_proxy
def hsplit(session, uuid, options):
"""Call the dbus method to horizontally split a terminal"""
print(session.hsplit(uuid))
print(session.hsplit(uuid,options))

@with_proxy
def vsplit(session, uuid, options):
"""Call the dbus method to vertically split a terminal"""
print(session.vsplit(uuid))
print(session.vsplit(uuid,options))

@with_proxy
def vsplit_cmd(session, uuid, title, cmd, options):
Expand Down