Merge branch 'feature/add-command-line-command-to-reload-configuration' of https://github.com/dantecalderon/terminator into dantecalderon-feature/add-command-line-command-to-reload-configuration
This commit is contained in:
commit
3c2d1ef047
11
terminator
11
terminator
|
@ -90,6 +90,12 @@ if __name__ == '__main__':
|
||||||
import dbus
|
import dbus
|
||||||
try:
|
try:
|
||||||
dbus_service = ipc.DBusService()
|
dbus_service = ipc.DBusService()
|
||||||
|
|
||||||
|
if(OPTIONS.reload):
|
||||||
|
# Reload only is executed when exist at least one window,
|
||||||
|
# if not there is nothing to reload
|
||||||
|
sys.exit()
|
||||||
|
|
||||||
except ipc.DBusException:
|
except ipc.DBusException:
|
||||||
dbg('Unable to become master process, operating via DBus')
|
dbg('Unable to become master process, operating via DBus')
|
||||||
# get rid of the None and True types so dbus can handle them (empty
|
# get rid of the None and True types so dbus can handle them (empty
|
||||||
|
@ -105,6 +111,11 @@ if __name__ == '__main__':
|
||||||
elif OPTIONS.toggle_visibility:
|
elif OPTIONS.toggle_visibility:
|
||||||
dbg('requesting to toggle windows visibility')
|
dbg('requesting to toggle windows visibility')
|
||||||
ipc.toggle_visibility_cmdline(optionslist)
|
ipc.toggle_visibility_cmdline(optionslist)
|
||||||
|
|
||||||
|
if OPTIONS.reload:
|
||||||
|
dbg('requesting to reload configuration for all windows')
|
||||||
|
ipc.reload_configuration()
|
||||||
|
|
||||||
elif OPTIONS.unhide:
|
elif OPTIONS.unhide:
|
||||||
print('requesting to unhide windows')
|
print('requesting to unhide windows')
|
||||||
ipc.unhide_cmdline(optionslist)
|
ipc.unhide_cmdline(optionslist)
|
||||||
|
|
|
@ -130,6 +130,12 @@ class DBusService(Borg, dbus.service.Object):
|
||||||
"""Create a new tab"""
|
"""Create a new tab"""
|
||||||
return self.new_terminal(uuid, 'tab')
|
return self.new_terminal(uuid, 'tab')
|
||||||
|
|
||||||
|
@dbus.service.method(BUS_NAME)
|
||||||
|
def reload_configuration(self):
|
||||||
|
"""Reload configuration for all terminals"""
|
||||||
|
self.terminator.config.base.reload()
|
||||||
|
self.terminator.reconfigure()
|
||||||
|
|
||||||
@dbus.service.method(BUS_NAME)
|
@dbus.service.method(BUS_NAME)
|
||||||
def bg_img_all (self,options=dbus.Dictionary()):
|
def bg_img_all (self,options=dbus.Dictionary()):
|
||||||
for terminal in self.terminator.terminals:
|
for terminal in self.terminator.terminals:
|
||||||
|
@ -353,6 +359,10 @@ def new_tab_cmdline(session, options):
|
||||||
def toggle_visibility_cmdline(session,options):
|
def toggle_visibility_cmdline(session,options):
|
||||||
session.toggle_visibility_cmdline(options)
|
session.toggle_visibility_cmdline(options)
|
||||||
|
|
||||||
|
def reload_configuration(session):
|
||||||
|
"""Call the dbus method to reload configuration for all windows"""
|
||||||
|
session.reload_configuration()
|
||||||
|
|
||||||
@with_proxy
|
@with_proxy
|
||||||
def unhide_cmdline(session,options):
|
def unhide_cmdline(session,options):
|
||||||
session.unhide_cmdline(options)
|
session.unhide_cmdline(options)
|
||||||
|
|
|
@ -39,6 +39,9 @@ def parse_options():
|
||||||
|
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
|
|
||||||
|
parser.add_argument('-R', '--reload', action='store_true', dest='reload',
|
||||||
|
help=_('Reload terminator configuration'))
|
||||||
|
|
||||||
parser.add_argument('-v', '--version', action='store_true', dest='version',
|
parser.add_argument('-v', '--version', action='store_true', dest='version',
|
||||||
help=_('Display program version'))
|
help=_('Display program version'))
|
||||||
parser.add_argument('-m', '--maximise', action='store_true', dest='maximise',
|
parser.add_argument('-m', '--maximise', action='store_true', dest='maximise',
|
||||||
|
|
Loading…
Reference in New Issue