Skip to content

Commit

Permalink
XDG_DATA_DIRS
Browse files Browse the repository at this point in the history
  • Loading branch information
eagleoflqj committed Jan 4, 2024
1 parent e7e14be commit f90be45
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/fcitx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ void start_fcitx() {
std::string fcitx5_prefix = std::string(getenv("HOME")) + "/Library/fcitx5";
std::string addon_dirs =
APP_CONTENTS_PATH "/lib/fcitx5:" + fcitx5_prefix + "/lib/fcitx5";
std::string data_dirs = fcitx5_prefix + "/share";
// Separate plugins so that dmg replacement won't remove them
setenv("FCITX_ADDON_DIRS", addon_dirs.c_str(), 1);
setenv("XDG_DATA_DIRS", data_dirs.c_str(), 1);
p_instance = std::make_unique<fcitx::Instance>(0, nullptr);
auto &addonMgr = p_instance->addonManager();
addonMgr.registerDefaultLoader(&staticAddon);
Expand Down

0 comments on commit f90be45

Please sign in to comment.