rename: update config file paths
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
parent
8ddbebb5d1
commit
ed0e686f37
|
@ -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
|
/// Search for config file under a base directory
|
||||||
FILE *open_config_file_at(const char *base, char **out_path) {
|
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++) {
|
for (size_t i = 0; i < ARR_SIZE(config_paths); i++) {
|
||||||
char *path = mstrjoin(base, config_paths[i]);
|
char *path = mstrjoin(base, config_paths[i]);
|
||||||
FILE *ret = fopen(path, "r");
|
FILE *ret = fopen(path, "r");
|
||||||
|
@ -49,6 +50,12 @@ FILE *open_config_file_at(const char *base, char **out_path) {
|
||||||
free(path);
|
free(path);
|
||||||
}
|
}
|
||||||
if (ret) {
|
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;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue