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
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文件進行解壓或者打包的。