seeking help: input method (im-config, fcitx, gcin, hime, ibus) setup

Forum Forums General Software seeking help: input method (im-config, fcitx, gcin, hime, ibus) setup

  • This topic has 16 replies, 5 voices, and was last updated Dec 15-8:54 pm by ckhung.
Viewing 15 posts - 1 through 15 (of 17 total)
  • Author
    Posts
  • #2913
    Member
    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=ibus
      

      and 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:
      #3378
      Moderator
      Brian Masinick
        Helpful
        Up
        0
        ::

        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 Masinick

        #3380
        Anonymous
          Helpful
          Up
          0
          ::

          Is this information in this linked debian documentation page helpful?
          debian: input method support with ibus

          If not, the following websearch queries seem promising:

          debian ibus zh_TW
          debian “input method” ibus zh_TW

          Hmmm, 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.)

          #3407
          Member
          ckhung
            Helpful
            Up
            0
            ::

            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?

            #3427
            Anonymous
              Helpful
              Up
              0
              ::

              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
              ~/.Xsessionrc

              video: 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_configure

              #3429
              Member
              emer
                Helpful
                Up
                0
                ::

                https://lmdelive.wordpress.com/2017/11/29/antix-fcitx/

                Hope this helps.

                • This reply was modified 5 years, 5 months ago by emer.
                #3474
                Member
                ckhung
                  Helpful
                  Up
                  0
                  ::

                  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 zh shows that
                  both zh_CN and zh_TW have been there all the time.
                  I did sudo dpkg-reconfigure locales again 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 run fcitx-autostart
                  but still failed to switch input method.
                  Can you give a pointer as to what to do next after
                  installing these extra packages?

                  #3476
                  Member
                  emer
                    Helpful
                    Up
                    0
                    ::

                    Thank you emer. I followed your post and then
                    set the 3 env vars and run fcitx-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.

                    #3478
                    Member
                    ckhung
                      Helpful
                      Up
                      0
                      ::

                      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:

                      1. Make sure you have chosen the correct locale (language) when you installed antix.
                        If not sure, run sudo dpkg-reconfigure locales
                      2. Install the packages listed in this post (thanks to emer!)
                      3. [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.
                      4. Add the following to ~/.bashrc:
                        
                        export GTK_IM_MODULE=fcitx
                        export XMODIFIERS=@im=fcitx
                        export QT_IM_MODULE=fcitx
                        
                      5. Add fcitx -d to ~/.desktop-session/startup
                      6. 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
                      #3529
                      Member
                      ckhung
                        Helpful
                        Up
                        0
                        ::

                        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:
                        #3558
                        Member
                        ckhung
                          Helpful
                          Up
                          0
                          ::

                          OK, ibus also works now. See 在 antix 17 裡面安裝中文輸入法 (zh_TW). Below is the English version.

                          1. 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
                          2. Install ibus packages: sudo apt-get install ibus ibus-gtk ibus-gtk3 ibus-qt4 ibus-chewing (Replace ibus-chewing with your prefered input method.)
                          3. 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
                            
                          4. Add ibus-daemon -d -x to ~/.desktop-session/startup
                          5. 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” (確定).
                          6. 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.

                          #3563
                          Forum Admin
                          anticapitalista
                            Helpful
                            Up
                            0
                            ::

                            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.

                            #3593
                            Member
                            ckhung
                              Helpful
                              Up
                              0
                              ::

                              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…

                              #3609
                              Anonymous
                                Helpful
                                Up
                                0
                                ::

                                I’ve retitled the topic to include more keywords & will PM “balloon” over at bunsenlabs to ask his advice.

                                #3791
                                Member
                                ckhung
                                  Helpful
                                  Up
                                  0
                                  ::

                                  Well I think those two posts work fine by and large, with the following caveats:

                                  1. 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.
                                  2. Of the two, fcitx is more likely to be successful.
                                  3. 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.

                                Viewing 15 posts - 1 through 15 (of 17 total)
                                • You must be logged in to reply to this topic.