From 13c6f0933915adaf33eaaa7cfd6b2123559120a5 Mon Sep 17 00:00:00 2001 From: Aldrik Ramaekers Date: Sat, 9 Mar 2024 13:31:42 +0100 Subject: move config location to /home/text-search --- src/linux/main_linux.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/linux/main_linux.cpp b/src/linux/main_linux.cpp index d8907dd..fda8d64 100644 --- a/src/linux/main_linux.cpp +++ b/src/linux/main_linux.cpp @@ -29,9 +29,12 @@ bool program_running = true; char config_path[MAX_INPUT_LENGTH]; static const char* _ts_platform_get_config_file_path(char* buffer) { - snprintf(buffer, MAX_INPUT_LENGTH, "%s", "/etc/opt/text-search/imgui.ini"); - if (!ts_platform_dir_exists(buffer)) { - mkdir(buffer, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH); + char* env = getenv("HOME"); + char path_buf[MAX_INPUT_LENGTH]; + snprintf(path_buf, MAX_INPUT_LENGTH, "%s%s", env, "/text-search/"); + snprintf(buffer, MAX_INPUT_LENGTH, "%s%s", path_buf, "imgui.ini"); + if (!ts_platform_dir_exists(path_buf)) { + mkdir(path_buf, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH); } return buffer; } -- cgit v1.2.3-70-g09d2