增加配置重载

This commit is contained in:
DreamMaoMao 2025-02-16 20:21:55 +08:00
parent 38138d6ec0
commit 1d58841bfd
3 changed files with 9 additions and 1 deletions

View file

@ -31,3 +31,4 @@ void incgaps(const Arg *arg);
void focusmon(const Arg *arg); void focusmon(const Arg *arg);
void focusstack(const Arg *arg); void focusstack(const Arg *arg);
void chvt(const Arg *arg); void chvt(const Arg *arg);
void reload_config(const Arg *arg);

View file

@ -4452,6 +4452,11 @@ void parse_config(void) {
} }
void reload_config(const Arg *arg) {
free_config();
parse_config();
}
void setup(void) { void setup(void) {

View file

@ -347,6 +347,8 @@ FuncType parse_func_name(char *func_name,Arg *arg, char *arg_value) {
func = viewtoleft_have_client; func = viewtoleft_have_client;
} else if (strcmp(func_name, "viewtoright_have_client") == 0) { } else if (strcmp(func_name, "viewtoright_have_client") == 0) {
func = viewtoright_have_client; func = viewtoright_have_client;
} else if (strcmp(func_name, "reload_config") == 0) {
func = reload_config;
} else { } else {
return NULL; return NULL;
} }