summaryrefslogtreecommitdiff
path: root/src/linux/main_linux.cpp
diff options
context:
space:
mode:
authorAldrik Ramaekers <aldrikboy@gmail.com>2024-03-09 13:31:42 +0100
committerAldrik Ramaekers <aldrikboy@gmail.com>2024-03-09 13:31:42 +0100
commit13c6f0933915adaf33eaaa7cfd6b2123559120a5 (patch)
treef771960b4713389896c69e9a24ffa75a8102ec55 /src/linux/main_linux.cpp
parent34385ede2d3726770c3010873e5c7b07b5a0d0ee (diff)
move config location to /home/text-search
Diffstat (limited to 'src/linux/main_linux.cpp')
-rw-r--r--src/linux/main_linux.cpp9
1 files 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;
}