Merge pull request #471 from mattrose/switch_profile_all
add switch_profile_all command to remotinator
This commit is contained in:
commit
045e8f57f2
|
@ -48,6 +48,7 @@ COMMANDS={
|
|||
'get_tab_title': [True, _('Get the title of a parent tab')],
|
||||
'set_tab_title': [True, _('Set the title of a parent tab')],
|
||||
'switch_profile': [True, _('Switch current terminal profile')],
|
||||
'switch_profile_all': [False, _('Switch profile of all currently running terminals')],
|
||||
}
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
|
@ -290,6 +290,14 @@ class DBusService(Borg, dbus.service.Object):
|
|||
profile_name = options.get('profile')
|
||||
terminal.force_set_profile(False, profile_name)
|
||||
|
||||
@dbus.service.method(BUS_NAME)
|
||||
def switch_profile_all(self, options=dbus.Dictionary()):
|
||||
"""Switch profile of a given terminal"""
|
||||
for terminal in self.terminator.terminals:
|
||||
profile_name = options.get('profile')
|
||||
terminal.force_set_profile(False, profile_name)
|
||||
|
||||
|
||||
def with_proxy(func):
|
||||
"""Decorator function to connect to the session dbus bus"""
|
||||
dbg('dbus client call: %s' % func.__name__)
|
||||
|
@ -390,3 +398,7 @@ def switch_profile(session, uuid, options):
|
|||
"""Call the dbus method to return the title of a tab"""
|
||||
session.switch_profile(uuid, options)
|
||||
|
||||
@with_proxy
|
||||
def switch_profile_all(session,options):
|
||||
"""Call the dbus method to return the title of a tab"""
|
||||
session.switch_profile_all(options)
|
||||
|
|
Loading…
Reference in New Issue