add switch_profile_all command to remotinator
This commit is contained in:
parent
27555de35f
commit
550ccf7abf
|
@ -48,6 +48,7 @@ COMMANDS={
|
||||||
'get_tab_title': [True, _('Get the title of a parent tab')],
|
'get_tab_title': [True, _('Get the title of a parent tab')],
|
||||||
'set_tab_title': [True, _('Set 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': [True, _('Switch current terminal profile')],
|
||||||
|
'switch_profile_all': [False, _('Switch profile of all currently running terminals')],
|
||||||
}
|
}
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
|
@ -290,6 +290,14 @@ class DBusService(Borg, dbus.service.Object):
|
||||||
profile_name = options.get('profile')
|
profile_name = options.get('profile')
|
||||||
terminal.force_set_profile(False, profile_name)
|
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):
|
def with_proxy(func):
|
||||||
"""Decorator function to connect to the session dbus bus"""
|
"""Decorator function to connect to the session dbus bus"""
|
||||||
dbg('dbus client call: %s' % func.__name__)
|
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"""
|
"""Call the dbus method to return the title of a tab"""
|
||||||
session.switch_profile(uuid, options)
|
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