Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
howto: getting ibus-anthy working with kde4 and opera11
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
bpoint
Tux's lil' helper
Tux's lil' helper


Joined: 07 Oct 2008
Posts: 84
Location: Japan

PostPosted: Mon Nov 29, 2010 8:45 am    Post subject: howto: getting ibus-anthy working with kde4 and opera11 Reply with quote

I've been trying to get Japanese input working in KDE4 on a fresh Gentoo install for about a week now, and after scouring the net and trying various configurations, I finally have it just about working. Hopefully this post will assist in helping anyone else get any similar problems fixed.

First of all, I originally tried using uim, but had compile issues with uim-1.6.0, and some applications just wouldn't work at all with it. I then gave up, and went back to trying to get ibus to work. I completely avoided scim, as it seems there are some issues with getting it to work properly (from the horror stories I read on the net).

In any case, the first things to emerge are:
Code:
emerge ibus-anthy ibus-qt


The current versions and USE flags for what I'm using are:
Code:
[ebuild   R   ] app-i18n/ibus-1.3.9  USE="X gconf python -doc -gtk (-introspection) -nls -vala" 0 kB
[ebuild   R   ] app-i18n/ibus-anthy-1.2.4  USE="-nls" 0 kB
[ebuild   R   ] app-i18n/ibus-qt-1.3.0  USE="-doc" 0 kB


Note that ibus-anthy will automatically pull in ibus as a dependency. When ibus finishes emerging, the ebuild will show the following:
Code:
 * 3. Set the following in your user startup scripts
 *    such as .xinitrc, .xsession or .xprofile:
 *
 *    export XMODIFIERS="@im=ibus"
 *    export GTK_IM_MODULE="ibus"
 *    export QT_IM_MODULE="xim"
 *    ibus-daemon -d -x


The QT_IM_MODULE is actually incorrect, it should be "ibus", not "xim". It is also not necessary to manually start the ibus-daemon in your .xinitrc either.

Since this PC has a Japanese keyboard, and I intend to all users to be able enter Japanese, I added these exports to a new file in the xinitrc.d in the /etc/X11
folder (/etc/X11/xinit/xinitrc.d/85-ibus):
Code:
export GTK_IM_MODULE="ibus"
export QT_IM_MODULE="ibus"
export XMODIFIERS="@im=ibus"


I used a name of 85-ibus since ibus uses dbus, and 80-dbus initializes a dbus session for the user logging in. After restarting your X session, you'll have an empty space on your system tray -- this is where the ibus icon should be but doesn't appear (I still haven't figured this one out, but since it's purely cosmetical, I really don't mind). Right-click on the ibus space, and select preferences, or enter "ibus-setup" from a terminal.

Since the icon in the systray is broken, it's not really necessary, so I turned it off. Having some feedback about the current input method is nice, so I also set Show language panel to "When active". The initial keyboard shortcut for activating ibus is Ctrl+space, but if you have a Japanese keyboard like I do, you'll probably want the Zenkaku/Hankaku key to toggle it. To do that, perform the following steps:
Code:
1) Click the "..." next to "Enable or disable" Keyboard Shortcuts
2) Delete any existing shortcuts, like Ctrl+space (optional)
3) Click the "..." next to "Key code"
4) Press the Zenkaku/Hankaku key and release it
5) Click "Add" to register the key (note that it registers as Release+Zenkaku_Hankaku, but this is fine)
6) Click OK


Note that you do not need anything for "Next input method" unless you intend to add more than one language conversion (anything other than English and Japanese).

Next, click on the Input Method tab and add "Japanese - Anthy", and that's pretty much the basics. Most KDE4 applications will work fine (kwrite, konquerer, etc), but Opera probably won't.

To get Opera to work properly, you need to have a LANG environment variable set, preferably to UTF-8. First ensure in /etc/locale.gen that you at least have a UTF-8 locale available:
Code:
en_US.UTF-8 UTF-8
ja_JP.UTF-8 UTF-8


