Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[40_3] set TEXMACS_HOME_PATH to XDG_DATA_HOME #1322

Merged
merged 1 commit into from
Oct 31, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions src/System/Boot/init_texmacs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,18 +172,22 @@ void
init_texmacs_home_path (int& argc, char** argv) {
if (!is_empty (get_env ("TEXMACS_HOME_PATH"))) return;

#if defined(OS_MINGW) || defined(OS_WIN)
set_env ("TEXMACS_HOME_PATH", get_env ("APPDATA") * "\\XmacsLabs");
#elif defined(OS_MACOS)
set_env ("TEXMACS_HOME_PATH", get_env ("HOME") * "/Library/Application Support/XmacsLabs");
#elif defined(OS_HAIKU)
set_env ("TEXMACS_HOME_PATH",
get_env ("HOME") * "/config/settings/TeXmacs");
#elif defined(OS_WASM)
set_env ("TEXMACS_HOME_PATH", "/.Xmacs");
if (os_mingw () || os_win ()) {
set_env ("TEXMACS_HOME_PATH", get_env ("APPDATA") * "\\XmacsLabs");
} else if (os_macos ()) {
set_env ("TEXMACS_HOME_PATH", get_env ("HOME") * "/Library/Application Support/XmacsLabs");
} else if (os_wasm ()) {
set_env ("TEXMACS_HOME_PATH", "/.XmacsLabs");
} else {
#if defined(OS_HAIKU)
set_env ("TEXMACS_HOME_PATH", get_env ("HOME") * "/config/settings/TeXmacs");
#else
set_env ("TEXMACS_HOME_PATH", get_env ("HOME") * "/.TeXmacs");
string xdg_data_home= get_env ("XDG_DATA_HOME");
if (is_empty (xdg_data_home))
xdg_data_home= get_env ("HOME") * "/.local/share";
set_env ("TEXMACS_HOME_PATH", xdg_data_home * "/XmacsLabs");
#endif
}
}


Expand Down
Loading