From 7e17bbdb7c51356f14ab39b4659c4c8d1baafee6 Mon Sep 17 00:00:00 2001 From: ElnuDev Date: Thu, 23 Feb 2023 13:22:28 -0800 Subject: [PATCH] fcitx5: add patched nicola table --- modules/fcitx5/default.nix | 27 +++++++++++++++++++++++++-- modules/fcitx5/nicola.patch | 4 ++++ 2 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 modules/fcitx5/nicola.patch diff --git a/modules/fcitx5/default.nix b/modules/fcitx5/default.nix index adb4c33..bd15281 100644 --- a/modules/fcitx5/default.nix +++ b/modules/fcitx5/default.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ lib, pkgs, ... }: with import ../theme; let themeFolder = ".local/share/fcitx5/themes/${theme}/"; @@ -6,7 +6,18 @@ in { i18n.inputMethod = { enabled = "fcitx5"; - fcitx5.addons = with pkgs; [ fcitx5-anthy ]; + fcitx5.addons = with pkgs; [ + (fcitx5-anthy.overrideAttrs (oldAttrs: { + # bugged custom Nicola tables fixed in master + # https://github.com/fcitx/fcitx5-anthy/issues/8 + src = fetchFromGitHub { + owner = "fcitx"; + repo = "fcitx5-anthy"; + rev = "9031b56c334dd0a2da6a5b5d3ab3570e06395ca0"; + hash = "sha256-a0z3OoSiiVslrTZuI5PDws+ykWFFKdev7fSpGgjNAA8="; + }; + })) + ]; }; home.file = { @@ -19,4 +30,16 @@ in "${themeFolder}radio.png".source = ./radio.png; ".config/fcitx5/conf/classicui.conf".text = "Theme=${theme}"; }; + # Generating patch: + # $ source="$(find /nix/store -maxdepth 1 -type d -name '*fcitx5-anthy*' | head -n 1)/share/fcitx5/anthy/nicola-j.sty" + # $ cp $source nicola.sty + # $ chmod 644 nicola.sty + # $ vim nicola.sty + # $ diff $source nicola.sty > nicola.patch + home.activation.nicola = let + target = ".local/share/fcitx5/anthy/nicola.sty"; + in lib.hm.dag.entryAfter["writeBoundary"] '' + rm -f -- ${target} + patch -ruN ${pkgs.fcitx5-anthy}/share/fcitx5/anthy/nicola-j.sty ${./nicola.patch} -o ${target} + ''; } diff --git a/modules/fcitx5/nicola.patch b/modules/fcitx5/nicola.patch new file mode 100644 index 0000000..af9cf9b --- /dev/null +++ b/modules/fcitx5/nicola.patch @@ -0,0 +1,4 @@ +24c24 +< -=−,』,』 +--- +> -=ー,』,』