您的位置:首页 > 编程语言 > Go语言

Install Sogou IM 2.0 in Ubuntu14.04+/Xfce

2016-07-21 21:43 369 查看

Ubuntu14.04+ 安装搜狗输入法

搜狗输入法是一款非常友好的输入法产品,从Ubuntu14.04开始对Linux支持,不过只是Debian系的,是Ubuntu优麒麟组引入的。优麒麟是针对国人设计的Ubuntu的一个版本,不过我个人更喜欢 Deepin,他为linux舍弃带来了譬如「有道词典」,「网易云音乐」等优秀的应用,界面设计也区域人性化和美观考虑。不少中国linux圈的都是基于Debian的系统优化。

Introduction

Sogou Input 2.0 新增了双拼的支持,提供了更为稳定的支持,数据可以同步,换皮肤。具体可以参见 搜狗输入法Linux版2.0更新日志

不过安装搜狗输入法Linux版2.0的时候会有一个问题

➜ sudo gdebi sogoupinyin_2.0.0.0078_amd64.deb

结果最后一行提示,

No such key 'Gtk/IMModule' in schema 'org.gnome.settings-daemon.plugins.xsettings' as specified in override file '/usr/share/glib-2.0/schemas/50_sogoupinyin.gschema.override'; ignoring override for this key.

提示
'Gtk/IMModule'
不存在,查看这个schema确实没有

➜  ~ gsettings list-keys org.gnome.settings-daemon.plugins.xsettings
disabled-gtk-modules
priority
hinting
overrides
rgba-order
antialiasing
active
enabled-gtk-modules

代码的本意是要把这个key
Gtk/IMModule
加入到
org.gnome.settings-daemon.plugins.xsettings
中。

所有应该是1

[org.gnome.settings-daemon.plugins.keyboard]
active=false
[org.gnome.settings-daemon.plugins.xsettings]
overrides={'Gtk/IMModule':<'fcitx'>}
# 而不是
# Gtk/IMModule=fcitx
[com.canonical.indicator.keyboard]
visible=false

所以需要修改这个文件并重新打包

Solution

2 1

mkdir -p extract/DEBIAN
#prepare the environ
# 准备环境
dpkg-deb -x sogoupinyin_2.0.0.0078_amd64.deb extract/
# extract the content files
# 解压出内容文件
dpkg-deb -e sogoupinyin_2.0.0.0078_amd64.deb extract/DEBIAN
# extract the control file
# 解压出控制文件
vi extract/usr/share/glib-2.0/schemas/50_sogoupinyin.gschema.override
# correct the file
# change line 4 to overrides={'Gtk/IMModule':<'fcitx'>}
# 更正文件
# 把第四行改成 overrides={'Gtk/IMModule':<'fcitx'>}
dpkg-deb -b extract/ ./sogoupinyin_2.0.0.0078_wkd.deb
# pack the files into deb installer file san save to current dir with name sogoupinyin_2.0.0.0078_wkd.deb
# 重新打包为...
# 无果没有指定文件名,就和原文件名一样,这是在/extract/DEBIAN/control中定义的
sudo gdebi sogoupinyin_2.0.0.0078_wkd.deb
# 安装 install

Conclusion

我把文件挂载在这里 [ Ubuntu x64 ]

dpkg-deb 是对deb installer文件进行解压或者打包的。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: