Skip to Content
记一些Linux小随笔

Create: 2025-03-25

Update: 2025-08-05

修改默认中文字体优先级

sudo pacman -S adobe-source-han-serif-cn-fonts adobe-source-han-sans-cn-font noto-fonts-cjk

写入到 /etc/fonts/local.conf

/etc/fonts/local.conf
<?xml version="1.0"?> <!DOCTYPE fontconfig SYSTEM "fonts.dtd"> <fontconfig> <its:rules xmlns:its="http://www.w3.org/2005/11/its" version="1.0"> <its:translateRule translate="no" selector="/fontconfig/*[not(self::description)]" /> </its:rules> <description>CN Font Config</description> <!-- Font directory list --> <dir>/usr/share/fonts</dir> <dir>/usr/local/share/fonts</dir> <dir prefix="xdg">fonts</dir> <!-- the following element will be removed in the future --> <dir>~/.fonts</dir> <!-- Disable embedded bitmap fonts --> <match target="font"> <edit name="embeddedbitmap" mode="assign"> <bool>false</bool> </edit> </match> <!-- Chinese uses Source Han Sans and Source Han Serif by default, not Noto Sans CJK SC, since it will show Japanese Kanji in some cases. --> <match> <test name="lang" compare="contains"> <string>zh</string> </test> <test name="family"> <string>serif</string> </test> <edit name="family" mode="prepend"> <string>Source Han Serif CN</string> </edit> </match> <match> <test name="lang" compare="contains"> <string>zh</string> </test> <test name="family"> <string>sans-serif</string> </test> <edit name="family" mode="prepend"> <string>Source Han Sans CN</string> </edit> </match> <match> <test name="lang" compare="contains"> <string>zh</string> </test> <test name="family"> <string>monospace</string> </test> <edit name="family" mode="prepend"> <string>Noto Sans Mono CJK SC</string> </edit> </match> <!-- Load local system customization file --> <include ignore_missing="yes">conf.d</include> <!-- Font cache directory list --> <cachedir>/var/cache/fontconfig</cachedir> <cachedir prefix="xdg">fontconfig</cachedir> <!-- the following element will be removed in the future --> <cachedir>~/.fontconfig</cachedir> <config> <!-- Rescan configurations every 30 seconds when FcFontSetList is called --> <rescan> <int>30</int> </rescan> </config> </fontconfig>

linux 微信缩放

直接修改图标环境变量

QT_AUTO_SCREEN_SCALE_FACTOR=1.5

SDDM 缩放

/etc/sddm.conf.d/hidpi.conf

/etc/sddm.conf.d/hidpi.conf
[General] GreeterEnvironment=QT_SCREEN_SCALE_FACTORS=1.5,QT_FONT_DPI=120

输入法

kde 还是要用 fcitx

kcm-fcitx5 会捆绑 fcitx5-qt,单独装下 fcitx5-gtk,缓解高速打字丢字情况

sudo pacman -S fcitx5-rime kcm-fcitx5 fcitx5-gtk

wayland 下输入法

/etc/environment

/etc/environment
XMODIFIERS=@im=fcitx

x11 输入法

微信 wps只用配置qt的环境变量即可,但是还是推荐都配置防止丢字 GTK_IM_MODULE=fcitx QT_IM_MODULE=fcitx

Electron 及 chrome

低版本 --enable-features=UseOzonePlatform --ozone-platform=wayland --enable-wayland-ime 高版本 --ozone-platform-hint=wayland --enable-wayland-ime

强制 qt 使用 wayland

配置环境变量

QT_QPA_PLATFORM=wayland

Java 的缩放只能整数倍缩放

wps 缺 windows 下的字体

直接 xcopy 把 C:\windows\font 复制到 /usr/share/fonts/wps-office

wps kde 下复制卡住

配置 kde 粘贴板-操作菜单-包含 MIME 操作,关闭

kde 电源管理性能模式

sudo pacman -S power-profiles-daemon

wayland 渲染模式下通用 wayland 图标

kde 窗口规则里检测一下桌面文件名是什么,以 chromium 为例,修改为

cd ~/.local/share/applications

mv chromium.desktop chromium-browser.desktop

配置 Journal 自动清理日志

/etc/systemd/journald.conf
SystemMaxUse=50M

查看 cpu 温度

cat /sys/class/thermal/thermal_zone0/temp

代理

export http_proxy=socks5://127.0.0.1:2333 export https_proxy=socks5://127.0.0.1:2333

无界 14x KDE 触摸版禁用后自动重新打开

键盘-快捷键-触摸板

把除了触摸板切换外的快捷键全部禁用

因为发送切换触摸板的信号和启用/禁用快捷键是一个按键信号

微信小程序抓包

直接配置系统代理即可
或使用进程代理,实测 proxychains 会导致小程序无法打开
使用 proxy-ns

游戏优化

sudo pacman -S gamescope gamemode lib32-gamemode sudo usermod -aG gamemode $USER

为 steam 配置启动参数

gamemoderun gamescope -W 2880 -H 1800 -r 120 -f -- %command% -perfectworld

自定义 dns 防止连接 wifi 时被修改

/etc/NetworkManager/conf.d/90-dns-none.conf
[main] dns=none

linux 微信小程序位置

~/.xwechat/radium/Applet/packages/

可通过

~/.xwechat/radium/Applet/icon/

对应的图标文件名快速定位

Virtualbox Wayland 丢失鼠标

虚拟机设置-用户界面-小工具栏
关闭小工具的显示即可 社区讨论 

连接 WIFI 时打开热点

sudo pacman -S iw

iw dev检查 valid interface combinations:

valid interface combinations: * #{ managed, P2P-client } <= 2, #{ AP, P2P-GO } <= 1, #{ P2P-device } <= 1, total <= 3, #channels <= 2

managed <= 2 或更大数字时可正常开启热点

添加一张管理网卡

sudo iw dev wlan0 interface add wlan-hospot type managed

然后直接通过 KDE 的网络管理器就可以创建热点了, 不过实测有个小 Bug, 通过设置配置的默认热点名和密码, 要重启才能生效

vlc无法播放视频编解码器暂不支持 arch 新版本把插件包拆分了

sudo pacman -S vlc-plugins-all