Merge pull request #307 from mattrose/unhide

add a commandline flag to unhide any windows
This commit is contained in:
Matt Rose 2020-12-01 21:03:42 +00:00 committed by GitHub
commit 904676057e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 0 deletions

View File

@ -108,6 +108,9 @@ if __name__ == '__main__':
if OPTIONS.new_tab: if OPTIONS.new_tab:
dbg('Requesting a new tab') dbg('Requesting a new tab')
ipc.new_tab_cmdline(optionslist) ipc.new_tab_cmdline(optionslist)
elif OPTIONS.unhide:
print('requesting to unhide windows')
ipc.unhide_cmdline(optionslist)
else: else:
dbg('Requesting a new window') dbg('Requesting a new window')
ipc.new_window_cmdline(optionslist) ipc.new_window_cmdline(optionslist)

View File

@ -86,6 +86,13 @@ class DBusService(Borg, dbus.service.Object):
window = self.terminator.get_windows()[0] window = self.terminator.get_windows()[0]
window.tab_new() 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) @dbus.service.method(BUS_NAME)
def new_window(self): def new_window(self):
"""Create a new Window""" """Create a new Window"""
@ -216,6 +223,10 @@ def new_tab_cmdline(session, options):
"""Call the dbus method to open a new tab in the first window""" """Call the dbus method to open a new tab in the first window"""
session.new_tab_cmdline(options) session.new_tab_cmdline(options)
@with_proxy
def unhide_cmdline(session,options):
session.unhide_cmdline(options)
@with_proxy @with_proxy
def new_window(session, options): def new_window(session, options):
"""Call the dbus method to open a new window""" """Call the dbus method to open a new window"""

View File

@ -102,6 +102,9 @@ icon for the window (by file or name)'))
help=_('Comma separated list of methods to limit debugging to')) help=_('Comma separated list of methods to limit debugging to'))
parser.add_option('--new-tab', action='store_true', dest='new_tab', parser.add_option('--new-tab', action='store_true', dest='new_tab',
help=_('If Terminator is already running, just open a 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', for item in ['--sm-client-id', '--sm-config-prefix', '--screen', '-n',
'--no-gconf' ]: '--no-gconf' ]:
parser.add_option(item, dest='dummy', action='store', parser.add_option(item, dest='dummy', action='store',