您尚未登录。

#1 2023-09-05 00:10:11

tan9p
会员
注册时间: 2015-07-07
帖子: 111

fcitx5在Chromium下无法使用,按照wiki上的提示也无法正常使用。

在上一个系统里同样有这个问题,经过设置可以使用了(没有及时记录操作的过程),重装了系统,发现fcitx5还是在chromium下无法使用(fvwm作窗口管理器),在坛子里看到设置的办法:

gsettings set org.gnome.settings-daemon.plugins.xsettings overrides "{'Gtk/IMModule':<'fcitx'>}"
因为没有装gnome,所以提示no such schema,org.gnome下只有system对象,没有settings-daemon这个.


这是我的diagnose结果:

# System Info:
1.  `uname -a`:

        Linux debian 6.1.0-11-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.38-4 (2023-08-08) x86_64 GNU/Linux

2.  `lsb_release -a`:

        Distributor ID:	Debian
        Description:	Debian GNU/Linux 12 (bookworm)
        Release:	12
        Codename:	bookworm

3.  `lsb_release -d`:

        Description:	Debian GNU/Linux 12 (bookworm)

4.  `/etc/lsb-release`:

    `/etc/lsb-release` not found.

5.  `/etc/os-release`:

        PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
        NAME="Debian GNU/Linux"
        VERSION_ID="12"
        VERSION="12 (bookworm)"
        VERSION_CODENAME=bookworm
        ID=debian
        HOME_URL="https://www.debian.org/"
        SUPPORT_URL="https://www.debian.org/support"
        BUG_REPORT_URL="https://bugs.debian.org/"

6.  Desktop Environment:

    Cannot determine desktop environment.

7.  XDG SESSION TYPE:

        XDG_SESSION_TYPE='tty'

8.  Bash Version:

        BASH_VERSION='5.2.15(1)-release'

# Environment:
1.  DISPLAY:

        DISPLAY=':0'


        WAYLAND_DISPLAY=''

2.  Keyboard Layout:

    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(pc105)"	};
            };

    2.  `xprop`:

            _XKB_RULES_NAMES(STRING) = "evdev", "pc105", "us", "", ""

3.  Locale:

    1.  All locales:

            C
            C.utf8
            en_US.utf8
            POSIX

    2.  Current locale:

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

4.  Directories:

    1.  Home:

            /home/yibo

    2.  `${XDG_CONFIG_HOME}`:

        Environment variable `XDG_CONFIG_HOME` is not set.

        Current value of `XDG_CONFIG_HOME` is `~/.config` (`/home/yibo/.config`).

    3.  Fcitx5 Settings Directory:

        Current fcitx5 settings directory is `~/.config/fcitx5` (`/home/yibo/.config/fcitx5`).

5.  Current user:

    The script is run as yibo (1000).

# Fcitx State:
1.  executable:

    Found fcitx5 at `/usr/bin/fcitx5`.

2.  version:

    Fcitx version: `5.0.21`

3.  process:

    Found 1 fcitx5 process:

            921 fcitx5

4.  `fcitx5-remote`:

    **Cannot connect to fcitx5 correctly.**

5.  DBus interface:

    Using `dbus-send` to check dbus.

    Owner of DBus name `org.fcitx.Fcitx5` is `:1.3`.

    PID of DBus name `org.fcitx.Fcitx5` owner is `921`.

    Debug information from dbus:

           Group [x11::0] has 5 InputContext(s)
          IC [669f7c581fb6411bbc421ed13900e8b3] program:xterm frontend:xim cap:4000000000 focus:1
          IC [d33b7938beeb42e0ab1042d540b14ef5] program:Firefox-esr frontend:dbus cap:6000000012 focus:0
          IC [16017f9dc03a4acd8879dad2a9013304] program:Firefox-esr frontend:dbus cap:6000000012 focus:0
          IC [6c544bbe51364f2681b40492926a47ff] program:Firefox-esr frontend:dbus cap:6000000012 focus:0
          IC [e438f1a6652e40b78a8e7890bbba57f9] program:Firefox-esr frontend:dbus cap:6000000052 focus:0
        Input Context without group

# Fcitx Configure UI:
1.  Config Tool Wrapper:

    Found fcitx5-configtool at `/usr/bin/fcitx5-configtool`.

2.  Config GUI for qt:

    Found `fcitx5-config-qt` at `/usr/bin/fcitx5-config-qt`.

3.  Config GUI for kde:

    **`kcmshell5` not found.**

# Frontends setup:
## Xim:
1.  `${XMODIFIERS}`:

    Environment variable XMODIFIERS is set to "@im=fcitx" correctly.
    Xim Server Name from Environment variable is fcitx.

