您尚未登录。

#1 2015-08-22 22:07:06

碓冰1992
会员
注册时间: 2015-08-22
帖子: 8

[已解决]请教前辈们,输入法不能切换

系统语言英文时安装了fcitx,fcitx-rime,可以正常使用,但是系统语言切回中文后,输入法不正常了,不能切换了,打不了中文,谢谢

最近编辑记录 碓冰1992 (2015-08-23 17:46:35)

离线

#2 2015-08-23 01:34:36

依云
会员
所在地: a.k.a. 百合仙子
注册时间: 2011-08-21
帖子: 8,470
个人网站

Re: [已解决]请教前辈们,输入法不能切换

贴 fcitx-diagnose 的输出。

离线

#3 2015-08-23 13:49:30

碓冰1992
会员
注册时间: 2015-08-22
帖子: 8

Re: [已解决]请教前辈们,输入法不能切换

百合仙子 说:

贴 fcitx-diagnose 的输出。

fcitx-diagnose

# 系统信息:
1.  `uname -a`:

        Linux sony 4.1.5-1-ARCH #1 SMP PREEMPT Tue Aug 11 15:41:14 CEST 2015 x86_64 GNU/Linux

2.  `lsb_release`:

    `lsb_release` 未找到.

3.  `/etc/lsb-release`:

    `/etc/lsb-release` 未找到.

4.  `/etc/os-release`:

        NAME="Arch Linux"
        ID=arch
        PRETTY_NAME="Arch Linux"
        ANSI_COLOR="0;36"
        HOME_URL="https://www.archlinux.org/"
        SUPPORT_URL="https://bbs.archlinux.org/"
        BUG_REPORT_URL="https://bugs.archlinux.org/"

5.  桌面环境:

    桌面环境为 `xfce`。

6.  Bash Version:

        BASH_VERSION='4.3.39(1)-release'

# 环境:
1.  DISPLAY:

        DISPLAY=':0.0'

2.  键盘布局:

    1.  `setxkbmap`:

            xkb_keymap {
            	xkb_keycodes  { include "evdev+aliases(qwerty)"	};
            	xkb_types     { include "complete"	};
            	xkb_compat    { include "complete"	};
            	xkb_symbols   { include "pc+us+inet(evdev)"	};
            	xkb_geometry  { include "pc(pc104)"	};
            };

    2.  `xprop`:

        `xprop` 未找到.

3.  Locale:

    1.  全部可用 locale:

            C
            en_US.utf8
            POSIX
            zh_CN.utf8
            zh_TW.utf8

    2.  当前 locale:

            LANG=zh_CN.UTF-8
            LC_CTYPE=zh_CN.UTF-8
            LC_NUMERIC="zh_CN.UTF-8"
            LC_TIME="zh_CN.UTF-8"
            LC_COLLATE="zh_CN.UTF-8"
            LC_MONETARY="zh_CN.UTF-8"
            LC_MESSAGES="zh_CN.UTF-8"
            LC_PAPER="zh_CN.UTF-8"
            LC_NAME="zh_CN.UTF-8"
            LC_ADDRESS="zh_CN.UTF-8"
            LC_TELEPHONE="zh_CN.UTF-8"
            LC_MEASUREMENT="zh_CN.UTF-8"
            LC_IDENTIFICATION="zh_CN.UTF-8"
            LC_ALL=

4.  目录:

    1.  主目录:

            /home/youjie

    2.  `${XDG_CONFIG_HOME}`:

        环境变量 `XDG_CONFIG_HOME` 没有设定。

        `XDG_CONFIG_HOME` 的当前值是 `~/.config` (`/home/youjie/.config`)。

    3.  Fcitx 设置目录:

        当前 fcitx 设置目录是 `~/.config/fcitx` (`/home/youjie/.config/fcitx`)。

5.  当前用户:

    脚本作为 youjie (1000) 运行。

# Fcitx 状态:
1.  可执行文件:

    在 `/usr/bin/fcitx` 找到了 fcitx.

2.  版本:

    Fcitx 版本: `4.2.9`

3.  进程:

    找到了 2 个 fcitx 进程:

          535 fcitx
          544 fcitx-dbus-watc

4.  `fcitx-remote`:

    `fcitx-remote` 工作正常.

# Fcitx 配置界面:
1.  配置工具封装:

    在 `/usr/bin/fcitx-configtool` 找到了 fcitx-configtool。

