Skip to content

Commit

Permalink
add a commandline flag to unhide any windows
Browse files Browse the repository at this point in the history
  • Loading branch information
mattrose committed Nov 26, 2020
1 parent 40bd594 commit cdb5755
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions terminator
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ if __name__ == '__main__':
if OPTIONS.new_tab:
dbg('Requesting a new tab')
ipc.new_tab_cmdline(optionslist)
elif OPTIONS.unhide:
print('requesting to unhide windows')
ipc.unhide_cmdline(optionslist)
else:
dbg('Requesting a new window')
ipc.new_window_cmdline(optionslist)
Expand Down
11 changes: 11 additions & 0 deletions terminatorlib/ipc.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,13 @@ def new_tab_cmdline(self, options=dbus.Dictionary()):
window = self.terminator.get_windows()[0]
window.tab_new()

@dbus.service.method(BUS_NAME, in_signature='a{ss}')
def unhide_cmdline(self,options=dbus.Dictionary):
dbg('unhide_cmdline')
for window in self.terminator.get_windows():
if not window.get_property('visible'):
window.on_hide_window()

@dbus.service.method(BUS_NAME)
def new_window(self):
"""Create a new Window"""
Expand Down Expand Up @@ -216,6 +223,10 @@ def new_tab_cmdline(session, options):
"""Call the dbus method to open a new tab in the first window"""
session.new_tab_cmdline(options)

@with_proxy
def unhide_cmdline(session,options):
session.unhide_cmdline(options)

@with_proxy
def new_window(session, options):
"""Call the dbus method to open a new window"""
Expand Down
3 changes: 3 additions & 0 deletions terminatorlib/optionparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ def parse_options():
help=_('Comma separated list of methods to limit debugging to'))
parser.add_option('--new-tab', action='store_true', dest='new_tab',
help=_('If Terminator is already running, just open a new tab'))
parser.add_option('--unhide', action='store_true', dest='unhide',
help=_('If Terminator is already running, just unhide all hidden windows'))

for item in ['--sm-client-id', '--sm-config-prefix', '--screen', '-n',
'--no-gconf' ]:
parser.add_option(item, dest='dummy', action='store',
Expand Down

0 comments on commit cdb5755

Please sign in to comment.