Next, create (I had to create it at least) /etc/env.d/02locale with just the following:
Code:
LANG="en_US.UTF-8"


Then run etc-update (this is important!), and reboot. When back in KDE, you should now be able to enter Japanese into Opera.

Finally, to get the Zenkaku/Hankaku key to work as a toggle, this page helped. Basically, the key assignment when detecting the key seems to be incorrect due to the keymap. I don't quite know or understand the details, but there are two options available.

Code:
First option:
1) Open the ibus preferences (or ibus-setup)
2) Click the Advanced tab
3) Disable "Use system keyboard layout"
4) Logout of KDE and log back in
5) Open ibus preferences again
6) Re-register the Zenkaku/Hankaku key (see above)
7) Re-enable "Use system keyboard layout" again
8) Logout of KDE and log back in again

or,
Code:
Second option:
1) Modify the /usr/share/ibus/keymaps/us file as shown in the link above


After all of this, you should be set (hopefully). :)

I still don't have Japanese input in Firefox, but since I use Opera, it's not much of an issue to me. Perhaps it's probably because of something with GTK, I'm not sure. If anyone has any ideas about getting it to work, I'd like to hear them.

If anyone has any other questions or problems, just ask, and I'll try to help out!
Back to top
View user's profile Send private message
tomk
Bodhisattva
Bodhisattva


Joined: 23 Sep 2003
Posts: 7221
Location: Sat in front of my computer

PostPosted: Mon Nov 29, 2010 9:48 am    Post subject: Reply with quote

Moved from Desktop Environments to Documentation, Tips & Tricks as it fits better here.
_________________
Search | Read | Answer | Report | Strip
Back to top
View user's profile Send private message
lo-jay
l33t
l33t


Joined: 27 Feb 2005
Posts: 862

PostPosted: Wed Dec 01, 2010 2:55 pm    Post subject: Reply with quote

hi,

got ibus 1.2.0.20100111 working with chinese input (pinyin).
but the chinese characters in the pop-up window are super small -
where can i change this?

cheers
_________________
lo-jay

The mechanic "One of 'em Dodge Chargers - let him go by."
The driver "Not today!"

taken from "Two Lane Blacktop"
Back to top
View user's profile Send private message
bpoint
Tux's lil' helper
Tux's lil' helper


Joined: 07 Oct 2008
Posts: 84
Location: Japan

PostPosted: Thu Dec 02, 2010 11:04 am    Post subject: Reply with quote

Hello lo-jay!

lo-jay wrote:
got ibus 1.2.0.20100111 working with chinese input (pinyin).
but the chinese characters in the pop-up window are super small -
where can i change this?

In the ibus preferences panel, there is a "Use custom font" setting which should help you. However, you're using a rather old version of ibus (the latest is 1.3.9), so that could potentially be a problem. I also found this post which might be related to your small font issue, but I recommend upgrading to the latest version of ibus first.

Hope this helps!
Back to top
View user's profile Send private message
lo-jay
l33t
l33t


Joined: 27 Feb 2005
Posts: 862

PostPosted: Thu Dec 02, 2010 11:50 am    Post subject: Reply with quote

hey bpoint,

that works!

thanks a lot :D
_________________
lo-jay

The mechanic "One of 'em Dodge Chargers - let him go by."
The driver "Not today!"

taken from "Two Lane Blacktop"
Back to top
View user's profile Send private message
lo-jay
l33t
l33t


Joined: 27 Feb 2005
Posts: 862

PostPosted: Tue Dec 14, 2010 11:32 am    Post subject: Reply with quote

ok, just upgraded to app-i18n/ibus-1.3.9 -
and it stopped working:

running
Quote:
ibus-setup


i get

Code:
 ibus-setup
** Message: pygobject_register_sinkfunc is deprecated (GtkWindow)
** Message: pygobject_register_sinkfunc is deprecated (GtkInvisible)
** Message: pygobject_register_sinkfunc is deprecated (GtkObject)