2.  用于 GTK+-2.0 的配置界面:

    **未找到 gtk2 的配置界面.**

3.  用于 GTK+-3.0 的配置界面:

    在 `/usr/bin/fcitx-config-gtk3` 找到了 `fcitx-config-gtk3`。

4.  KDE 的配置界面:

    **`kcmshell4` 未找到.**

# 前端设置:
## Xim:
1.  `${XMODIFIERS}`:

    **XMODIFIERS 没有设置**

    **请使用您发行版提供的工具将环境变量 XMODIFIERS 设为 "@im=fcitx" 或者将 `export XMODIFIERS=@im=fcitx` 添加到您的 `~/.xprofile` 中. 参见 [输入法相关的环境变量: XMODIFIERS](http://fcitx-im.org/wiki/Input_method_related_environment_variables/zh-cn#XMODIFIERS).**
    从环境变量中获取的 Xim 服务名称为 fcitx.

2.  根窗口上的 XIM_SERVERS:

    **`xprop` 未找到.**

## Qt:
1.  qt4 - `${QT4_IM_MODULE}`:

    **请使用您发行版提供的工具将环境变量 QT_IM_MODULE 设为 "fcitx" 或者将 `export QT_IM_MODULE=fcitx` 添加到您的 `~/.xprofile` 中. 参见 [输入法相关的环境变量: QT_IM_MODULE](http://fcitx-im.org/wiki/Input_method_related_environment_variables/zh-cn#QT_IM_MODULE).**

2.  qt5 - `${QT_IM_MODULE}`:

    **请使用您发行版提供的工具将环境变量 QT_IM_MODULE 设为 "fcitx" 或者将 `export QT_IM_MODULE=fcitx` 添加到您的 `~/.xprofile` 中. 参见 [输入法相关的环境变量: QT_IM_MODULE](http://fcitx-im.org/wiki/Input_method_related_environment_variables/zh-cn#QT_IM_MODULE).**

3.  Qt 输入法模块文件:
    找到了 Qt5 的输入法模块: `/usr/lib/qt/plugins/platforminputcontexts/libfcitxplatforminputcontextplugin.so`.
    找到了 Qt4 的输入法模块: `/usr/lib/qt4/plugins/inputmethods/qtim-fcitx.so`.
    找到了 fcitx 的 qt 模块: `/usr/lib/fcitx/qt/libfcitx-quickphrase-editor.so`.

## Gtk:
1.  gtk - `${GTK_IM_MODULE}`:

    **请使用您发行版提供的工具将环境变量 GTK_IM_MODULE 设为 "fcitx" 或者将 `export GTK_IM_MODULE=fcitx` 添加到您的 `~/.xprofile` 中. 参见 [输入法相关的环境变量: GTK_IM_MODULE](http://fcitx-im.org/wiki/Input_method_related_environment_variables/zh-cn#GTK_IM_MODULE).**

2.  `gtk-query-immodules`:

    1.  gtk 2:

        在 `/usr/bin/gtk-query-immodules-2.0` 找到了 gtk `2.24.28` 的 `gtk-query-immodules`.
        版本行:

            # Created by /usr/bin/gtk-query-immodules-2.0 from gtk+-2.24.28

        已找到 gtk `2.24.28` 的 fcitx 输入法模块.

            "/usr/lib/gtk-2.0/2.10.0/immodules/im-fcitx.so" 
            "fcitx" "Fcitx (Flexible Input Method Framework)" "fcitx" "/usr/share/locale" "ja:ko:zh:*" 

    2.  gtk 3:

        在 `/usr/bin/gtk-query-immodules-3.0` 找到了 gtk `3.16.6` 的 `gtk-query-immodules`.
        版本行:

            # Created by /usr/bin/gtk-query-immodules-3.0 from gtk+-3.16.6

        已找到 gtk `3.16.6` 的 fcitx 输入法模块.

            "/usr/lib/gtk-3.0/3.0.0/immodules/im-fcitx.so" 
            "fcitx" "Fcitx (Flexible Input Method Framework)" "fcitx" "/usr/share/locale" "ja:ko:zh:*" 

3.  Gtk 输入法模块缓存:

    1.  gtk 2:

        在 `/usr/lib/gtk-2.0/2.10.0/immodules.cache` 找到了 gtk `2.24.28` 的输入法模块缓存.
        版本行:

            # Created by usr/bin/gtk-query-immodules-2.0 from gtk+-2.24.28

        已找到 gtk `2.24.28` 的 fcitx 输入法模块.

            "/usr/lib/gtk-2.0/2.10.0/immodules/im-fcitx.so" 
            "fcitx" "Fcitx (Flexible Input Method Framework)" "fcitx" "/usr/share/locale" "ja:ko:zh:*" 

    2.  gtk 3:

        在 `/usr/lib/gtk-3.0/3.0.0/immodules.cache` 找到了 gtk `3.16.6` 的输入法模块缓存.
        版本行:

            # Created by usr/bin/gtk-query-immodules-3.0 from gtk+-3.16.6

        已找到 gtk `3.16.6` 的 fcitx 输入法模块.

            "/usr/lib/gtk-3.0/3.0.0/immodules/im-fcitx.so" 
            "fcitx" "Fcitx (Flexible Input Method Framework)" "fcitx" "/usr/share/locale" "ja:ko:zh:*" 

4.  Gtk 输入法模块文件:

    1.  gtk 2:

        找到的全部 Gtk 2 输入法模块文件均存在.

    2.  gtk 3:

        找到的全部 Gtk 3 输入法模块文件均存在.

# 配置:
## Fcitx 插件:
1.  插件配置文件目录:

    找到了 fcitx 插件配置目录: `/usr/share/fcitx/addon`.

2.  插件列表:

    1.  找到了 25 个已启用的插件:

            fcitx-autoeng
            fcitx-chttrans
            fcitx-classic-ui
            fcitx-clipboard
            fcitx-dbus
            fcitx-freedesktop-notify
            fcitx-fullwidth-char
            fcitx-imselector
            fcitx-ipc
            fcitx-keyboard
            fcitx-kimpanel-ui
            fcitx-notificationitem
            fcitx-pinyin
            fcitx-pinyin-enhance
            fcitx-punc
            fcitx-quickphrase
            fcitx-remote
            fcitx-spell
            fcitx-table
            fcitx-unicode
            fcitx-vk
            fcitx-x11
            fcitx-xim
            fcitx-xkb
            fcitx-xkbdbus

    2.  找到了 1 个被禁用的插件:

            fcitx-qw

3.  插件库: 

    所有插件所需的库都被找到。

4.  用户界面:

    找到了 2 个已启用的用户界面插件:

        fcitx-classic-ui
        fcitx-kimpanel-ui

## 输入法:
1.  找到了 2 个启用的输入法:

        fcitx-keyboard-us
        shuangpin

2.  默认输入法:

    您已经正确的将一个键盘输入法 "fcitx-keyboard-us" 设为默认.

# 日志:
1.  `date`:

        2015年 08月 23日 星期日 13:28:21 CST

2.  `~/.config/fcitx/log/`:

        总用量 0

3.  `~/.config/fcitx/log/crash.log`:

    `~/.config/fcitx/log/crash.log` 未找到.

.xprofile

export XMODIFIERS="@im=fcitx"
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx

.xinitrc

#!/bin/sh

userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap

# merge in defaults and keymaps

if [ -f $sysresources ]; then







    xrdb -merge $sysresources

fi

if [ -f $sysmodmap ]; then
    xmodmap $sysmodmap
fi

if [ -f "$userresources" ]; then







    xrdb -merge "$userresources"

fi

if [ -f "$usermodmap" ]; then
    xmodmap "$usermodmap"
fi

# start some nice programs

if [ -d /etc/X11/xinit/xinitrc.d ] ; then
 for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
  [ -x "$f" ] && . "$f"
 done
 unset f
fi

export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS="@im=fcitx"

twm &
xclock -geometry 50x50-1+1 &
xterm -geometry 80x50+494+51 &
xterm -geometry 80x20+494-0 &
exec xterm -geometry 80x66+0+0 -name login

xiexie~

离线

#4 2015-08-23 14:00:44

依云
会员
所在地: a.k.a. 百合仙子
注册时间: 2011-08-21
帖子: 8,470
个人网站

Re: [已解决]请教前辈们,输入法不能切换

环境变量没设置成功。你的桌面环境是怎么启动的呢?

离线

#5 2015-08-23 14:30:46

碓冰1992
会员
注册时间: 2015-08-22
帖子: 8

Re: [已解决]请教前辈们,输入法不能切换

百合仙子 说:

环境变量没设置成功。你的桌面环境是怎么启动的呢?

startxfce4

最近编辑记录 碓冰1992 (2015-08-23 14:31:42)

离线

#6 2015-08-23 14:46:20

依云
会员
所在地: a.k.a. 百合仙子
注册时间: 2011-08-21
帖子: 8,470
个人网站

Re: [已解决]请教前辈们,输入法不能切换

碓冰1992 说:
百合仙子 说:

环境变量没设置成功。你的桌面环境是怎么启动的呢?

startxfce4

在哪里?文本终端下?

离线

#7 2015-08-23 14:49:59

碓冰1992
会员
注册时间: 2015-08-22
帖子: 8

Re: [已解决]请教前辈们,输入法不能切换

百合仙子 说:
碓冰1992 说:
百合仙子 说:

环境变量没设置成功。你的桌面环境是怎么启动的呢?

startxfce4

在哪里?文本终端下?

shide,没有安装登录管理器

最近编辑记录 碓冰1992 (2015-08-23 14:51:36)

离线

#8 2015-08-23 15:02:21

依云
会员
所在地: a.k.a. 百合仙子
注册时间: 2011-08-21
帖子: 8,470
个人网站

Re: [已解决]请教前辈们,输入法不能切换

碓冰1992 说:
百合仙子 说:
碓冰1992 说:
百合仙子 说:

环境变量没设置成功。你的桌面环境是怎么启动的呢?

startxfce4

在哪里?文本终端下?

shide,没有安装登录管理器

那你先 . ~/.xprofile 一下……

离线

#9 2015-08-23 15:08:41

碓冰1992
会员
注册时间: 2015-08-22
帖子: 8

Re: [已解决]请教前辈们,输入法不能切换

百合仙子 说:

那你先 . ~/.xprofile 一下……

执行不了,本来没有这文件,我用Vim创建的...

离线

#10 2015-08-23 15:58:45

碓冰1992
会员
注册时间: 2015-08-22
帖子: 8

Re: [已解决]请教前辈们,输入法不能切换

百合仙子 说:
碓冰1992 说:
百合仙子 说:
碓冰1992 说:
百合仙子 说:

环境变量没设置成功。你的桌面环境是怎么启动的呢?

startxfce4

在哪里?文本终端下?

shide,没有安装登录管理器

那你先 . ~/.xprofile 一下……

!!!!!解决了,真的是环境变量的问题,我在.zshrc添加就可以!

➜  ~  cat .zshrc 
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh

export XMODIFIERS=@im=fcitx
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx

非常感谢前辈指点!!可以还是不懂,为什么系统切换回英文不用修改环境变量也正常啊

离线

#11 2015-08-23 18:06:29

依云
会员
所在地: a.k.a. 百合仙子
注册时间: 2011-08-21
帖子: 8,470
个人网站

Re: [已解决]请教前辈们,输入法不能切换

因为不设置环境变量的话它能不能正常用全看人品……我以前就一直不设置环境变量用的,后来才出问题。

离线

#12 2015-08-23 19:56:12

碓冰1992
会员
注册时间: 2015-08-22
帖子: 8

Re: [已解决]请教前辈们,输入法不能切换

百合仙子 说:

因为不设置环境变量的话它能不能正常用全看人品……我以前就一直不设置环境变量用的,后来才出问题。

好吧。。。还有,文本终端startxfce4貌似不执行.xinitrc文件,我现在把.zshrc的环境变量删了,修改了.xinitrc,然后开机直接startx
.xinitrc

#fcitx
export XMODIFIERS=@im=fcitx
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx

#autostart
exec startxfce4

之前直接startx启动不了桌面,现在一切都好了。谢谢啊~

离线

#13 2015-08-25 22:25:10

farseerfc
会员
注册时间: 2013-07-30
帖子: 210
个人网站

Re: [已解决]请教前辈们,输入法不能切换

startx 是 source .xinitrc 的。
用 DM 的話(除了 slim) 是 souce .xprofile 的。
自己手動 startxfce4 的話就只能自己手動來咯……


computerは神様だと信じていて
だからVIMの上でずっと指が舞って
自ら恋愛相手を作り出して

离线

#14 2015-08-26 21:41:10

碓冰1992
会员
注册时间: 2015-08-22
帖子: 8

Re: [已解决]请教前辈们,输入法不能切换

farseerfc 说:

startx 是 source .xinitrc 的。
用 DM 的話(除了 slim) 是 souce .xprofile 的。
自己手動 startxfce4 的話就只能自己手動來咯……

嗯嗯,懂了。难怪我的没有.xprofile文件,谢谢啦~

离线

页脚