rename: update config file paths

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2019-10-23 19:54:16 +01:00
parent 8ddbebb5d1
commit ed0e686f37
No known key found for this signature in database
GPG Key ID: 37C999F617EA1A47
1 changed files with 8 additions and 1 deletions

View File

@ -39,7 +39,8 @@ static inline int lcfg_lookup_bool(const config_t *config, const char *path, boo
/// Search for config file under a base directory
FILE *open_config_file_at(const char *base, char **out_path) {
static const char *config_paths[] = {"/compton.conf", "/compton/compton.conf"};
static const char *config_paths[] = {"/picom.conf", "/picom/picom.conf",
"/compton.conf", "/compton/compton.conf"};
for (size_t i = 0; i < ARR_SIZE(config_paths); i++) {
char *path = mstrjoin(base, config_paths[i]);
FILE *ret = fopen(path, "r");
@ -49,6 +50,12 @@ FILE *open_config_file_at(const char *base, char **out_path) {
free(path);
}
if (ret) {
if (strstr(config_paths[i], "compton")) {
log_warn("This compositor has been renamed to \"picom\", "
"the old config file paths is deprecated. "
"Please replace the \"compton\"s in the path "
"with \"picom\"");
}
return ret;
}
}