首页 > 系统相关 >ubuntu22.04 在多个应用中不能调用 fcitx5 输入法的问题

ubuntu22.04 在多个应用中不能调用 fcitx5 输入法的问题

时间:2023-04-18 11:57:12浏览次数:51  
标签:输入法 ubuntu22.04 systemd fcitx5 fcitx file 环境变量 加载

网上找了很多教程,都是设置环境变量,本身思路没问题。

只不过有问题的是,环境变量是基于会话的。大多数教程设置环境变量的方法需要启动一个 shell 进程才能加载。

而用户的窗口进程是系统启动的时候就已经加载了,肯定不会去加载 shell 的环境变量。

在用户配置中写入环境变量

直接把环境变量写进用户的配置文件就可以解决这个问题。
/etc/systemd/user.conf 中加入一行DefaultEnvironment就可以解决这个问题

#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it under the
#  terms of the GNU Lesser General Public License as published by the Free
#  Software Foundation; either version 2.1 of the License, or (at your option)
#  any later version.
#
# Entries in this file show the compile time defaults. Local configuration
# should be created by either modifying this file, or by creating "drop-ins" in
# the user.conf.d/ subdirectory. The latter is generally recommended.
# Defaults can be restored by simply deleting this file and all drop-ins.
#
# See systemd-user.conf(5) for details.

[Manager]
DefaultEnvironment=XMODIFIERS="@im=fcitx" XIM=fcitx XIM_PROGRAM=fcitx GTK_IM_MODULE=fcitx QT_IM_MODULE=fcitx 
#QT_QPA_PLATFORM=wayland
#LogLevel=info
#LogTarget=console
#LogColor=yes
#LogLocation=no
#LogTime=no
#SystemCallArchitectures=
#TimerSlackNSec=
#StatusUnitFormat=description
#DefaultTimerAccuracySec=1min
#DefaultStandardOutput=inherit
#DefaultStandardError=inherit
#DefaultTimeoutStartSec=90s
#DefaultTimeoutStopSec=90s
#DefaultTimeoutAbortSec=
#DefaultRestartSec=100ms
#DefaultStartLimitIntervalSec=10s
#DefaultStartLimitBurst=5
#DefaultEnvironment=
#DefaultLimitCPU=
#DefaultLimitFSIZE=
#DefaultLimitDATA=
#DefaultLimitSTACK=
#DefaultLimitCORE=
#DefaultLimitRSS=
#DefaultLimitNOFILE=
#DefaultLimitAS=
#DefaultLimitNPROC=
#DefaultLimitMEMLOCK=
#DefaultLimitLOCKS=
#DefaultLimitSIGPENDING=
#DefaultLimitMSGQUEUE=
#DefaultLimitNICE=
#DefaultLimitRTPRIO=
#DefaultLimitRTTIME=

pyqt5不能调用fcitx5

这个问题的根源在于pyqt5没有正确加载fcitx5的库文件,找到文件复制到对应的文件夹就可以了。
我两次处理这个问题的过程都不一样,但是核心解决思路是一样的。
具体过程问问百度吧。

标签:输入法,ubuntu22.04,systemd,fcitx5,fcitx,file,环境变量,加载
From: https://www.cnblogs.com/NagaResst/p/17329068.html

相关文章

  • Ubuntu系统搜狗输入法无法在IDEA全局搜索(Ctrl+Shift+F)中输入中文
    前提需要关闭输入法的Ctrl+Shift+F的中文简体和繁体切换快捷键清除IDEA缓存并重启File-->InvalidateCaches/Restart.........
  • mac rime输入法配置
    https://zhuanlan.zhihu.com/p/616944025https://zhuanlan.zhihu.com/p/265794084顏色設置:https://www.w3schools.cn/html/html_colors_hex.asp#:~:text=%E5%8D%81%E5%85%AD%E8%BF%9B%E5%88%B6%E9%A2%9C%E8%89%B2%E7%94%B1%23,%E6%8C%87%E5%AE%9A%E9%A2%9C%E8%89%B2%E7%9A%84%......
  • ubuntu22.04 部署 dnsmasq
    禁用systemd-resolved#sudosystemctldisablesystemd-resolved#sudosystemctlstopsystemd-resolved安装依赖#apt-yinstallmakegcc下载dnsmasq#wgethttps://thekelleys.org.uk/dnsmasq/dnsmasq-2.89.tar.gz安装dnsmasq创建dnsmasq用户#groupadd-rdnsmasq......
  • 九宫格输入法
    假设有九宫格输入法键盘布局如下:[1,.?!][2ABC][3DEF][4GHI][5JKL][6MNO][7PQRS][8TUV][9WXYZ][0空]注意:中括号[]仅为了表示键盘的分隔,不是输入字符。每个中括号中,位于首位的数字字符即是键盘的按键,按一下即可输入该数字字符。......
  • ubuntu22.04 部署filebeat 8.7
    下载filebeat#curl-L-Ohttps://artifacts.elastic.co/downloads/beats/filebeat/filebeat-8.7.0-linux-x86_64.tar.gz创建数据目录#mkdir-pv/data/apps/filbeat/{data,logs}安装filebeat#tarxzvffilebeat-8.7.0-linux-x86_64.tar.gz-C/usr/local/#ln-sv/usr/......
  • 2023 最新的如何树莓派上安装中文输入法和设置中文语言环境教程 All In One
    2023最新的如何树莓派上安装中文输入法和设置中文语言环境教程AllInOne亲测有效:RaspberryPi3B+RaspberryPiOS(64-bit)descscreenshotRaspberryPi3BRaspberryPiOS(64-bit)https://www.cnblogs.com/xgqfrms/p/17300085.html#5166108操作步骤......
  • ubuntu22.04 安装中文字体
    安装中文字体sudoapt-getinstallttf-wqy-microhei#文泉驿-微米黑sudoapt-getinstallttf-wqy-zenhei#文泉驿-正黑sudoapt-getinstallxfonts-wqy#文泉驿-点阵宋体vimrc#cat/etc/vim/vimrc....setfileencodings=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936set......
  • ubuntu22.04 添加开机启动脚本
    在目录/etc/init.d/目录新建脚本sudovim/etc/init.d/startup.sh#!/bin/bash#Onlyfortesttouch/root/1.txt添加执行权限sudochmod+x/etc/init.d/startup.sh添加启动脚本sudoupdate-rc.dstartup.shdefaults90查看服务列表sudoservice--status-all测试是......
  • kali装机 安装输入法 修改国内源
    1-先配置国内源官方kali源vim/etc/apt/sources.list插入如下源debhttp://mirrors.aliyun.com/kalisanamainnon-freecontribdebhttp://mirrors.aliyun.com/kali-security/sana/updatesmaincontribnon-freedeb-srchttp://mirrors.aliyun.com/kali-security/sana/up......
  • Ubuntu22.04办公环境初始设置记录
    1前言这周末刚从Windows办公环境切换到Ubuntu22.04,有些东西还是比较折腾,记录一下便于以后查找。2.安装时的分区设置从一块完整的新硬盘安装Ubuntu单系统时,只需要以下分区:ESP分区(EFISystemPartition),设为200MB即可,是GPT分区表存储的位置。UEFI引导的系统都需要这个分区。......