diff --git a/config_parsing.py b/config_parsing.py index 9d128dc..f4afc90 100644 --- a/config_parsing.py +++ b/config_parsing.py @@ -17,7 +17,7 @@ def get_validated_config(filename): Optional("line_color"): Regex(r'^#[0-9a-fA-F]{3}$|^#[0-9a-fA-F]{6}$|^#[0-9a-fA-F]{8}$'), Optional("padding", default=" "): str, Optional("seperator", default="|"): str, - Optional("global_padding", default=""): str + Optional("margin", default=""): str }, "modules": [ { diff --git a/example_config.yml b/example_config.yml index e171608..2490068 100644 --- a/example_config.yml +++ b/example_config.yml @@ -38,9 +38,8 @@ bar: # Seperator between modules. Module formatting options are not applied to # the seperator. seperator: "|" - # Padding on either end of the bar itself. This will be placed before and - # after all text on the bar. - global_padding: "" + # Text to be placed on both ends of the bar, before and after all text. + margin: "" # Here is where you can define a list your individual modules. You can define # as many modules as you want. Some fields are required; these will be diff --git a/main.py b/main.py index efb3b7b..d4ee27e 100644 --- a/main.py +++ b/main.py @@ -9,7 +9,7 @@ def print_bar(): for alignment in running_modules_dict: match alignment: case "left": - print("%{l}" + global_padding, end="") + print("%{l}" + margin, end="") case "center": print("%{c}", end="") case "right": @@ -27,7 +27,7 @@ def print_bar(): print(seperator, end="") break; if alignment == "right": - print(global_padding, end="") + print(margin, end="") print(flush=True) @@ -53,12 +53,12 @@ def new_module_thread(alignment, pre, name, prefix, command, post, refresh): def main(): global padding global seperator - global global_padding + global margin config = get_validated_config("./testing_config.yml") padding = config["bar"]["config"]["padding"] seperator = config["bar"]["config"]["seperator"] - global_padding = config["bar"]["config"]["global_padding"] + margin = config["bar"]["config"]["margin"] modules = config["bar"]["modules"]