Tag Archive for ibus-daemon

ibus-anthy

ひさびさにemerge worldをしたあと、例のごとくいろいろと不具合が起こるわけですが。

今回は日本語入力にそれなりにハマる。これはもう英語で過ごせというお告げか。

さすがにそれは無理なのでとりあえず調べてみる。
ibus-daemonのログをとってみる。起動したままibusのバックエンドをAnthyとそうじゃないやつで切り替えてみる。

$ killall ibus-daemon
$ ibus-daemon -v
IBUS-Message: 22:06:40.512056: Engine xkb:us:altgr-intl:eng is already registered by other component
Traceback (most recent call last):
  File "/usr/share/ibus-anthy/engine/main.py", line 26, in <module>
    import ibus
ImportError: No module named ibus

どうやらibusのPythonモジュール読み込み失敗しているらしい。とりあえずemergeしてみる。

# emerge -av ibus
 * IMPORTANT: 8 news items need reading for repository 'gentoo'.
 * Use eselect news to read news items.

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R   ~] app-i18n/ibus-1.4.99.20121006  USE="X dconf gconf gtk gtk3 introspection nls python -deprecated {-test} -vala" 0 kB

pythonは入ってるから大丈夫なはずなんだけどなぁ、と思ったけどふと「-deprecated」が怪しく感じてonにしてemergeした。
そしたら無事ibus-anthy自体は動くようになった。
ここからさらに。なぜかGnome 3.6での「Zenkaku_Hankaku」キーがショートカットとして使えない。
いろいろと探すと、VineSeedにそれらしいパッチがあった。

http://riksun.riken.go.jp/archives/Linux/vine/VineSeed/SRPMS.main/gnome-settings-daemon-3.6.3-1vl7.src.rpm

こんなかにある「gnome-settings-daemon-3.6.3-input-source-switch-zenkaku-hankaku.patch」を当てるverのebuildを作成してre-emergeしてみたが、ダメだった。

仕方ないので、xbindkeysを使用して無理やり解決。

まず切り替えスクリプトの用意。
(/usr/sunaga-lab/bin/switch-ibus-method)

#!/bin/bash

ENGINE=`ibus engine`
if [ s$ENGINE != "santhy" ]; then
	ENGINE="anthy"
else
	ENGINE="xkb:jp::jpn"
fi
ibus engine $ENGINE

次にxbindkeysの設定。

$ emerge xbindkeys
   ...
$ cat .xbindkeysrc
"/usr/sunaga-lab/bin/switch-ibus-method"
  Mod2 + Zenkaku_Hankaku

あとは.xprofileにxbindkeysを追加して終わり。

とりあえず使えるようになった。初回だけちょっともたつくけど。仕方ない。