From 5293253c628c54c9096f3d07191a5934a6d979aa Mon Sep 17 00:00:00 2001 From: Lance Borden Date: Tue, 19 Aug 2025 15:03:34 -0400 Subject: keep history to home dir and use .config instead of custom dotfile dir --- src/lua_api.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/lua_api.c') diff --git a/src/lua_api.c b/src/lua_api.c index a35a308..0e20752 100644 --- a/src/lua_api.c +++ b/src/lua_api.c @@ -95,9 +95,13 @@ void lua_run_init(lua_State *L) { char script_path[64]; const char *home_dir = getenv("HOME"); if (home_dir != NULL) { - snprintf(script_path, sizeof(script_path), "%s/.lush/init.lua", + snprintf(script_path, sizeof(script_path), "%s/.config/lush/init.lua", home_dir); - lua_load_script(L, script_path, NULL); + FILE *f = fopen(script_path, "r"); + if (f != NULL) { + fclose(f); + lua_load_script(L, script_path, NULL); + } } } -- cgit v1.2.3-59-g8ed1b