Skip to main content

ibus 输入法配置

最近scim总把我的系统搞死,实在不能忍了。 本想转scim-python,但是svn上的代码居然不能编译。

这是想到了ibus,听说好久了,就是一直没有尝试。这次总算“被迫”试用了。

我的系统是ubuntu8.10 64bit

http://forum.ubuntu.org.cn/viewtopic.php?p=915368上查到了有用的步骤,这里提下简要过程,以及和原链接不同的地方:

1.编译安装dbus-python,ibus依赖0.83以上的版本

2.编译ibus引擎,我这里用git clone下载的,没有confiure,所以用autogen.sh,后来发现不用sudo还不行,是gettext的autopoint出了问题,所以只好用sudo了。另外我这里make也需要sudo,很奇怪

命令是:
sudo ./autogen.sh --prefix=/usr

3编译码表,我下了pinyin, anthy和table(这个里面包含了wu86, wu98, erbi,还有些其他的),编译安装,命令同上,注意安装五笔需要--enable-wu86或--enable-wu98

4运行ibus看是否正常,运行ibus-setup进行配置

5.把ibus注册为gtk的输入法
编辑/usr/lib/gtk-2.0/2.10.0/immodule-files.d/libgtk2.0-0.immodules
在文件到最后添加两行:
"/usr/lib/gtk-2.0/2.10.0/immodules/im-ibus.so"
"ibus" "ibus Input Method" "gtk20" "/usr/share/locale" "zh"
这样在一些文本框里点右键就能找到ibus了

6.注册给im-switch,替换掉scim或scim-bridge
1) 建立文件/etc/X11/xinit/xinput.d/ibus,内容为
XIM=ibus
XIM_PROGRAM=/usr/bin/ibus
XIM_ARGS=""
GTK_IM_MODULE=ibus

2) sudo update-alternatives --install /etc/X11/xinit/xinput.d/zh_CN xinput-zh_CN /etc/X11/xinit/xinput.d/ibus 50

3)sudo im-switch -c,然后选ibus那一项

7.重新登录应该就没问题。

注,安装五笔时我出了些问题,当时我最初是enable了98,然后发现不爽,想换回86,然后configure wubi86时忘了打--prefix=/usr结果一塌糊涂。最后倒是解决了,整理经验教训如下

8.需要删除engine时,除了删除/usr/share/ibus/engine 下的对应文件,如果设置了preload,还要去gconf里删除/desktop/ibus/general/preload_engines里的项目

9.用--prefix=/usr/local/(也就是不加--prefix)编译安装运行后,/usr/share/ibus/engine里会多出一个engine文件,我这里是wubi86.engine,然而make uninstall和用--prefix=/usr编译安装后这个文件里面的Icon字段仍然指向/usr/local,所以需要删除该文件再make install

试了一下,确实是很好用的输入法。

Comments

seenxu said…
非常感谢这篇文章,想问一下,用ibus大概占用多少内存? 如果低于scim的状态,我也想换了,之前用过scim-python, fitx内存占用都不理想。
Lu Wang said…
我开了拼音,五笔和anthy输入法,一共用了68M多一点的内存。用scim的时候没有测过,所以我无法比较。
seenxu said…
多谢!scim还是更小一些,我用amd64, 开机以后大概用25mb,逐渐使用后40mb,我还是不换了,继续用scim.

Popular posts from this blog

A Rocky Migration: Moving from docker-compose to Podman and gVisor

I've been running a few containers for several years. They were all running under rootless Docker with a single user. Initially, I planned to  migrate the containers to VMs , but I couldn't get a stable workflow after about two months of effort. Later,  gVisor caught my attention , and I decided to migrate to Podman with gVisor instead. The new plan is to run each container with  --userns=auto  and use Quadlet for systemd integration. This approach provides better isolation and makes writing firewall rules easier. I'm now close to migrating all my containers. Here are a couple of rough edges I'd like to share. Network Layout I compared  various networking options  and spent a few hours trying the one-interface-per-group approach before giving up. I settled on a single macvlan network and decided to use static IP addresses for my containers. To prevent a randomly assigned IP address from conflicting with a predefined one, I allocated a large IP range for my ...

GameConqueror 0.09 -- Linux Game Hacking Tool

If you are a game hacker If you've been looking for a `CheatEngine for Linux` Then you can't miss this. ============================================== GameConqueror is a game hacking tool for linux, it's written in PyGTK and uses scanmem as its backend. It's supposed to be with most useful features of CheatEngine for Linux. Currently, I've implemented almost everything about scanning, involving variant data types and scan types: Data Types: int{8/16/32/64}, float{32/64}, unknown type(int or float) and unknown width(will try each of them), byte array and string Scan Types: equal, greater, less, changed, unchanged, increased(by), decreased(by) This should be enough for most cases, so I decided to release it at the current status. ============================================= Here's how you can get it PPA (for Ubuntu users) https://launchpad.net/~coolwanglu/+archive/scanmem (I've not test it in 32bit environments or Jaunty, do please inform me if it doe...

Fix Google Security Code

Google Security Code (http://g.co/sc) is one type of 2-step verification. This is particularly useful when security keys and passkeys are not available. I have been using it in my LXC containers, until today I found out that it stopped working. It just kept saying "The code is invalid". It is easy to rule out some factors: The code works on other browsers on my laptop. The code works on other devices that are directly connected to the router. So it appears that Google also checks IP addresses besides the security code. Recently I have IPv6 enabled, so most devices that are directly connected to the router have both IPv4 and IPv6 addresses. But  I only enabled IPv4 for my LXC containers. So I guess when a code is generated by device A and used by device B, Google should be able to check that device A and device B are closely located. But in my case, IPv6 address appears on device A but not on device B, which may look suspicious. To fix the problem, I just needed to disable IPv...