aboutsummaryrefslogtreecommitdiffstats
path: root/src/lua_api.c
diff options
context:
space:
mode:
authorGravatar Lance Borden 2025-08-19 15:03:34 -0400
committerGravatar Lance Borden 2025-08-19 15:03:34 -0400
commit5293253c628c54c9096f3d07191a5934a6d979aa (patch)
tree6a915821aa2bb0653c3e06f8f1b69c4fff5fe308 /src/lua_api.c
parentupdate compil instructions (diff)
keep history to home dir and use .config instead of custom dotfile dir
Diffstat (limited to 'src/lua_api.c')
-rw-r--r--src/lua_api.c8
1 files changed, 6 insertions, 2 deletions
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);
+ }
}
}