-
Notifications
You must be signed in to change notification settings - Fork 8
IBusでのインプットメソッドの実装方法
Tokuhiro Matsuno edited this page Jan 18, 2023
·
4 revisions
ibus は fcitx などと同じレイヤーの日本語入力フレームワークです。 どのように実装すれば良いのでしょうか。
ibus は /usr/share/ibus/component/*.xml に設定ファイルをおくと読んでくれます。
<?xml version="1.0" encoding="utf-8"?>
<!-- filename: akaza.xml -->
<component>
<name>org.freedesktop.IBus.Akaza</name>
<description>Akaza - kana kanji converter</description>
<version>0.0.1</version>
<license>MIT</license>
<author>Tokuhiro Matsuno <[email protected]></author>
<homepage>https://github.com/tokuhirom/ibus-akaza</homepage>
<exec>/home/tokuhirom/dev/akaza/ibus-akaza/ibus-akaza-debug.sh --ibus</exec>
<textdomain>ibus-akaza</textdomain>
<engines>
<engine>
<name>akaza</name>
<longname>akaza</longname>
<description>Akaza - Kana Kanji Converter</description>
<language>ja</language>
<license>MIT</license>
<author>Tokuhiro Matsuno <[email protected]></author>
<icon>/usr/share//ibus-akaza/akaza.svg</icon>
<icon_prop_key>InputMode</icon_prop_key>
<layout>us</layout>
<layout_variant></layout_variant>
<layout_option></layout_option>
<hotkeys></hotkeys>
<symbol>昆</symbol>
<setup></setup>
<version></version>
<textdomain></textdomain>
<rank>0</rank>
</engine>
</engines>
</component>akaza の場合は上記のように設定しています。 特に設定しなくてはいけないのは
- icon
- icon_prop_key
- exec
あたり。
icon のところでは svg を指定できます。akaza は現在 @tokuhirom が雑につくった適当なアイコンが設定されます。誰かもっといいのを作って欲しい。
icon_prop_key を <icon_prop_key>InputMode</icon_prop_key> のように設定すると、入力モードに応じてシンボルが表示されるようになるので実は僕の力作のアイコンが表示されている期間は一瞬です(起動するまでのあいだにすぎません)
exec に指定されているコマンドが実行されます。