On 2014-12-11 22:46:48, Joel Rees <joel.r...@gmail.com> wrote:
> On Thu, Dec 11, 2014 at 10:07 PM, Joel Rees <joel.r...@gmail.com> wrote:
> > Followup:
> >
> > On Tue, Oct 14, 2014 at 2:02 PM, Joel Rees <joel.r...@gmail.com> wrote:
> >> What're the recommended input methods for Japanese and Spanish?
> >
> > I have got Japanese input running and useable, by installing the packages
> >
> > ja-fonts-gnu
> > ja-sazanami-ttf
> > ja-mplus-ttf
> > ibus-anthy
> >
> > with pkg_add . I'm not comfortable that this is the most optimal way
> > to do it, but it allows me to work on an openbsd box.
> 
> I should note, that I have to launch the ibus preferences (as from
> Setings in XFCE4) to get the ime daemon started at this point. Haven't
> found out how to get it to start when X11 starts.
> 

I use UIM, not ibus, but I have the following lines in my .xinitrc
(among several others which are not relevant here) which starts
UIM automatically when X is started.

        export XMODIFIERS=@im=uim
        export GTK_IM_MODULE="uim"
        export QT_IM_MODULE="uim"

        env LC_CTYPE=ja_JP.UTF-8 uim-xim &

        exec env LC_CTYPE="en_US.UTF-8" /usr/X11R6/bin/cwm

If you play around with these, you could probably get something
working with ibus.

For GTK at least, I think these module names are currently sourced
from either:
        /usr/local/lib/gtk-2.0/2.10.0/immodules
or
        /usr/local/lib/gtk-3.0/3.0.0/immodules

And are cached in /etc/gtk-2.0/gtk.immodules by running
gtk-query-immodules-2.0.  It seems like GTK-3 is doing something
different, maybe under ~/.config or something or just running
gtk-query-immodules-3.0 directly.  It works for me, so I haven't
really looked into it much.

Note that some applications refuse to accept Japanese input unless
they're run with the correct locale settings *AND* an overridden
input module, so I have

        bind C-g "env GTK_IM_MODULE=xim LC_CTYPE=ja_JP.UTF-8 gwaei"

in my .cwmrc so that a Japanese dictionary program of all things
will accept Japanese input.

As I said before, unfortunately xombrero needs the same hack
        #bind C-x "env GTK_IM_MODULE=xim LC_CTYPE=ja_JP.UTF-8 xombrero"
but this makes the fonts very ugly on most pages and in the
general UI.  I'm still hoping to find some way to get it to
support Japanese input without needing to force the locale to
change, since it seems like Firefox, xterms, and most any non-GTK
programs just "Do the Right Thing (TM)".

I find it somewhat ironic that I was able to get Japanese
input/output in xterm/irssi/mutt/tmux working with less than 5
minutes of reading manpages, but have spent literally hours
getting GTK to work.

GTK apps used to "Just Work (TM)", but it seems like after new
versions have been released over the last few years, more and more
hacks have been needed to keep things working.  First it was only
the LC_CTYPE=ja_JP.UTF-8 that was needed, now GTK_IM_MODULE=xim is
needed too.

I'm sure the GTK developers have good reasons for continually
changing these, but it's certainly inconvenient to upgrade GTK and
find that one's IME stops working.

Once again, any cluebats are appreciated, but I have a feeling
this is just how things are WRT needing all these environment
overrides.

I hope you're able to get ibus to start automatically from this
information.  If not, maybe try giving UIM a try?

--
Bryan

Reply via email to