2.  XIM_SERVERS on root window:

    Xim server name is the same with that set in the environment variable.

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

    Environment variable QT_IM_MODULE is set to "fcitx" correctly.

2.  qt5 - `${QT_IM_MODULE}`:

    Environment variable QT_IM_MODULE is set to "fcitx" correctly.

3.  Qt IM module files:

    Found fcitx5 im module for qt5: `/usr/lib/x86_64-linux-gnu/qt5/plugins/platforminputcontexts/libfcitx5platforminputcontextplugin.so`.
    Found fcitx5 im module for qt6: `/usr/lib/x86_64-linux-gnu/qt6/plugins/platforminputcontexts/libfcitx5platforminputcontextplugin.so`.
    Found fcitx5 qt5 module: `/usr/lib/x86_64-linux-gnu/fcitx5/qt5/libfcitx-quickphrase-editor5.so`.

    Following error may not be accurate because guessing Qt version from path depends on how your distribution packages Qt. It is not a critical error if you do not use any Qt application with certain version of Qt or you are using text-input support by Qt under Wayland.
    **Cannot find fcitx5 input method module for Qt4.**

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

    Environment variable GTK_IM_MODULE is set to "fcitx" correctly.

2.  `gtk-query-immodules`:

    1.  gtk 2:

        Found `gtk-query-immodules` for gtk `2.24.33` at `/usr/bin/gtk-query-immodules-2.0`.
        Version Line:

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

        Found fcitx5 im modules for gtk `2.24.33`.

            "/usr/lib/x86_64-linux-gnu/gtk-2.0/2.10.0/immodules/im-fcitx5.so" 
            "fcitx" "Fcitx5 (Flexible Input Method Framework5)" "fcitx5" "/usr/locale" "ja:ko:zh:*" 
            "fcitx5" "Fcitx5 (Flexible Input Method Framework5)" "fcitx5" "/usr/locale" "ja:ko:zh:*" 

    2.  gtk 3:

        Found `gtk-query-immodules` for gtk `3.24.37` at `/usr/bin/gtk-query-immodules-3.0`.
        Version Line:

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

        Found fcitx5 im modules for gtk `3.24.37`.

            "/usr/lib/x86_64-linux-gnu/gtk-3.0/3.0.0/immodules/im-fcitx5.so" 
            "fcitx" "Fcitx5 (Flexible Input Method Framework5)" "fcitx5" "/usr/locale" "ja:ko:zh:*" 
            "fcitx5" "Fcitx5 (Flexible Input Method Framework5)" "fcitx5" "/usr/locale" "ja:ko:zh:*" 

3.  Gtk IM module cache:

    1.  gtk 2:

        Found immodules cache for gtk `2.24.33` at `/usr/lib/x86_64-linux-gnu/gtk-2.0/2.10.0/immodules.cache`.
        Version Line:

            # Created by /usr/lib/x86_64-linux-gnu/libgtk2.0-0/gtk-query-immodules-2.0 from gtk+-2.24.33

        Found fcitx5 im modules for gtk `2.24.33`.

            "/usr/lib/x86_64-linux-gnu/gtk-2.0/2.10.0/immodules/im-fcitx5.so" 
            "fcitx" "Fcitx5 (Flexible Input Method Framework5)" "fcitx5" "/usr/locale" "ja:ko:zh:*" 
            "fcitx5" "Fcitx5 (Flexible Input Method Framework5)" "fcitx5" "/usr/locale" "ja:ko:zh:*" 

    2.  gtk 3:

        Found immodules cache for gtk `3.24.37` at `/usr/lib/x86_64-linux-gnu/gtk-3.0/3.0.0/immodules.cache`.
        Version Line:

            # Created by /usr/lib/x86_64-linux-gnu/libgtk-3-0/gtk-query-immodules-3.0 from gtk+-3.24.37

        Found fcitx5 im modules for gtk `3.24.37`.

            "/usr/lib/x86_64-linux-gnu/gtk-3.0/3.0.0/immodules/im-fcitx5.so" 
            "fcitx" "Fcitx5 (Flexible Input Method Framework5)" "fcitx5" "/usr/locale" "ja:ko:zh:*" 
            "fcitx5" "Fcitx5 (Flexible Input Method Framework5)" "fcitx5" "/usr/locale" "ja:ko:zh:*" 

    3.  gtk 4:

        **Cannot find immodules cache for gtk 4**

        **Cannot find fcitx5 im module for gtk 4 in cache.**

4.  Gtk IM module files:

    1.  gtk 2:

        All found Gtk 2 immodule files exist.

    2.  gtk 3:

        All found Gtk 3 immodule files exist.

    3.  gtk 4:

        All found Gtk 4 immodule files exist.

