luaa: clean XDG_CONDIG_DIR package path adding
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
624ed7c63c
commit
3a2236abb0
10
luaa.c
10
luaa.c
|
@ -852,9 +852,14 @@ luaA_init(void)
|
||||||
lua_pushstring(L, AWESOME_RELEASE);
|
lua_pushstring(L, AWESOME_RELEASE);
|
||||||
lua_settable(L, LUA_GLOBALSINDEX);
|
lua_settable(L, LUA_GLOBALSINDEX);
|
||||||
|
|
||||||
|
/* add Lua lib path (/usr/share/awesome/lib by default) */
|
||||||
luaA_dostring(L, "package.path = package.path .. \";" AWESOME_LUA_LIB_PATH "/?.lua\"");
|
luaA_dostring(L, "package.path = package.path .. \";" AWESOME_LUA_LIB_PATH "/?.lua\"");
|
||||||
luaA_dostring(L, "package.path = package.path .. \";" AWESOME_LUA_LIB_PATH "/?/init.lua\"");
|
luaA_dostring(L, "package.path = package.path .. \";" AWESOME_LUA_LIB_PATH "/?/init.lua\"");
|
||||||
|
|
||||||
|
/* add XDG_CONFIG_DIR (/etc/xdg/awesome by default) as include path */
|
||||||
|
luaA_dostring(L, "package.path = package.path .. \";" XDG_CONFIG_DIR "/awesome/?.lua\"");
|
||||||
|
luaA_dostring(L, "package.path = package.path .. \";" XDG_CONFIG_DIR "/awesome/?/init.lua\"");
|
||||||
|
|
||||||
/* init hooks */
|
/* init hooks */
|
||||||
globalconf.hooks.manage = LUA_REFNIL;
|
globalconf.hooks.manage = LUA_REFNIL;
|
||||||
globalconf.hooks.unmanage = LUA_REFNIL;
|
globalconf.hooks.unmanage = LUA_REFNIL;
|
||||||
|
@ -913,11 +918,6 @@ luaA_parserc(const char *confpatharg, bool run)
|
||||||
ssize_t len;
|
ssize_t len;
|
||||||
bool ret;
|
bool ret;
|
||||||
|
|
||||||
/* add XDG_CONFIG_DIR (/etc/xdg/awesome by default) as include path */
|
|
||||||
snprintf(path, sizeof(path),
|
|
||||||
"package.path = package.path .. \";" XDG_CONFIG_DIR "/awesome/?.lua;" XDG_CONFIG_DIR "/awesome/?/init.lua\"");
|
|
||||||
luaA_dostring(globalconf.L, path);
|
|
||||||
|
|
||||||
ret = luaA_loadrc(confpatharg, run);
|
ret = luaA_loadrc(confpatharg, run);
|
||||||
|
|
||||||
confdir = getenv("XDG_CONFIG_HOME");
|
confdir = getenv("XDG_CONFIG_HOME");
|
||||||
|
|
Loading…
Reference in New Issue