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

[转] UTF-8 and Unicode FAQ for Unix/Linux

这几天,这个东西把我搞得很头疼 而且这篇文章好像太大了,blogger自己的发布系统不能发 只好用mail了 //原文 http://www.cl.cam.ac.uk/~mgk25/unicode.html UTF-8 and Unicode FAQ for Unix/Linux by Markus Kuhn This text is a very comprehensive one-stop information resource on how you can use Unicode/UTF-8 on POSIX systems (Linux, Unix). You will find here both introductory information for every user, as well as detailed references for the experienced developer. Unicode has started to replace ASCII, ISO 8859 and EUC at all levels. It enables users to handle not only practically any script and language used on this planet, it also supports a comprehensive set of mathematical and technical symbols to simplify scientific information exchange. With the UTF-8 encoding, Unicode can be used in a convenient and backwards compatible way in environments that were designed entirely around ASCII, like Unix. UTF-8 is the way in which Unicode is used under Unix, Linux, and similar systems. It is now time to make sure that you are well familiar

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

Moving Items Along Bezier Curves with CSS Animation (Part 2: Time Warp)

This is a follow-up of my earlier article.  I realized that there is another way of achieving the same effect. This article has lots of nice examples and explanations, the basic idea is to make very simple @keyframe rules, usually just a linear movement, then use timing function to distort the time, such that the motion path becomes the desired curve. I'd like to call it the "time warp" hack. Demo See the Pen Interactive cubic Bezier curve + CSS animation by Lu Wang ( @coolwanglu ) on CodePen . How does it work? Recall that a cubic Bezier curve is defined by this formula : \[B(t) = (1-t)^3P_0+3(1-t)^2tP_1+3(1-t)t^2P_2+t^3P_3,\ 0 \le t \le 1.\] In the 2D case, \(B(t)\) has two coordinates, \(x(t)\) and \(y(t)\). Define \(x_i\) to the be x coordinate of \(P_i\), then we have: \[x(t) = (1-t)^3x_0+3(1-t)^2tx_1+3(1-t)t^2x_2+t^3x_3,\ 0 \le t \le 1.\] So, for our animated element, we want to make sure that the x coordiante (i.e. the "left" CSS property) is \(