# Configuration:
## Fcitx Addons:
1.  Addon Config Dir:

    Found fcitx5 addon config directory: `/usr/share/fcitx5/addon`.

2.  Addon List:

    1.  Found 25 enabled addons:

            Simplified and Traditional Chinese Translation 5.0.16
            Classic User Interface 5.0.21
            Clipboard 5.0.21
            Cloud Pinyin 5.0.16
            DBus 5.0.21
            DBus Frontend 5.0.21
            Emoji 5.0.21
            Fcitx4 Frontend 5.0.21
            Full width character 5.0.16
            IBus Frontend 5.0.21
            Input method selector 5.0.21
            Keyboard 5.0.21
            KDE Input Method Panel 5.0.21
            Status Notifier 5.0.21
            Notification 5.0.21
            Pinyin 5.0.16
            Extra Pinyin functionality 5.0.16
            Punctuation 5.0.16
            Quick Phrase 5.0.21
            Spell 5.0.21
            Unicode 5.0.21
            Wayland 5.0.21
            Wayland Input method frontend 5.0.21
            XCB 5.0.21
            X Input Method Frontend 5.0.21

    2.  Found 0 disabled addons:

3.  Addon Libraries:

    All libraries for all addons are found.

4.  User Interface:

    Found 2 enabled user interface addons:

        Classic User Interface
        KDE Input Method Panel

## Input Methods:
1.  `/home/yibo/.config/fcitx5/profile`:

        [Groups/0]
        # Group Name
        Name=Default
        # Layout
        Default Layout=us
        # Default Input Method
        DefaultIM=pinyin

        [Groups/0/Items/0]
        # Name
        Name=keyboard-us
        # Layout
        Layout=

        [Groups/0/Items/1]
        # Name
        Name=pinyin
        # Layout
        Layout=

        [GroupOrder]
        0=Default

# Log:
1.  `date`:

        Tue Sep  5 12:02:59 AM CST 2023

2.  `/home/yibo/.config/fcitx5/crash.log`:

    `/home/yibo/.config/fcitx5/crash.log` not found.

最开始的是`gtk-query-immodules`下找不到gtk2 和gtk3的immodules,我通过建两个软连接把这两个文件链在了usr/bin/下,所也这块也不报错了。

在fcitx 的wiki上的FAQ上写:

For Chromium running under X11, if you are using startx to start your graphical user interface, you may hit an issue in startx that unset the DBUS_SESSION_BUS_ADDRESS, which prevent chromium based browser from using dbus correctly. To mitigate this, you may:

1. either export DBUS_SESSION_BUS_ADDRESS by yourself in your ~/.xinitrc (or simply change to use ~/.xsession if you are using debian based system).

2. or use a display manager like sddm, gdm, lightdm instead of startx.

For Chromium that runs natively under wayland, the only native wayland input method protocol it supports is text-input-v1, which is only supported by weston. Alternatively, it can also use Gtk4's im module, you can use following flag (---enable-features=UseOzonePlatform --ozone-platform=wayland --gtk-version=4) to make it use Gtk im module, but it doesn't fully work in terms of popup window position unless you are using kimpanel + GNOME. 

在配置文件中export DBUS_SESSION_BUS_ADDRES,但是应该把它的值设成什么呢?

离线

#2 2023-09-05 11:12:32

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

Re: fcitx5在Chromium下无法使用,按照wiki上的提示也无法正常使用。

你有在启动脚本里使用 dbus-launch 或者 dbus-run-session 之类的命令吗?

离线

#3 2023-09-05 11:31:17

tan9p
会员
注册时间: 2015-07-07
帖子: 111

Re: fcitx5在Chromium下无法使用,按照wiki上的提示也无法正常使用。

没有的,启动脚本里就是picom,fcitx,fvwm三个

最近编辑记录 tan9p (2023-09-05 11:33:03)

离线

#4 2023-09-05 19:40:06

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

Re: fcitx5在Chromium下无法使用,按照wiki上的提示也无法正常使用。

echo $DBUS_SESSION_BUS_ADDRESS 结果是什么?

离线

#5 2023-09-05 19:40:37

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

Re: fcitx5在Chromium下无法使用,按照wiki上的提示也无法正常使用。

顺便 systemctl --user status dbus 也看看。

离线

#6 2023-09-05 21:12:52

tan9p
会员
注册时间: 2015-07-07
帖子: 111

Re: fcitx5在Chromium下无法使用,按照wiki上的提示也无法正常使用。

结果是空,DBUS_SESSION_BUS_ADDRESS这个变量没有被定义。
我看介绍说startx把这个变量给unset了,但是我找不到unset DBUS_SESSION_BUS_ADDRESS在哪个文件里。

