Install sougou pinyin under Ubuntu 16.04
- add a fcitx source
sudo apt-get-repository ppa:fcitx-team/nightly/
2. sudo apt-get update
sudo apt-get insall -f
3. down sougou pinyin deb from sougou website
sudo dpkg -i sogoupinyin_2.0.0.0078_amd64.deb
will met this error:
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.
it is not there actually.
➜ ~ gsettings list-keys org.gnome.settings-daemon.plugins.xsettings
disabled-gtk-modules
priority
hinting
overrides
rgba-order
antialiasing
active
enabled-gtk-modules
look at /usr/share/glib-2.0/schemas/50_sogoupinyin.gschema.override. It should be like this
[org.gnome.settings-daemon.plugins.keyboard]
active=false
[org.gnome.settings-daemon.plugins.xsettings]
overrides={‘Gtk/IMModule’:<’fcitx’>}
[com.canonical.indicator.keyboard]
visible=false
But it is
[org.gnome.settings-daemon.plugins.keyboard]
active=false
[org.gnome.settings-daemon.plugins.xsettings]
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'>}
dpkg-deb -b extract/ ./sogoupinyin_2.0.0.0078_wkd.deb
# pack the files into deb installer file and 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
In setting, Language support, select fcitx in “keyboard input method system”

fcitx-configtool
打开fcitx的配置项, 点击下方的+号,注意取消勾选“Only show current language”,找到sogoupinyin进行添加,即可 通过 Ctrl+空格进行输入法切换了.
sogou-qimpanel 命令是启动搜狗输入法的。
如果还是切换不出输入法,那么执行下面的操作:
配置Fcitx的环境:在~/.bashrc中加入一下内容
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS="@im=fcitx"