diff options
author | okan <okan> | 2008-07-11 15:18:29 +0000 |
---|---|---|
committer | okan <okan> | 2008-07-11 15:18:29 +0000 |
commit | 6ea4b1bd3b3f6106a61e4fbb98a267f86a32261f (patch) | |
tree | e459581324620e4da3537abd0dc610d6200beb42 /conf.c | |
parent | 8be175b175f04c4c16ec4be63bab6b1d2b0ebbfd (diff) | |
download | cwm-6ea4b1bd3b3f6106a61e4fbb98a267f86a32261f.tar.gz cwm-6ea4b1bd3b3f6106a61e4fbb98a267f86a32261f.tar.xz cwm-6ea4b1bd3b3f6106a61e4fbb98a267f86a32261f.zip |
no more hidden (and mysterious) config reloads and allow binding a key
to a config reload; CMS-r by default. ok oga@
Diffstat (limited to 'conf.c')
-rw-r--r-- | conf.c | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/conf.c b/conf.c index 10d891a..b824c4f 100644 --- a/conf.c +++ b/conf.c @@ -61,29 +61,9 @@ conf_font(struct conf *c) c->FontHeight = font_ascent() + font_descent() + 1; } -int -conf_changed(char *path) -{ - static struct timespec old_ts; - struct stat sb; - int changed; - - /* If the file does not exist we pretend that nothing changed */ - if (stat(path, &sb) == -1 || !(sb.st_mode & S_IFREG)) - return (0); - - changed = !timespeccmp(&sb.st_mtimespec, &old_ts, ==); - old_ts = sb.st_mtimespec; - - return (changed); -} - void conf_reload(struct conf *c) { - if (!conf_changed(c->conf_path)) - return; - if (parse_config(c->conf_path, c) == -1) { warnx("config file %s has errors, not reloading", c->conf_path); return; @@ -132,6 +112,7 @@ conf_init(struct conf *c) conf_bindname(c, "CM-g", "grouptoggle"); conf_bindname(c, "CM-f", "maximize"); conf_bindname(c, "CM-equal", "vmaximize"); + conf_bindname(c, "CMS-r", "reload"); conf_bindname(c, "CMS-q", "quit"); conf_bindname(c, "M-h", "moveleft"); @@ -254,6 +235,7 @@ struct { { "grouptoggle", kbfunc_client_grouptoggle, KBFLAG_NEEDCLIENT, 0}, { "maximize", kbfunc_client_maximize, KBFLAG_NEEDCLIENT, 0 }, { "vmaximize", kbfunc_client_vmaximize, KBFLAG_NEEDCLIENT, 0 }, + { "reload", kbfunc_reload, 0, 0 }, { "quit", kbfunc_quit_wm, 0, 0 }, { "exec", kbfunc_exec, 0, (void *)CWM_EXEC_PROGRAM }, { "exec_wm", kbfunc_exec, 0, (void *)CWM_EXEC_WM }, |