[lua] Fall back to default config file

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Michael Gehring 2008-06-09 11:51:50 +02:00 committed by Julien Danjou
parent 19534c0bfc
commit 244a02b2d6

View file

@ -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[] =