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

Determine Perspective Lines With Off-page Vanishing Point

In perspective drawing, a vanishing point represents a group of parallel lines, in other words, a direction. For any point on the paper, if we want a line towards the same direction (in the 3d space), we simply draw a line through it and the vanishing point. But sometimes the vanishing point is too far away, such that it is outside the paper/canvas. In this example, we have a point P and two perspective lines L1 and L2. The vanishing point VP is naturally the intersection of L1 and L2. The task is to draw a line through P and VP, without having VP on the paper. I am aware of a few traditional solutions: 1. Use extra pieces of paper such that we can extend L1 and L2 until we see VP. 2. Draw everything in a smaller scale, such that we can see both P and VP on the paper. Draw the line and scale everything back. 3. Draw a perspective grid using the Brewer Method. #1 and #2 might be quite practical. #3 may not guarantee a solution, unless we can measure distances/p...

Qubes OS: First Impressions

A few days ago, while browsing security topics online, Qubes OS surfaced—whether via YouTube recommendations or search results, I can't recall precisely. Intrigued by its unique approach to security through compartmentalization, I delved into the documentation and watched some demos. My interest was piqued enough that I felt compelled to install it and give it a try firsthand. My overall first impression of Qubes OS is highly positive. Had I discovered it earlier, I might have reconsidered starting my hardware password manager project. Conceptually, Qubes OS is not much different from running a bunch of virtual machines simultaneously. However, its brilliance lies in the seamless desktop integration and the well-designed template system, making it far more user-friendly than a manual VM setup. I was particularly impressed by the concept of disposable VMs for temporary tasks and the clear separation of critical functions like networking (sys-net) and USB handling (sys-usb) into the...

Exploring Immutable Distros and Declarative Management

My current server setup, based on Debian Stable and Docker, has served me reliably for years. It's stable, familiar, and gets the job done. However, an intriguing article I revisited recently about Fedora CoreOS, rpm-ostree, and OSTree native containers sparked my curiosity and sent me down a rabbit hole exploring alternative approaches to system management. Could there be a better way? Core Goals & Requirements Before diving into new technologies, I wanted to define what "better" means for my use case: The base operating system must update automatically and reliably. Hosted services (applications) should be updatable either automatically or manually, depending on the service. Configuration and data files need to be easy to modify, and crucially, automatically tracked and backed up. Current Setup: Debian Stable + Docker My current infrastructure consists of several servers, all running Debian Stable. System Updates are andled automatically via unattended-upgrades. Se...