[Share Experiences] Some Simple Configurations for fcitx5-rime
Community Discussion 151 views · 0 replies ·
deepin小助手
Super Moderator
OM
2024-11-05 10:43
Author
The following content is from the user @AMZ in Chinese community, thanks for the sharing!
Regarding RIME, which is highly customizable, I will introduce a simple guide focusing on pinyin, double pinyin, word libraries, and settings to make it easy to use.
The user's configuration file is located at ~/.local/share/fcitx5/rime/default.custom.yaml. If it doesn't exist, you can create a new one.
My typing habit is to use Ctrl+Shift to activate the input method, and Shift to switch between Chinese and English. When switching, I want the typed English to be directly committed to the screen, effectively preserving those few keystrokes and avoiding unnecessary work due to forgetting to switch input methods. Below is my configuration:
# default.custom.yaml# User Input Method Configurationpatch:schema_list:# Input method list-schema:double_pinyin# Double pinyin input methodmenu:page_size:6# 6 candidate wordsascii_composer/switch_key:Shift_L:commit_code# Left Shift commits and switches to EnglishShift_R:commit_code# Right Shift commits and switches to English
Start by inputting patch: which marks the start of a valid extended configuration, followed by the necessary lines.
Although there are many built-in input methods, I particularly like double pinyin, so I only kept the Natural Double Pinyin in the input method list.
You need to install a dependency for this:
sudo apt install rime-data-double-pinyin
If you're only using full pinyin, this dependency will suffice and is installed by default: rime-data-luna-pinyin.
schema: double_pinyin for Natural Double Pinyin
schema: luna-pinyin for full pinyin
Below are some schema options copied from the internet, choose what works for you:
schema_list:-schema:luna_pinyin# Luna Pinyin -schema:luna_pinyin_simp# Luna Pinyin Simplified -schema:luna_pinyin_tw# Luna Pinyin Traditional (Taiwan) -schema:terra_pinyin# Terra Pinyin -schema:bopomofo# Zhuyin -schema:jyutping# Cantonese -schema:cangjie5# Cangjie 5 -schema:quick5# Quick Input -schema:wubi86# Wubi 86 -schema:double_pinyin# Natural Double Pinyin -schema:wugniu# Shanghainese -schema:emoji# Emoji
You can reorder these as needed, and other configurations are commented for reference.
Why are some shortcuts not working?
They must not conflict with the fcitx5 framework, so some settings need to be removed, as shown in the image: image.png
Customize the activation according to your habits, but avoid using Shift as it will conflict with the configuration. Remove any unnecessary settings. When editing shortcuts, press Esc to clear. As long as there are no conflicts, your configuration should work.
There’s another trick with Fcitx5. If you find it useful, you can try it:
You can set the left Shift in Fcitx5 to switch input methods, and enable "Commit on Deactivation" in RIME's system settings. This allows committed characters to appear when deactivating the input method, while switching to the en keyboard for continued English input.
Meanwhile, the right Shift, as configured earlier, switches to English and commits already typed English letters. Pressing Shift again switches back to Chinese. This achieves left Shift committing Chinese and right Shift committing English. If you prefer, you can try this for a smoother experience. Alternatively, you can have both Shift keys controlled by RIME with the same functionality, bypassing Fcitx5's influence.
Word Libraries
You can search for them on Baidu or GitHub and place them here for easier management:
~/.local/share/fcitx5/rime/dicts
To import a custom word library, modify this file:
Clear the content of the copied file and add the following:
---name:amz_pinyin_ciku# Name must match the filenameversion:"4"sort:by_weightuse_preset_vocabulary:trueimport_tables:-luna_pinyin-dicts/luna_pinyin.chaizi-dicts/luna_pinyin.sougou-dicts/se_words-dicts/luna_pinyin.emoji...
This expands the word library. Add the new word library files to the dicts folder and list their names in amz_pinyin_ciku.dict.yaml.
Edit ~/.local/share/fcitx5/rime/default.custom.yaml to enable the user dictionary feature:
"translator/enable_user_dict":true
Skins
Place them in ~/.local/share/fcitx5/themes.
After completing all the above, remember to redeploy the settings by pressing F4 in the input interface to switch to Simplified Chinese.
The following content is from the user @AMZ in Chinese community, thanks for the sharing!
Regarding RIME, which is highly customizable, I will introduce a simple guide focusing on pinyin, double pinyin, word libraries, and settings to make it easy to use.
Install these two packages, then restart:
sudo apt install fcitx5-rime rime-data-double-pinyin rime-data-emoji
The user's configuration file is located at
~/.local/share/fcitx5/rime/default.custom.yaml
. If it doesn't exist, you can create a new one.My typing habit is to use
Ctrl+Shift
to activate the input method, andShift
to switch between Chinese and English. When switching, I want the typed English to be directly committed to the screen, effectively preserving those few keystrokes and avoiding unnecessary work due to forgetting to switch input methods. Below is my configuration:# default.custom.yaml# User Input Method Configurationpatch:schema_list:# Input method list-schema:double_pinyin# Double pinyin input methodmenu:page_size:6# 6 candidate wordsascii_composer/switch_key:Shift_L:commit_code# Left Shift commits and switches to EnglishShift_R:commit_code# Right Shift commits and switches to English
Start by inputting
patch:
which marks the start of a valid extended configuration, followed by the necessary lines.Although there are many built-in input methods, I particularly like double pinyin, so I only kept the Natural Double Pinyin in the input method list.
You need to install a dependency for this:
sudo apt install rime-data-double-pinyin
If you're only using full pinyin, this dependency will suffice and is installed by default:
rime-data-luna-pinyin
.schema: double_pinyin
for Natural Double Pinyinschema: luna-pinyin
for full pinyinBelow are some schema options copied from the internet, choose what works for you:
schema_list:-schema:luna_pinyin# Luna Pinyin -schema:luna_pinyin_simp# Luna Pinyin Simplified -schema:luna_pinyin_tw# Luna Pinyin Traditional (Taiwan) -schema:terra_pinyin# Terra Pinyin -schema:bopomofo# Zhuyin -schema:jyutping# Cantonese -schema:cangjie5# Cangjie 5 -schema:quick5# Quick Input -schema:wubi86# Wubi 86 -schema:double_pinyin# Natural Double Pinyin -schema:wugniu# Shanghainese -schema:emoji# Emoji
You can reorder these as needed, and other configurations are commented for reference.
Why are some shortcuts not working?
image.png
Customize the activation according to your habits, but avoid using
Shift
as it will conflict with the configuration. Remove any unnecessary settings. When editing shortcuts, pressEsc
to clear. As long as there are no conflicts, your configuration should work.There’s another trick with Fcitx5. If you find it useful, you can try it:
You can set the left
Shift
in Fcitx5 to switch input methods, and enable "Commit on Deactivation" in RIME's system settings. This allows committed characters to appear when deactivating the input method, while switching to theen
keyboard for continued English input.Meanwhile, the right
Shift
, as configured earlier, switches to English and commits already typed English letters. PressingShift
again switches back to Chinese. This achieves leftShift
committing Chinese and rightShift
committing English. If you prefer, you can try this for a smoother experience. Alternatively, you can have bothShift
keys controlled by RIME with the same functionality, bypassing Fcitx5's influence.Word Libraries
You can search for them on Baidu or GitHub and place them here for easier management:
~/.local/share/fcitx5/rime/dicts
To import a custom word library, modify this file:
sudo nano ~/.local/share/fcitx5/rime/double_pinyin.custom.yaml
patch:# There should be only one patch in the configuration"translator/dictionary":amz_pinyin_ciku# Load the custom word library collection
To create a word library, first copy an existing one:
sudo cp ~/.local/share/fcitx5/rime/dicts/luna_pinyin.game.dict.yaml ~/.local/share/fcitx5/rime/amz_pinyin_ciku.dict.yaml
Clear the content of the copied file and add the following:
---name:amz_pinyin_ciku# Name must match the filenameversion:"4"sort:by_weightuse_preset_vocabulary:trueimport_tables:-luna_pinyin-dicts/luna_pinyin.chaizi-dicts/luna_pinyin.sougou-dicts/se_words-dicts/luna_pinyin.emoji...
This expands the word library. Add the new word library files to the
dicts
folder and list their names inamz_pinyin_ciku.dict.yaml
.Edit
~/.local/share/fcitx5/rime/default.custom.yaml
to enable the user dictionary feature:"translator/enable_user_dict":true
Skins
Place them in
~/.local/share/fcitx5/themes
.F4
in the input interface to switch to Simplified Chinese.