找回密码
 立即注册
查看: 67|回复: 0

[kali] kali 使用中文输入法

[复制链接]

8

主题

2

回帖

74

积分

管理员

积分
74
发表于 2026-3-31 15:28:01 | 显示全部楼层 |阅读模式
在 Kali Linux 上用中文输入法,优先选 fcitx5 + 拼音,兼容性最好、配置简单。下面给你完整可直接执行的步骤。



一、先确保系统语言是中文(可选但推荐)


  1. # 安装语言支持
  2. sudo apt update
  3. sudo apt install -y locales

  4. # 生成中文 locale
  5. sudo locale-gen zh_CN.UTF-8

  6. # 设置默认中文
  7. sudo update-locale LANG=zh_CN.UTF-8 LANGUAGE=zh_CN:zh LC_ALL=zh_CN.UTF-8
复制代码
二、安装 fcitx5 + 中文拼音(推荐方案)
  1. # 安装 fcitx5 框架、拼音、中文增强、前端支持
  2. sudo apt install -y \
  3.   fcitx5 \
  4.   fcitx5-pinyin \
  5.   fcitx5-chinese-addons \
  6.   fcitx5-frontend-gtk3 fcitx5-frontend-gtk4 \
  7.   fcitx5-frontend-qt5 fcitx5-frontend-qt6 \
  8.   fonts-wqy-zenhei
复制代码
配置默认输入法框架
  1. im-config -n fcitx5
复制代码
弹出确认窗口,选 OK → Yes。

配置环境变量(让所有程序生效)


  1. # 写入用户配置
  2. echo -e "
  3. GTK_IM_MODULE=fcitx5
  4. QT_IM_MODULE=fcitx5
  5. XMODIFIERS=@im=fcitx5
  6. INPUT_METHOD=fcitx5
  7. " >> ~/.xprofile

  8. # 写入系统级配置(可选,更稳)
  9. echo -e "
  10. GTK_IM_MODULE=fcitx5
  11. QT_IM_MODULE=fcitx5
  12. XMODIFIERS=@im=fcitx5
  13. " | sudo tee /etc/environment
复制代码
三、重启系统(必须)
  1. sudo reboot
复制代码
四、使用与配置


1. 切换输入法


  • 默认快捷键:Ctrl + 空格
  • 候选词翻页:- = 或 PageUp/PageDown

2. 打开配置面板


  • 右上角托盘 → 键盘图标 → 右键 → Configure
  • 或终端运行:fcitx5-configtool

3. 添加 / 管理输入法


  • 打开配置 → Input Method
  • 点左下角 +
  • 取消勾选 Only Show Current Language
  • 搜索 Pinyin(拼音),添加
  • 上移到第一位作为默认
  • 五、备选方案:fcitx4(老版本兼容)


    如果 fcitx5 有问题,用 fcitx4:

    1. sudo apt install -y fcitx fcitx-googlepinyin fcitx-config-gtk
    2. im-config -n fcitx
    3. echo -e "
    4. GTK_IM_MODULE=fcitx
    5. QT_IM_MODULE=fcitx
    6. XMODIFIERS=@im=fcitx
    7. " >> ~/.xprofile
    8. sudo reboot
    复制代码
    切换:Ctrl + 空格



    六、常见问题


    • 终端 / 部分程序无法输入中文
      • 确保已配置 ~/.xprofile 并重启
      • 终端里临时生效:source ~/.xprofile

    • 托盘没有输入法图标
      • 手动启动:fcitx5 -d
      • 或添加到开机自启:gnome-session-properties → 添加 fcitx5

    • 候选框乱码
      • 安装中文字体:sudo apt install fonts-wqy-zenhei
      • 配置里换字体





您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|兔窝窝

GMT+8, 2026-5-25 12:31 , Processed in 0.086910 second(s), 19 queries .

Powered by www.tu55.cn

Copyright © www.tu55.cn, All Rights Reserved.

快速回复 返回顶部 返回列表