diff --git a/dispatch.h b/dispatch.h index 89af3f7e..4e7e168f 100644 --- a/dispatch.h +++ b/dispatch.h @@ -30,4 +30,5 @@ void incnmaster(const Arg *arg); void incgaps(const Arg *arg); void focusmon(const Arg *arg); void focusstack(const Arg *arg); -void chvt(const Arg *arg); \ No newline at end of file +void chvt(const Arg *arg); +void reload_config(const Arg *arg); \ No newline at end of file diff --git a/maomao.c b/maomao.c index 47a71018..ec3cca57 100644 --- a/maomao.c +++ b/maomao.c @@ -4452,6 +4452,11 @@ void parse_config(void) { } +void reload_config(const Arg *arg) { + free_config(); + parse_config(); +} + void setup(void) { diff --git a/parse_config.h b/parse_config.h index 9fe34d41..4539c77a 100644 --- a/parse_config.h +++ b/parse_config.h @@ -347,6 +347,8 @@ FuncType parse_func_name(char *func_name,Arg *arg, char *arg_value) { func = viewtoleft_have_client; } else if (strcmp(func_name, "viewtoright_have_client") == 0) { func = viewtoright_have_client; + } else if (strcmp(func_name, "reload_config") == 0) { + func = reload_config; } else { return NULL; }