Forum › Forums › General › Software › seeking help: input method (im-config, fcitx, gcin, hime, ibus) setup
Tagged: input method, language, locale
- This topic has 16 replies, 5 voices, and was last updated Dec 15-8:54 pm by ckhung.
-
AuthorPosts
-
November 22, 2017 at 2:59 am #2913Member
ckhung
Dear All,
On a relatively freshly installed antix-17 from antiX-17_386-full.iso
running in a kvm I try to install input methods.
I tried gcin, hime, and ibus, but none worked.
The usual way of installing and running im-config (previously im-switch)
does not seem to work in antix.
So I put the environment variable settings in ~/.bashrc like this:export GTK_IM_MODULE=ibus export XMODIFIERS=@im=ibus export QT_IM_MODULE=ibusand manually start the input method daemon on the command line like this:
dbus-launch ibus-daemon -v
But none of these input methods work.
The input method icon would show on the bottom toolbar,
but somehow ctrl-space does not work at all,
either pressed directly or sent from the kvm console.
I traced ibus’s python code a bit as shown in the screenshot but got stuck.
(I just added a print in the __init_general(self) function of /usr/share/ibus/setup/main.py)
I suspect that the input methods does not recognize my locale (zh_TW).
Does anyone ever get any input method to work?Many thanks!
- This topic was modified 5 years, 5 months ago by Brian Masinick.
Attachments:
December 4, 2017 at 8:04 am #3378Moderator
Brian Masinick
::I have not seen a lot of discussion – at least in this release – for various multi-byte locales, including the zh_TW locale you are attempting to use.
Do you personally have any expertise in localization – whether language translation, i18N setup, or anything else? I don’t think we had many people with expertise in the Asian locales participating in the most recent localization efforts, so if you have the expertise or know anyone who does, or can point us to locations where we can obtain accurate, correct, and up-to-date localization for zh_TW and other multi-byte locales, that would be GREAT!
--
Brian MasinickDecember 4, 2017 at 9:36 am #3380Anonymous
::Is this information in this linked debian documentation page helpful?
debian: input method support with ibusIf not, the following websearch queries seem promising:
debian ibus zh_TW
debian “input method” ibus zh_TWHmmm, this from the archived forum might be outdated: solved-chinese-with-ibus-no-input-window-t5147
.suggestion: contact username “balloon” ~~ has posted to bunsenlabs forum during the past month.
(In past discussions, he has shown expertise regarding use of fcitx and ibus.)December 5, 2017 at 5:51 am #3407Memberckhung
::Hi masinick and skidoo, thanks for your responses.
In regards to input methods, I am only a user and not familiar with the mechanism behind the curtains. But now that you replied, maybe I can point people who may know to this thread. I tried installing ibus-gtk3, python-indicator, and ibus-gtk according to the “solved” link, but no luck. The (modified-by-me) ibus-setup python script still mysteriously omits zh_TW in its long list of known languages as in the original picture.
Also, it’s hard to get more info because I don’t even know whether the control keys are passed to the input method. BTW, I remember seeing something about antix’s customized control keys in the window manager environment. How can I see the key customization setting and maybe revert it back to icewm’s default?
December 5, 2017 at 3:39 pm #3427Anonymous
::ibus-setup python script still mysteriously omits zh_TW in its long list of known languages as in the original picture.
I would: sudo dpkg-reconfigure locales and ensure that zh_TW is among the currently-active locales.
If it is was not, that might explain why it was absent from the choices within ibus-setup python (so, may need to again run? or purge/reinstall? ibus-set afterward)How can I see the key customization setting and maybe revert it back to icewm’s default?
Hmm, does icewm even “know about” locales?
/etc/defaults/keyboard/
/etc/X11/xorg.conf
/etc/environment
~/.Xsessionrcvideo: How to install or change locale in Debian
configure the Locale of your Debian9 system
Debian wiki :: Locale
nixCraft: How to Set Locales (i18n) On a Linux or Unix
locale-settings-are-not-right-how-can-i-reset-them
Chinese Debian Mini Howto
http://www.b-t.asia/chinese/linux_configureDecember 5, 2017 at 4:24 pm #3429Member
emer
::https://lmdelive.wordpress.com/2017/11/29/antix-fcitx/
Hope this helps.
- This reply was modified 5 years, 5 months ago by emer.
December 6, 2017 at 8:56 pm #3474Memberckhung
::Sorry, I was not clear in my last message.
There are two seprate questions.The first question is that ibus does not see the zh_TW locale.
As you can see in the lower right corner of the picture
in my original post,locale -a | grep zhshows that
both zh_CN and zh_TW have been there all the time.
I didsudo dpkg-reconfigure localesagain anyway
as you suggested, but nothing changed afterwards.
Maybe there is something more I can try in order to
have enough info to open an issue in the ibus project?The second question is about the failure of two other input methods
to receive any keystrokes from apps wanting to do zh_TW input.
At first I tried hime. The daemon runs and I was able
to switch the input mode to (one of verious) zh_TW (input modes)
only if I use GUI. It simply ignores (fails to receive)
ctrl-space, ctrl-shift, and any further keystrokes from lxterm.
Then I fooled around a bit and tried gcin and it worked!
So I thought the problem was with hime and therefore
I half-heartedly backed up my ~/.bash_history in the virtual machine,
destroyed the virtual machine (to be more precise, rollbacked
the underlying zfs volume), and retried installing gcin again.
And it failed 🙁 The symptom is the same as hime.
And the backed up ~/.bash_history is gone, of course.
This embarrassing incident didn’t provide much insight
so I omitted it in my first post.
The only notable thing I can recall during my fool around
was I tried some GUI program to change the key bindings.
But I don’t remember its name and I don’t remember seeing
ctrl-space in it.Thank you emer. I followed your post and then
set the 3 env vars and runfcitx-autostart
but still failed to switch input method.
Can you give a pointer as to what to do next after
installing these extra packages?December 7, 2017 at 2:15 am #3476Member
emer
::Thank you emer. I followed your post and then
set the 3 env vars and runfcitx-autostart
but still failed to switch input method.
Can you give a pointer as to what to do next after
installing these extra packages?# apt install im-config
And run im-config for every user to choose which input method for this user.
December 7, 2017 at 5:29 am #3478Memberckhung
::Hmm.. im-config (alone) does not work. I don’t know what went wrong with my previous installation. I start from a really fresh install of antix 17 (32bit) and it works now. For future reference here are the complete steps:
- Make sure you have chosen the correct locale (language) when you installed antix.
If not sure, run sudo dpkg-reconfigure locales - Install the packages listed in this post (thanks to emer!)
- [This step is not necessary but you can try it in case you fail otherwise.] As the primary ordinary user (not root!), im-config -n fcitx to choose fcitx as your input method.
- Add the following to ~/.bashrc:
export GTK_IM_MODULE=fcitx export XMODIFIERS=@im=fcitx export QT_IM_MODULE=fcitx - Add fcitx -d to ~/.desktop-session/startup
- Log out and log in again. You should see an extra keyboard icon at the lower right corner of the desktop, and should be able to use ctrl-space to switch to Chinese input mode. Enjoy!
==============
Then I install gcin and repeat steps 3-6. According to this page, the line added to ~/.desktop-session/startup should look like /usr/bin/dbus-launch /usr/bin/gcin. Other than that, the rest is only a matter of replacing fcitx with gcin. But gcin is still not working — one can seem to switch input mode to Chinese by clicking the input method icon at the lower right corner but the following keystrokes are still treated as plain English keyboard keys.
For the hime input method, the startup command in ~/.desktop-session/startup is hime & and the result is the same as gcin.
For the ibus input method, the startup command in ~/.desktop-session/startup is ibus-daemon -d and the result is the same as gcin except that you can also use ctrl-space to switch input mode if you use ibus-setup to configure it.
Well thank you everyone for your help. I still hope that the problems with other input methods can be solved. But for now I will just enjoy fcitx and move on to create a nice remixed antix iso image. And please let me know if there are L10N (zh_TW) works for antix that I can help.
ps. I cannot change the title to add “Solved”, can I?
- This reply was modified 5 years, 5 months ago by ckhung.
- This reply was modified 5 years, 5 months ago by ckhung. Reason: add note about locale; im-config not necessary; zenity not necessary if im-config is run with -n
December 9, 2017 at 1:34 am #3529Memberckhung
::A follow-up note:
I took those same steps in the previous post directly after booting from the installation live cdrom (e.g. before installing to harddisk). Now fcitx did NOT work. The mode-switching key ctrl-space has no effect. When trying to use GUI (right click) to change input mode, there is only one option (keyboard-en(us)) to choose from instead of three. For comparison, attached image is what it looks like when fcitx is working in a normal, installed environment, where there are 3 input modes (keyboard-en(us), chewing, boshiamy) available.
I would appreciate very much if someone familiar with the antix system (and not necessarily with eastern languages or input methods) could please try as far as figuring out how to make the other 2 methods appear in the GUI. Either this may help expose an antix bug that may also have been affecting other input methods, or it may give some good info for reporting bug to fcitx, which is currently the only input method working in antix.
- This reply was modified 5 years, 5 months ago by ckhung. Reason: should be "keyboard-en(us)"
Attachments:
December 9, 2017 at 6:18 pm #3558Memberckhung
::OK, ibus also works now. See 在 antix 17 裡面安裝中文輸入法 (zh_TW). Below is the English version.
- Make sure you have chosen the correct locale (language) when you installed antix. cat /etc/default/locale should print something like LANG=zh_TW.UTF-8
- Install ibus packages: sudo apt-get install ibus ibus-gtk ibus-gtk3 ibus-qt4 ibus-chewing (Replace ibus-chewing with your prefered input method.)
- From now on all commands should be executed as the primary normal (non-root) user. Add the following to ~/.bashrc:
export GTK_IM_MODULE=ibus export XMODIFIERS=@im=ibus export QT_IM_MODULE=ibus - Add ibus-daemon -d -x to ~/.desktop-session/startup
- Execute ibus-setup and in the “next input method”
(下一個輸入法) dialog, change the setting from Super-Space to Control-Space. Be sure to press “apply” (套用) before pressing “OK” (確定). - Log out and log in again. Enjoy your input method!
Additional notes:
Normally one can use im-config -m to see what input method one is using, and use im-config -n fcitx to choose fcitx as your input method for example. This lets you do without the GUI dialogs.
But some config settings of antix is different from standard debian, and therefore im-config has no effect. Instead we manually add the 3 variable settings and the line that starts the input method engine.
Every input method also needs extra packages that interface with gtk or qt depending on the apps wanting to use the input method. For example, if you want to use ibus in lxterminal, you need to use
ldd /usr/bin/lxterminal | egrep -i 'qt|gtk'to find out that it requires libgtk-x11-2.0.so.0 . Therefore you also have to install ibus-gtk. The simplest thing to do is installing all of ibus-gtk* and ibus-qt* in the first place.December 10, 2017 at 2:36 am #3563Forum Admin
anticapitalista
::Thanks. Just to check, you got it to work correctly for both ibus and fcitx?
If so, we can put the steps in the tips ‘n tricks section.Philosophers have interpreted the world in many ways; the point is to change it.
antiX with runit - leaner and meaner.
December 11, 2017 at 8:02 am #3593Memberckhung
::OK I am frustrated and scratching my head now.
Two days ago in one computer I tried ibus and fcitx and both worked correctly. Each was installed on a fresh antix 17 kvm on top of a zfs zvol. (Therefore I was able to rollback to the fresh image easily.)
Today I copied the exact same (freshly installed antix) image to my other computer and followed the same steps but neither worked.
These two computers are in different cities so I cannot do a side-by-side step-by-step comparison. Maybe if you could put these steps in the tips ‘n tricks section, some more people could try it and either verify that they work, or report back troubles.
Meanwhile I will find a third computer and try it again. Or maybe re-install a fresh antix 17 and start all over again…
December 11, 2017 at 1:42 pm #3609Anonymous
::I’ve retitled the topic to include more keywords & will PM “balloon” over at bunsenlabs to ask his advice.
December 14, 2017 at 5:04 am #3791Memberckhung
::Well I think those two posts work fine by and large, with the following caveats:
- It is recommended to install your chosen input method at the very beginning when the system is clean. Especially avoid doing it after installing other input methods.
- Of the two, fcitx is more likely to be successful.
- When both fail, try it on a different computer.
Long story:
I used fsarchiver to save a freshly installed antix17. I tried on the third computer (a notebook) and the fourth computer using kvm. On both computer I tried both fcitx and ibus (each input method directly installed onto the fresh image, not on top of each other), and all 4 combinations worked.
Back to the 2nd (problematic) computer. I tried it along side the 3rd (notebook) computer, following exactly the same steps. fcitx works on both kvm. Installing ibus after fctix is installed resulted in failure on both. Symptom: the input method can be started, and the input mode seems to change when pressing ctrl-space, but the input method never really receives the keystrokes. The app receives the original ascii keystrokes. Installing ibus directly onto the fresh image resulted in failure for 2nd computer and success for 3rd computer. <== This is really weird.
I still don’t have a good hypothesis of what went wrong with the 2nd computer. (HDD? file system? computer timing? antix?) Anyway I am glad to have created a working image now, and I am contented that only 1 out of 4 computers seem to be problematic (and not always). Hope these notes save future users some headaches.
-
AuthorPosts
- You must be logged in to reply to this topic.

