From 244a02b2d65aa594039d4b4a5859550787708d8d Mon Sep 17 00:00:00 2001 From: Michael Gehring Date: Mon, 9 Jun 2008 11:51:50 +0200 Subject: [PATCH] [lua] Fall back to default config file Signed-off-by: Julien Danjou --- awesome.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/awesome.c b/awesome.c index ac1af6d2e..ae8d40048 100644 --- a/awesome.c +++ b/awesome.c @@ -59,6 +59,7 @@ #include "common/version.h" #include "common/configopts.h" #include "common/xutil.h" +#include "config.h" bool running = true; @@ -378,8 +379,14 @@ main(int argc, char **argv) /* parse config */ if(!confpath) confpath = config_file(); - if (!luaA_parserc(confpath)) - eprint("failed to load/parse configuration file %s", confpath); + if(!luaA_parserc(confpath)) + { + const char *default_confpath = AWESOME_CONF_PATH "/awesomerc.lua"; + warn("failed to load/parse configuration file %s", confpath); + warn("falling back to: %s", default_confpath); + if(!luaA_parserc(default_confpath)) + eprint("failed to load any configuration file"); + } /* select for events */ const uint32_t change_win_vals[] =