fixed major bug where it read the wrong config

This commit is contained in:
Noah Swerhun 2023-04-03 14:03:37 -05:00
parent 65195e1976
commit edb8e97d04

View file

@ -1,4 +1,6 @@
from parse_config_file import get_bar_config_and_module_config_list
from os import getenv
from os.path import exists
def generate_flags(bar_config):
flags = ""
@ -26,6 +28,11 @@ def generate_flags(bar_config):
flags += (" -U '" + bar_config[option] + "'")
return flags.strip()
bar_config, module_config_list = get_bar_config_and_module_config_list("/home/noah/src/easyconf-lemonbar/data/testing_config.yml")
if exists("./data/testing_config.yml"):
config_file = "./data/testing_config.yml"
else:
config_file = str(getenv("HOME")) + "/.config/easyconf-lemonbar.yml"
bar_config, module_config_list = get_bar_config_and_module_config_list(config_file)
print(generate_flags(bar_config))