diff options
author | okan | 2008-07-11 15:18:29 +0000 |
---|---|---|
committer | okan | 2008-07-11 15:18:29 +0000 |
commit | f641857dbaf77d21a1236e9b70e11bf913262cf4 (patch) | |
tree | 4b8681b18f07f3f01d5aa107341a712953ee6430 /conf.c | |
parent | 5f9e4ce44645e6d431d71a004550c38b08e03525 (diff) | |
download | cwm-f641857dbaf77d21a1236e9b70e11bf913262cf4.tar.gz |
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 | 24 |
1 files changed, 3 insertions, 21 deletions
@@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: conf.c,v 1.48 2008/07/11 14:24:34 okan Exp $ + * $Id: conf.c,v 1.49 2008/07/11 15:18:29 okan Exp $ */ #include "headers.h" @@ -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 }, |