diff --git a/home/modules/default.nix b/home/modules/default.nix index 1ede244..4ef350f 100644 --- a/home/modules/default.nix +++ b/home/modules/default.nix @@ -7,6 +7,7 @@ ++ [ ./programs ./xdg-dirs.nix + ./i18n ]; config = { diff --git a/home/modules/i18n/default.custom.yaml b/home/modules/i18n/default.custom.yaml new file mode 100644 index 0000000..cd210ce --- /dev/null +++ b/home/modules/i18n/default.custom.yaml @@ -0,0 +1,83 @@ +patch: + "__include": rime_ice_suggestion:/ + "schema_list": + - schema: double_pinyin_flypy + "menu/page_size": 7 + "switcher/caption": 「方案选单」 + "switcher/hotkeys": + - F4 + "switcher/save_options": + - ascii_punct + - traditionalization + - emoji + - full_shape + - search_single_char + "switcher/fold_options": false + "ascii_composer/good_old_caps_lock": true + "ascii_composer/switch_key/Caps_Lock": clear + "ascii_composer/switch_key/Shift_L": noop + "ascii_composer/switch_key/Shift_R": noop + "ascii_composer/switch_key/Control_L": noop + "ascii_composer/switch_key/Control_R": noop + "key_binder/bindings": + # Tab / Shift+Tab 切换光标至下/上一个拼音 + - { when: composing, accept: Shift+Tab, send: Shift+Left } + - { when: composing, accept: Tab, send: Shift+Right } + + # Option/Alt + ←/→ 切换光标至下/上一个拼音 + - { when: composing, accept: Shift+Tab, send: Shift+Left } + - { when: composing, accept: Tab, send: Shift+Right } + + # 翻页 , . + - { when: paging, accept: comma, send: Page_Up } + - { when: has_menu, accept: period, send: Page_Down } + + # 翻页 - = + - { when: has_menu, accept: minus, send: Page_Up } + - { when: has_menu, accept: equal, send: Page_Down } + + - { + when: always, + toggle: ascii_punct, + accept: Control+Shift+3, + } # 切换中英标点 + - { + when: always, + toggle: ascii_punct, + accept: Control+Shift+numbersign, + } # 切换中英标点 + - { + when: always, + toggle: traditionalization, + accept: Control+Shift+4, + } # 切换简繁 + - { + when: always, + toggle: traditionalization, + accept: Control+Shift+dollar, + } # 切换简繁 + - { when: always, toggle: full_shape, accept: Control+Shift+5 } # 切换全半角 + - { + when: always, + toggle: full_shape, + accept: Control+Shift+percent, + } # 切换全半角 + + # 将小键盘 0~9 . 映射到主键盘,数字金额大写的 Lua 如 R1234.5678 可使用小键盘输入 + - { accept: KP_0, send: 0, when: composing } + - { accept: KP_1, send: 1, when: composing } + - { accept: KP_2, send: 2, when: composing } + - { accept: KP_3, send: 3, when: composing } + - { accept: KP_4, send: 4, when: composing } + - { accept: KP_5, send: 5, when: composing } + - { accept: KP_6, send: 6, when: composing } + - { accept: KP_7, send: 7, when: composing } + - { accept: KP_8, send: 8, when: composing } + - { accept: KP_9, send: 9, when: composing } + - { accept: KP_Decimal, send: period, when: composing } + + # 将小键盘 + - * / 映射到主键盘,使计算器 如 1+2-3*4 可使用小键盘输入 + - { accept: KP_Multiply, send: asterisk, when: composing } + - { accept: KP_Add, send: plus, when: composing } + - { accept: KP_Subtract, send: minus, when: composing } + - { accept: KP_Divide, send: slash, when: composing } diff --git a/home/modules/i18n/default.nix b/home/modules/i18n/default.nix new file mode 100644 index 0000000..0e78253 --- /dev/null +++ b/home/modules/i18n/default.nix @@ -0,0 +1,12 @@ +{ + osConfig ? null, + lib, + ... +}: { + config = lib.mkIf (osConfig != null) { + xdg.dataFile = { + "fcitx5/rime/default.custom.yaml".source = ./default.custom.yaml; + "fcitx5/rime/double_pinyin_flypy.custom.yaml".source = ./double_pinyin_flypy.custom.yaml; + }; + }; +} diff --git a/home/modules/i18n/double_pinyin_flypy.custom.yaml b/home/modules/i18n/double_pinyin_flypy.custom.yaml new file mode 100644 index 0000000..d29c0ea --- /dev/null +++ b/home/modules/i18n/double_pinyin_flypy.custom.yaml @@ -0,0 +1,4 @@ +patch: + "translator/packs/+": + - zhwiki + - moegirl diff --git a/nixos/modules/i18n.nix b/nixos/modules/i18n.nix index 9403331..5c628b5 100644 --- a/nixos/modules/i18n.nix +++ b/nixos/modules/i18n.nix @@ -32,11 +32,12 @@ in { addons = with pkgs; [ libsForQt5.fcitx5-qt fcitx5-gtk - fcitx5-gtk fcitx5-fluent (fcitx5-rime.override { rimeDataPkgs = [ rime-ice + rime-zhwiki + rime-moegirl ]; }) ]; diff --git a/overlays/additions/default.nix b/overlays/additions/default.nix index 02467d9..337723a 100644 --- a/overlays/additions/default.nix +++ b/overlays/additions/default.nix @@ -2,7 +2,6 @@ inherit (prev) lib; in [ - ./rime-ice.nix ./TrackersListCollection.nix ./OuterWildsTextAdventure.nix ./editor-runtime.nix diff --git a/overlays/additions/rime-ice.nix b/overlays/additions/rime-ice.nix deleted file mode 100644 index a54e748..0000000 --- a/overlays/additions/rime-ice.nix +++ /dev/null @@ -1,5 +0,0 @@ -{outputs, ...}: final: prev: let - inherit (prev.stdenv.hostPlatform) system; -in { - rime-ice = outputs.packages."${system}".rime-ice; -} diff --git a/pkgs/_sources/generated.json b/pkgs/_sources/generated.json index 737d28a..6c27ed8 100644 --- a/pkgs/_sources/generated.json +++ b/pkgs/_sources/generated.json @@ -22,7 +22,7 @@ }, "TrackersListCollection": { "cargoLocks": null, - "date": "2025-06-19", + "date": "2025-06-20", "extract": null, "name": "TrackersListCollection", "passthru": null, @@ -34,14 +34,14 @@ "name": null, "owner": "XIU2", "repo": "TrackersListCollection", - "rev": "68f0b601a7e8e30ca3e59d5d0b0c0c159f494fae", - "sha256": "sha256-+ve7SYZPvkv29PS91tISjyuCL6CggUv7RutfyITGkQE=", + "rev": "434c1455c6877e91d2f399e3f8ec52727974167d", + "sha256": "sha256-UcDxpNWGO72pS54SsmaF09NWmUYo8y+peGaOVKMSxZA=", "sparseCheckout": [ "all.txt" ], "type": "github" }, - "version": "68f0b601a7e8e30ca3e59d5d0b0c0c159f494fae" + "version": "434c1455c6877e91d2f399e3f8ec52727974167d" }, "cliphist": { "cargoLocks": null, @@ -130,27 +130,6 @@ }, "version": "Serif2.003" }, - "rime-ice": { - "cargoLocks": null, - "date": "2025-06-16", - "extract": null, - "name": "rime-ice", - "passthru": null, - "pinned": false, - "src": { - "deepClone": false, - "fetchSubmodules": false, - "leaveDotGit": false, - "name": null, - "owner": "iDvel", - "repo": "rime-ice", - "rev": "eeb559e70b7775d4d0b89003b3c9b896a447092f", - "sha256": "sha256-HvjDw2BNvMbu/J0NINN2/+iWCv3pYt+HrtlJPWfhERA=", - "sparseCheckout": [], - "type": "github" - }, - "version": "eeb559e70b7775d4d0b89003b3c9b896a447092f" - }, "spotx": { "cargoLocks": null, "date": "2025-06-18", diff --git a/pkgs/_sources/generated.nix b/pkgs/_sources/generated.nix index 91c1cbc..a4daf8a 100644 --- a/pkgs/_sources/generated.nix +++ b/pkgs/_sources/generated.nix @@ -15,18 +15,18 @@ }; TrackersListCollection = { pname = "TrackersListCollection"; - version = "68f0b601a7e8e30ca3e59d5d0b0c0c159f494fae"; + version = "434c1455c6877e91d2f399e3f8ec52727974167d"; src = fetchFromGitHub { owner = "XIU2"; repo = "TrackersListCollection"; - rev = "68f0b601a7e8e30ca3e59d5d0b0c0c159f494fae"; + rev = "434c1455c6877e91d2f399e3f8ec52727974167d"; fetchSubmodules = false; deepClone = false; leaveDotGit = false; sparseCheckout = [ "all.txt" ]; - sha256 = "sha256-+ve7SYZPvkv29PS91tISjyuCL6CggUv7RutfyITGkQE="; + sha256 = "sha256-UcDxpNWGO72pS54SsmaF09NWmUYo8y+peGaOVKMSxZA="; }; - date = "2025-06-19"; + date = "2025-06-20"; }; cliphist = { pname = "cliphist"; @@ -82,18 +82,6 @@ sha256 = "sha256-mfbBSdJrUCZiUUmsmndtEW6H3z6KfBn+dEftBySf2j4="; }; }; - rime-ice = { - pname = "rime-ice"; - version = "eeb559e70b7775d4d0b89003b3c9b896a447092f"; - src = fetchFromGitHub { - owner = "iDvel"; - repo = "rime-ice"; - rev = "eeb559e70b7775d4d0b89003b3c9b896a447092f"; - fetchSubmodules = false; - sha256 = "sha256-HvjDw2BNvMbu/J0NINN2/+iWCv3pYt+HrtlJPWfhERA="; - }; - date = "2025-06-16"; - }; spotx = { pname = "spotx"; version = "181fd7fc8fe838237660a46ae096570d869bc30f"; diff --git a/pkgs/default.nix b/pkgs/default.nix index 6c0956c..ac99da1 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -13,7 +13,6 @@ in pinentry-selector = callPackage ./pinentry-selector.nix {}; helix = callPackage ./helix {}; juicity = callPackage ./juicity.nix {}; - rime-ice = callPackage ./rime-ice.nix {}; spotifyx = callPackage ./spotifyx.nix {}; radicle-explorer = callPackage ./radicle-explorer.nix {}; TrackersListCollection = callPackage ./TrackersListCollection.nix {}; diff --git a/pkgs/nvfetcher.toml b/pkgs/nvfetcher.toml index 3baca2c..64f3aa8 100644 --- a/pkgs/nvfetcher.toml +++ b/pkgs/nvfetcher.toml @@ -7,10 +7,6 @@ src.git = "https://github.com/kayhide/tree-sitter-idris" fetch.git = "https://github.com/kayhide/tree-sitter-idris" passthru.name = "idris" -[rime-ice] -src.git = "https://github.com/iDvel/rime-ice.git" -fetch.github = "iDvel/rime-ice" - [noto-serif-cjk] src.github = "notofonts/noto-cjk" fetch.github = "notofonts/noto-cjk" diff --git a/pkgs/rime-ice.nix b/pkgs/rime-ice.nix deleted file mode 100644 index 1b9bd25..0000000 --- a/pkgs/rime-ice.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ - srcs, - stdenvNoCC, -}: let - source = srcs.rime-ice; -in - stdenvNoCC.mkDerivation { - inherit (source) pname version src; - - installPhase = '' - runHook preInstall - - mkdir -p $out/share/rime-data - cp -r * $out/share/rime-data/ - - runHook postInstall - ''; - }