wmfs: New feature: Reload configuration function
This commit is contained in:
parent
d363754ff9
commit
ac979c847b
10
src/config.c
10
src/config.c
@ -55,7 +55,8 @@ func_name_list_t func_list[] =
|
|||||||
{"mouse_resize", uicb_mouse_resize },
|
{"mouse_resize", uicb_mouse_resize },
|
||||||
{"client_raise", uicb_client_raise },
|
{"client_raise", uicb_client_raise },
|
||||||
{"tile_switch", uicb_tile_switch },
|
{"tile_switch", uicb_tile_switch },
|
||||||
{"toggle_free", uicb_togglefree }
|
{"toggle_free", uicb_togglefree },
|
||||||
|
{"reload", uicb_reload }
|
||||||
};
|
};
|
||||||
|
|
||||||
func_name_list_t layout_list[] =
|
func_name_list_t layout_list[] =
|
||||||
@ -408,6 +409,13 @@ init_conf(void)
|
|||||||
mouse_section(conf.titlebar.mouse, cfgtmp, conf.titlebar.nmouse);
|
mouse_section(conf.titlebar.mouse, cfgtmp, conf.titlebar.nmouse);
|
||||||
|
|
||||||
/* layout */
|
/* layout */
|
||||||
|
/* Set conf.layout NULL for conf reload */
|
||||||
|
for(i = 0; i < NUM_OF_LAYOUT; ++i)
|
||||||
|
{
|
||||||
|
conf.layout[i].symbol = NULL;
|
||||||
|
conf.layout[i].func = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
conf.colors.layout_fg = strdup(var_to_str(cfg_getstr(cfg_layouts, "fg")));
|
conf.colors.layout_fg = strdup(var_to_str(cfg_getstr(cfg_layouts, "fg")));
|
||||||
conf.colors.layout_bg = getcolor(var_to_str(cfg_getstr(cfg_layouts, "bg")));
|
conf.colors.layout_bg = getcolor(var_to_str(cfg_getstr(cfg_layouts, "bg")));
|
||||||
|
|
||||||
|
|||||||
18
src/wmfs.c
18
src/wmfs.c
@ -82,7 +82,6 @@ quit(void)
|
|||||||
/* Unmanage all clients */
|
/* Unmanage all clients */
|
||||||
for(c = clients; c; c = c->next)
|
for(c = clients; c; c = c->next)
|
||||||
{
|
{
|
||||||
XReparentWindow(dpy, c->win, root, c->frame_geo.x, c->frame_geo.y);
|
|
||||||
if(c->hide)
|
if(c->hide)
|
||||||
client_unhide(c);
|
client_unhide(c);
|
||||||
if(c->unmapped)
|
if(c->unmapped)
|
||||||
@ -199,6 +198,23 @@ scan(void)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
uicb_reload(uicb_t cmd)
|
||||||
|
{
|
||||||
|
/* If there is a bar size changement */
|
||||||
|
bar_unmap_subwin(infobar->bar);
|
||||||
|
bar_unmap(infobar->bar);
|
||||||
|
|
||||||
|
init_conf();
|
||||||
|
init();
|
||||||
|
scan();
|
||||||
|
|
||||||
|
mainloop();
|
||||||
|
raise(SIGTERM);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/** Signal handle function
|
/** Signal handle function
|
||||||
* \param signum Signal number
|
* \param signum Signal number
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -218,6 +218,7 @@ void mainloop(void);
|
|||||||
void scan(void);
|
void scan(void);
|
||||||
void handle_signal(int signum);
|
void handle_signal(int signum);
|
||||||
void uicb_quit(uicb_t);
|
void uicb_quit(uicb_t);
|
||||||
|
void uicb_reload(uicb_t cmd);
|
||||||
|
|
||||||
/* Variables */
|
/* Variables */
|
||||||
|
|
||||||
|
|||||||
1
wmfsrc
1
wmfsrc
@ -96,6 +96,7 @@ client
|
|||||||
keys
|
keys
|
||||||
{
|
{
|
||||||
# general keybind
|
# general keybind
|
||||||
|
key { mod = {"Alt"} key = "r" func = "reload" }
|
||||||
key { mod = {"Control"} key = "Return" func = "spawn" cmd = term }
|
key { mod = {"Control"} key = "Return" func = "spawn" cmd = term }
|
||||||
key { mod = {"Alt"} key = "q" func = "client_kill" }
|
key { mod = {"Alt"} key = "q" func = "client_kill" }
|
||||||
key { mod = {"Control", "Alt", "Shift"} key = "q" func = "quit" }
|
key { mod = {"Control", "Alt", "Shift"} key = "q" func = "quit" }
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user