summaryrefslogtreecommitdiff
path: root/src/linux/main_linux.cpp
diff options
context:
space:
mode:
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;
}