(process:16855): Gtk-WARNING **: Locale not supported by C library.
        Using the fallback 'C' locale.
Traceback (most recent call last):
  File "/usr/share/ibus/setup/main.py", line 463, in <module>
    locale.setlocale(locale.LC_ALL, '')
  File "/usr/lib64/python2.6/locale.py", line 521, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting


what's that gonna tell me?

my locales look like this:

Code:
$ locale
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=de_DE.UTF-8
LC_CTYPE=zh_CN.gb2312
LC_NUMERIC=zh_CN
LC_TIME=en_US
LC_COLLATE=zh_CN
LC_MONETARY=en_US.UTF-8
LC_MESSAGES=en_US
LC_PAPER=zh_CN
LC_NAME=zh_CN
LC_ADDRESS=zh_CN
LC_TELEPHONE=zh_CN
LC_MEASUREMENT=zh_CN
LC_IDENTIFICATION=zh_CN
LC_ALL=


cheers again!
_________________
lo-jay

The mechanic "One of 'em Dodge Chargers - let him go by."
The driver "Not today!"

taken from "Two Lane Blacktop"
Back to top
View user's profile Send private message
Dorsai!
Apprentice
Apprentice


Joined: 27 Jul 2008
Posts: 285
Location: Bavaria

PostPosted: Sat Dec 18, 2010 6:33 pm    Post subject: Reply with quote

I got a similar Problem since one of the last ibus upgrades. It worked very well before.

Now, when I left-click on the ibus icon, it does nothing, its not even saying "kein Eingabefenster" (no input window" which it said before whenever I tried to use it together with a not supported application.

My locals are:
Code:
locale
LANG=de_DE.UTF-8
LC_CTYPE="de_DE.UTF-8"
LC_NUMERIC="de_DE.UTF-8"
LC_TIME="de_DE.UTF-8"
LC_COLLATE="de_DE.UTF-8"
LC_MONETARY="de_DE.UTF-8"
LC_MESSAGES="de_DE.UTF-8"
LC_PAPER="de_DE.UTF-8"
LC_NAME="de_DE.UTF-8"
LC_ADDRESS="de_DE.UTF-8"
LC_TELEPHONE="de_DE.UTF-8"
LC_MEASUREMENT="de_DE.UTF-8"
LC_IDENTIFICATION="de_DE.UTF-8"
LC_ALL=de_DE.UTF-8


which I am sure is exactly the same as in the times when it worked.
Back to top
View user's profile Send private message
lo-jay
l33t
l33t


Joined: 27 Feb 2005
Posts: 862

PostPosted: Sat Dec 18, 2010 8:57 pm    Post subject: Reply with quote

dunno which language you're using ibus for, but in my case it's chinese
& i switched back to fcitx-4.0.0 which works with some of the locales
set to chinese language.

cheers
_________________
lo-jay

The mechanic "One of 'em Dodge Chargers - let him go by."
The driver "Not today!"

taken from "Two Lane Blacktop"
Back to top
View user's profile Send private message
bpoint
Tux's lil' helper
Tux's lil' helper


Joined: 07 Oct 2008
Posts: 84
Location: Japan

PostPosted: Mon Aug 22, 2011 3:41 pm    Post subject: Reply with quote

I just finished upgrading my Gentoo box and ibus-1.3.99 was pulled in with the update -- it stopped working here too. There were two things causing it to not work for me:

1) I had set -python in my /etc/make.conf to cut down on some unneeded python dependencies. According to this post, if python is not set, then ibus-setup isn't installed. After adding:
Code:
app-i18n/ibus python

to /etc/portage/package.use and re-emerging ibus, ibus-setup came back.

2) ibus-daemon wasn't being started automatically. I honestly am not sure how it even worked before, but after adding:
Code:
/usr/bin/ibus-daemon -d -x -r

to /etc/X11/xinit/xinitrc.d/85-ibus, then restarting my X session, ibus was happily working again.

Hope this helps fix any issues for anyone else!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum