From f387f4886c068e610eaf45cba92fa09f6de8024d Mon Sep 17 00:00:00 2001 From: David Levanon Date: Thu, 24 Sep 2020 15:19:58 +0300 Subject: [PATCH] set default profile from the json file --- terminator | 5 ++++- terminatorlib/configjson.py | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/terminator b/terminator index 89e6b5c9..808888c7 100755 --- a/terminator +++ b/terminator @@ -70,9 +70,12 @@ if __name__ == '__main__': OPTIONS,dbus_options = terminatorlib.optionparse.parse_options() if OPTIONS.configjson: - layoutname = ConfigJson().extend_config(OPTIONS.configjson) + configjson = ConfigJson() + layoutname = configjson.extend_config(OPTIONS.configjson) if layoutname and ((not OPTIONS.layout) or OPTIONS.layout == 'default'): OPTIONS.layout = layoutname + if not OPTIONS.profile: + OPTIONS.profile = configjson.get_profile_to_use() TERMINATOR = Terminator() TERMINATOR.set_origcwd(ORIGCWD) diff --git a/terminatorlib/configjson.py b/terminatorlib/configjson.py index d6b5972b..48c6ab5a 100644 --- a/terminatorlib/configjson.py +++ b/terminatorlib/configjson.py @@ -9,8 +9,10 @@ JSON_PROFILE_NAME = "__internal_json_profile__" JSON_LAYOUT_NAME = "__internal_json_layout__" class ConfigJson(object): - profile_to_use = 'default' + + def get_profile_to_use(self): + return self.profile_to_use def build_single_tab_layout(self, layoutjson, vertical): dbg ('Budiling a single tab layout from json: %s ' % layoutjson)