Skip to content

Commit

Permalink
move plugins to ~/Library/fcitx5
Browse files Browse the repository at this point in the history
  • Loading branch information
eagleoflqj committed Jan 3, 2024
1 parent 9dbc696 commit e7e14be
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,22 @@ cmake --build build
sudo cmake --install build
```

## Debug
### Console.app
* Check `Include Info Messages` and `Include Debug Messages` in `Action` menu.
* Put `FcitxLog` in `Search`.

### lldb
SSH into the mac from another device, then
```sh
$ /usr/bin/lldb
(lldb) process attach --name Fcitx5
```

## Plugins
Fcitx5 only packges keyboard engine.
To install other engines, see [fcitx5-macos-plugins](https://github.com/fcitx-contrib/fcitx5-macos-plugins).

## Credits
* [fcitx5-android](https://github.com/fcitx5-android/fcitx5-android): LGPL-2.1-or-later
* [squirrel](https://github.com/rime/squirrel): GPL-3.0-only
Expand Down
7 changes: 5 additions & 2 deletions src/fcitx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,12 @@ void setupLog(bool verbose) {

void start_fcitx() {
setupLog(true);
// /Library/Input\ Methods/Fcitx5.app/Contents:~/Library/fcitx5
std::string fcitx5_prefix = std::string(getenv("HOME")) + "/Library/fcitx5";
std::string addon_dirs =
APP_CONTENTS_PATH "/lib/fcitx5:" + fcitx5_prefix + "/lib/fcitx5";
// Separate plugins so that dmg replacement won't remove them
setenv("FCITX_ADDON_DIRS",
APP_CONTENTS_PATH "/lib/fcitx5:/usr/local/lib/fcitx5", 1);
setenv("FCITX_ADDON_DIRS", addon_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 e7e14be

Please sign in to comment.