diff --git a/bpytop.py b/bpytop.py index 55c99ad..9edc1a9 100755 --- a/bpytop.py +++ b/bpytop.py @@ -241,7 +241,13 @@ update_check=$update_check log_level=$log_level ''') -CONFIG_DIR: str = f'{os.path.expanduser("~")}/.config/bpytop' + +def get_config_dir(): + config_home = os.environ.get("XDG_CONFIG_HOME", os.path.expanduser("~/.config")) + return os.path.join(config_home, 'bpytop') + + +CONFIG_DIR: str = get_config_dir() if not os.path.isdir(CONFIG_DIR): try: os.makedirs(CONFIG_DIR)