# fcitx5 is an "input method", to e.g. allow typing CJK on qwerty. # but i also misuse it to allow typing emoji on qwerty: # - press `Super+backtick` # - type something like "effort" # - it should be underlined, at the least # - if well supported (e.g. Firefox; also gtk4, alacritty on sway 1.10+), a drop-down fuzzy matcher will appear # - press space # - "effort" should be replaced by `(ง •̀_•́)ง` # ## debugging # - `fcitx5-diagnose` # ## config/docs: # - `fcitx5-configtool`, then check ~/.config/fcitx5 files # - # - # - theming: # - # - wayland specifics: # - quickphrase (emoji): # - override phrases via `~/.config/fcitx/data/QuickPhrase.mb` # - customize bindings via `fcitx5-configtool` > addons > QuickPhrase # - theming: # - nixpkgs has a few themes: `fcitx5-{material-color,nord,rose-pine}` # - NUR has a few themes # - { lib, pkgs, ... }: { sane.programs.fcitx5 = { packageUnwrapped = pkgs.fcitx5-with-addons.override { addons = with pkgs; [ # fcitx5-mozc # japanese input: fcitx5-gtk # ]; }; sandbox.method = "bwrap"; sandbox.whitelistDbus = [ "user" ]; sandbox.whitelistWayland = true; # for `fcitx5-configtool, if nothing else` sandbox.extraHomePaths = [ # ".config/fcitx" ".config/fcitx5" ".local/share/fcitx5" ]; fs.".config/fcitx5/conf/quickphrase.conf".symlink.text = '' # Choose key modifier Choose Modifier=None # Enable Spell check Spell=True FallbackSpellLanguage=en [TriggerKey] # defaults: Super+grave, Super+semicolon # gtk apps use ctrl+period, so super+period is a nice complement 0=Super+grave 1=Super+semicolon 2=Super+period ''; fs.".config/fcitx5/conf/classicui.conf".symlink.text = '' Theme=sane Font="Sans 20" Vertical Candidate List=True ''; fs.".local/share/fcitx5/themes/sane/theme.conf".symlink.text = '' # i omit several keys, especially the ones which don't seem to do much. # for a theme which uses many more options, see: # - [Metadata] Name=sane ScaleWithDPI=True [InputPanel] NormalColor=#d8d8d8 HighlightCandidateColor=#FFFFFF HighlightColor=#FFFFFF HighlightBackgroundColor=#1f5e54 [InputPanel/Background] Color=#1f5e54 [InputPanel/Highlight] Color=#418379 [InputPanel/Highlight/Margin] Left=20 Right=20 Top=7 Bottom=7 [InputPanel/TextMargin] Left=20 Right=20 Top=6 Bottom=6 ''; services.fcitx5 = { description = "fcitx5: input method (IME) for emoji/internationalization"; partOf = [ "graphical-session" ]; command = "fcitx5"; }; env.XMODIFIERS = "@im=fcitx"; # setting IM_MODULE is generally not required on wayland, but can be used to override the toolkit's own dialogs with our own. # env.GTK_IM_MODULE = "fcitx"; # enable if you want them: # env.QT_IM_MODULE = "fcitx"; # env.QT_PLUGIN_PATH = [ "${cfg.package}/${pkgs.qt6.qtbase.qtPluginPrefix}" ]; # env.SDL_IM_MODULE = "fcitx"; # env.GLFW_IM_MODULE = "ibus"; # for KiTTY, as per }; }