下面是systemctl status的结果:

● dbus.service - D-Bus User Message Bus
     Loaded: loaded (/usr/lib/systemd/user/dbus.service; static)
     Active: active (running) since Tue 2023-09-05 21:01:37 CST; 6min ago
TriggeredBy: ● dbus.socket
       Docs: man:dbus-daemon(1)
   Main PID: 1082 (dbus-daemon)
      Tasks: 1 (limit: 2216)
     Memory: 776.0K
        CPU: 62ms
     CGroup: /user.slice/user-1000.slice/user@1000.service/session.slice/dbus.service
             └─1082 /usr/bin/dbus-daemon --session --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only

Sep 05 21:01:37 debian systemd[1035]: Starting dbus.service - D-Bus User Message Bus...
Sep 05 21:01:37 debian systemd[1035]: Started dbus.service - D-Bus User Message Bus.
Sep 05 21:02:30 debian dbus-daemon[1082]: [session uid=1000 pid=1082] Activating via systemd: service name='org.freedesktop.portal.Desktop' unit='xdg-desktop-portal.service' requested by ':1.8' (uid=1000 pid=1137 comm="firefox-esr")
Sep 05 21:02:30 debian dbus-daemon[1082]: [session uid=1000 pid=1082] Activating via systemd: service name='org.freedesktop.portal.Documents' unit='xdg-document-portal.service' requested by ':1.9' (uid=1000 pid=1197 comm="/usr/libexec/xdg-desktop-portal")
Sep 05 21:02:30 debian dbus-daemon[1082]: [session uid=1000 pid=1082] Activating via systemd: service name='org.freedesktop.impl.portal.PermissionStore' unit='xdg-permission-store.service' requested by ':1.10' (uid=1000 pid=1201 comm="/usr/libexec/xdg-document-portal")
Sep 05 21:02:30 debian dbus-daemon[1082]: [session uid=1000 pid=1082] Successfully activated service 'org.freedesktop.impl.portal.PermissionStore'
Sep 05 21:02:30 debian dbus-daemon[1082]: [session uid=1000 pid=1082] Successfully activated service 'org.freedesktop.portal.Documents'
Sep 05 21:02:31 debian dbus-daemon[1082]: [session uid=1000 pid=1082] Activating via systemd: service name='org.freedesktop.impl.portal.desktop.gtk' unit='xdg-desktop-portal-gtk.service' requested by ':1.9' (uid=1000 pid=1197 comm="/usr/libexec/xdg-desktop-portal")
Sep 05 21:04:30 debian dbus-daemon[1082]: [session uid=1000 pid=1082] Failed to activate service 'org.freedesktop.portal.Desktop': timed out (service_start_timeout=120000ms)
Sep 05 21:04:31 debian dbus-daemon[1082]: [session uid=1000 pid=1082] Failed to activate service 'org.freedesktop.impl.portal.desktop.gtk': timed out (service_start_timeout=120000ms)

离线

#7 2023-09-05 21:45:37

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

Re: fcitx5在Chromium下无法使用,按照wiki上的提示也无法正常使用。

哦,原来如此。这个变量的值应当是 unix:path=/run/user/$UID/bus,是由 pam_systemd 设置的。我不知道你那边为什么没有。
另外你的 dbus 报错,需要安装 xdg-desktop-portal-gtk,不然某些操作可能会等很久。

离线

#8 2023-09-05 22:08:35

tan9p
会员
注册时间: 2015-07-07
帖子: 111

Re: fcitx5在Chromium下无法使用,按照wiki上的提示也无法正常使用。

谢谢依云大大,设置DBUS_SESSION_BUS_ADDRESS=“unix:path=/run/user/$UID/bus” 再启动chromium,就可以正常使用fcitx了。

离线

#9 2023-09-05 22:38:22

tan9p
会员
注册时间: 2015-07-07
帖子: 111

Re: fcitx5在Chromium下无法使用,按照wiki上的提示也无法正常使用。

依云大大,我还有个问题:就是在我想把export DBUS_SESSION_BUS_ADDRESS=“unix:path=/run/user/$UID/bus” 写到.xinitrc里时,发现$UID没办法替换成用户ID,我记得文件里的变量获取好像跟sh里的不一样,但是手头没有shell的书,在网上没有检索到这个知识点,还请开始一下:想在文件里获取变量的值,需要注意些什么?

离线

#10 2023-09-05 22:52:28

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

Re: fcitx5在Chromium下无法使用,按照wiki上的提示也无法正常使用。

它也是 shell 脚本,应该能正确扩展啊。
另外你可以直接硬编码你的 uid。

离线

页脚