feat(fcitx5): switch CN/EN with Ctrl+Space and right Shift

Clear AltTriggerKeys, whose Shift_L default toggled on left Shift. Left Shift is now a plain modifier and right Shift switches through the shared Rime config.
This commit is contained in:
Ryan Yin committed 2026-10-05 22:41:49 +08:00
1 parent 8e3f12aa19
commit 9442a82d91
2 files changed
+32 -11

No files matched your search

+14 -1
View File
@@ -2,11 +2,24 @@
fcitx5 is enabled in `default.nix` with the [flypy](https://flypy.com/) Rime schema (Chinese),
`fcitx5-mozc-ut` (Japanese), and `fcitx5-hangul` (Korean), alongside the US keyboard layouts. The
Rime data ships in the [`overlays/fcitx5`](../../../../../overlays/fcitx5/) overlay.
Rime data comes from the `rime-data-flypy` package in `nur-ryan4yin` (`pkgs/rime-data-flypy`); the
whole Rime configuration, including the `fcitx5-rime` addon and the user customisation shared with
macOS, lives in `home/base/gui/rime/` (see its README).
## Available Configurations
- `fcitx5/config` (global config) → `~/.config/fcitx5/config`; pins `AltTriggerKeys` (see below).
- `profile` → Symlink will be created at: `~/.config/fcitx5/profile`
- `mozc-config1.db` (Mozc config) → Symlink will be created at: `~/.config/mozc/config1.db`
- Main changes from the defaults: use half-width for all alphabets, numbers, and punctuation.
- https://github.com/google/mozc/blob/2.30.5544.102/docs/configurations.md
## Shift keys
- Right Shift: switch CN/EN, through Rime.
- Left Shift: plain modifier.
- Ctrl+Space: switch CN/EN (fcitx5's `TriggerKeys`).
fcitx5's `AltTriggerKeys` (the "temporarily toggle input method" hotkey) defaults to `Shift_L`, so
it would toggle on left Shift; it is empty here. The Rime side, `Shift_R` as `commit_code` and
`Shift_L` as `noop`, is in `home/base/gui/rime/flypy.custom.yaml` (shared with macOS).
+18 -10
View File
@@ -1,4 +1,8 @@
{ config, pkgs, ... }:
{
config,
pkgs,
...
}:
{
catppuccin.fcitx5.enable = false;
xdg.configFile = {
@@ -8,16 +12,20 @@
# so we need to force replace it in every rebuild to avoid file conflict.
force = true;
};
# `AltTriggerKeys` (the "temporarily toggle input method" hotkey) would
# toggle on left Shift, its default being Shift_L. Keep it empty so only
# right Shift (through Rime) and Ctrl+Space switch CN/EN. force = true
# because fcitx5 rewrites this file at runtime, like `profile`.
"fcitx5/config" = {
text = ''
[Hotkey/AltTriggerKeys]
'';
force = true;
};
"mozc/config1.db".source =
config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/nix-config/home/linux/gui/base/fcitx5/mozc-config1.db";
};
xdg.dataFile."fcitx5/rime/default.custom.yaml".text = ''
patch:
ascii_composer/switch_key/Shift_L: noop
ascii_composer/switch_key/Shift_R: commit_code
'';
i18n.inputMethod = {
enable = true;
type = "fcitx5";
@@ -26,9 +34,9 @@
qt6Packages.fcitx5-configtool # GUI for fcitx5
fcitx5-gtk # gtk im module
# Chinese
fcitx5-rime # for flypy chinese input method
# fcitx5-chinese-addons # we use rime instead
# Chinese: the flypy (小鹤音形) fcitx5-rime addon is wired in
# home/base/gui/rime/default.nix, which is also where the rime-data-flypy
# package is resolved. fcitx5-chinese-addons is not used.
# Japanese
# ctrl-i / F7 - convert to takakana