从 Mac 到 ArchLinux:探索及自用配置
这篇博客只是对自己的配置做简单记录,从 Notion 上拷贝下来的,随时更新。
基本情况
- Linux 使用经验:8年左右,之前使用 Linux 主要用来配置服务器,具有一定的运维经验。
- 显示协议: Wayland
- 桌面环境: Gnome
- GPU: Nvidia + Intel

Part1:可视化
文字相关
字体大小
经过测试,对于27寸4K显示器,在使用 Gnome(Wayland)时采用全域 HIDPI 缩放 150%+字体 1.25 倍时取得的显示效果是最舒服的,参考指标为 Mac 在同样显示器上的效果。
设置全域HIDPI缩放:
gsettings set org.gnome.mutter experimental-features '["scale-monitor-framebuffer", "xwayland-native-scaling"]’
设置1.25倍字体并开机生效:gsettings set org.gnome.desktop.interface text-scaling-factor 1.25
Apple 风格 Emoji 显示
首先安装字体:yay ttf-apple-emoji 之后应该就能正常显示了。
对于 emoji 选择的问题,可以直接在 fcitx5 输入法中输入 emoji 名称(中英文均可),也可以安装一个 picker:pacman -S gnome-characters
,然后自己绑定一个快捷键。
视觉效果增强
模糊效果
yay -S gnome-shell-extension-blur-my-shell(remember to reboot),
then go to the extensions and activate blur-my-shell,
go to the settings and turn on the “applications blur”,
finally, turn on “enable all by default”, and then turn off “opaque focused window”.
now you get a blur and transparent terminal.
显示驱动
https://wiki.archlinuxcn.org/wiki/硬件视频加速
Part2:外设
显示器
亮度调节
yay ddccontrol-db
蓝牙
- 根据型号寻找驱动,一般会有PID/VID:https://oemdrivers.com/bluetooth-ugreen-bluetooth-5-0-adapter
- 查看当前内核支持的设备ID:[https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/bluetooth/btusb.c?h=v6.15.9](https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/bluetooth/btusb.c?h=v6.15.9
Part3:软件及功能
屏幕截图和标注:
sudo pacman -S flameshot
安装并绑定命令为
flameshot gui
的快捷键后,可能发现无法正常截图。参考了这个讨论:https://github.com/flameshot-org/flameshot/issues/3446#issuecomment-1931292685按他的方法创建一个脚本,然后快捷键执行这个 sh 即可正常截图。
1
2#!/bin/sh
/usr/bin/flameshot gui屏幕录制:gnome自带 ctrl+shift+alt+r,功能挺齐全的
flameshot
NVIDIA显卡用户注意:在最新版本的 Webkit2Gtk (2.42.0) 中,由于 Nvidia 专有驱动未完全实现 DMABUF,将导致无法启动和崩溃的情况发生。请降级或在 /etc/environment (或者其他设置环境变量的地方)中加入 WEBKIT_DISABLE_DMABUF_RENDERER=1 环境变量关闭 DMABUF 的使用。
屏幕录制:
sudo pacman -S kooha
nVidia on Wayland 中 Gnome Video Failed to initialized OpenGL with Gtk:
~/.config/environment.d/gdk.conf 中添加:
GDK_GL=gles
Part4:网络
DNS
/etc/systemd/resolved.conf
resolvectl status
sudo systemctl restart systemd-resolved
DHCP(SERVER)
让虚拟机通过 NAT 访问指定网段 10.0.0.0/8
sudo iptables -A FORWARD -i br0 -o enp0s31f6 -d 10.0.0.0/8 -j ACCEPT
sudo iptables -A FORWARD -i enp0s31f6 -o br0 -m state –state RELATED,ESTABLISHED -j ACCEPT
sudo iptables -t nat -A POSTROUTING -o enp0s31f6 -d 10.0.0.0/8 -j MASQUERADE
从 Mac 到 ArchLinux:探索及自用配置