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

Support setting shared data via XDG_DATA_DIRS and XDG_DATA_HOME #124

Closed
wants to merge 1 commit into from

Conversation

wrvsrx
Copy link

@wrvsrx wrvsrx commented Nov 7, 2024

In this PR, fcitx5-rime detect shared data using following logic:

If fcitx5-rime can find rime-data/default.yaml in $XDG_DATA_HOME or $XDG_DATA_DIRS (using fcitx::fs::StandardPath::scanDirectories), it will use it . Otherwise, it use RIME_DATA_DIR specified during build time as fallback.

@wrvsrx
Copy link
Author

wrvsrx commented Nov 7, 2024

@wengxt Unlike #123, this PR uses fcitx::fs::StandardPath::scanDirectories to detect the location of rime-data/default.yaml, thereby determining which folder to use as shared data. This is consistent with the commonly seen path detection logic based on XDG_DATA_DIRS and XDG_DATA_HOME on unix-like platform.

@wengxt
Copy link
Member

wengxt commented Nov 7, 2024

Can you explain your use case? is there any reason you can't use user directory?

@wrvsrx wrvsrx force-pushed the support-set-data-dir-via-xdg branch 3 times, most recently from 228385a to 4307b14 Compare November 8, 2024 03:47
In this PR, fcitx5-rime detect shared data using following logic:

First fcitx5-rime find a directory contain `rime-data/default.yaml` via
`fcitx::fs::StandardPath::locate`. Then it use `RIME_DATA_DIR` as
fallback.
@wrvsrx wrvsrx force-pushed the support-set-data-dir-via-xdg branch from 4307b14 to 80955b3 Compare November 8, 2024 04:03
@wengxt wengxt closed this Nov 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants