all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Thomas Albers Raviola via <help-guix@gnu.org>
To: help-guix@gnu.org
Subject: Using fcitx5 in Guix
Date: Mon, 07 Oct 2024 12:39:17 +0200	[thread overview]
Message-ID: <87ed4s9oyy.fsf@alpha.mail-host-address-is-not-set> (raw)

Hello,

recently I've been playing around with fcitx5 and getting it to work in
guix. Currently I don't have the time to better document my results, but
with the intention of helping others with similar issues I've decided to
write this mail instead.

* Setup
The first thing is installing a font, so the characters get rendered
correctly.

Fonts for displaying CJK characters (there are also others available)
  font-google-noto-serif-cjk
  font-google-noto-sans-cjk

Next the packages for fcitx5. From the following list probably not all
packages are required (some may be implicitly used as the inputs of
others). I still need to check which ones are strictly necessary.

Packages
  fcitx5
  fcitx5-gtk
  fcitx5-gtk:gtk2
  fcitx5-gtk:gtk3
  fcitx5-gtk4
  fcitx5-qt
  fcitx5-configtool
  ;; This is for Japanese input only. See the repositories to check
  ;; which package you need for other languages
  fcitx5-anthy
  ;; Probably not necessary, as fcitx5-anthy probably already includes it
  anthy

* Environmental variables
IBus exports the some environmental variables in order for GTK to be
able to find the input manager modules. The same is necessary for fcitx5.
However, this was apparently forgotten when creating the package
definition. Until this is change, one can use the following (assuming
fcitx5 was installed in your home profile)

  export GUIX_GTK2_IM_MODULE_FILE="$HOME/.guix-home/profile/lib/gtk-2.0/2.10.0/immodules-gtk2.cache"
  export GUIX_GTK3_IM_MODULE_FILE="$HOME/.guix-home/profile/lib/gtk-3.0/3.0.0/immodules-gtk3.cache"

I can't speak/read Chinese so I couldn't read the article, but in
principle here is the source:

  https://guixcn.github.io/wiki/input-method/
  
* Sway
Currently sway does not support 'text-input-v3' and the candidate list
disappear/flicker. In my case this is observed as a spike in CPU usage
and increase of temperature. To solve this you can define the following
environmental variables.
    
  export GTK_IM_MODULE"="fcitx"
  export QT_IM_MODULE="fcitx"
  export "XMODIFIERS"="@im=fcitx"

Fcitx5 will then throw an annoying warning each time it starts
recommending to disable the environmental variables. A easy fix is to
wrap fcitx5 in a script with the variables unset.

fcitx5.sh
------------------------------------------------------------------------
#!/bin/sh

unset GTK_IM_MODULE
fcitx5
------------------------------------------------------------------------

If I understand correctly, this issue will be solved in the next release
(sway v1.10) and the environmental variables will no longer be necessary.
https://github.com/swaywm/sway/pull/7226

I hope this helps.

Please comment if you find any errors in this setup or have further
things to add. Thanks in advance.

Regards,

Thomas Albers Raviola


                 reply	other threads:[~2024-10-07 10:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ed4s9oyy.fsf@alpha.mail-host-address-is-not-set \
    --to=help-guix@gnu.org \
    --cc=thomas@thomaslabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.