OFFSET偏移
← 文章目录OFFSET / FIELD NOTESNO. 066

GNOME 笔记本管理与桌面美化

配置混合显卡、电源和休眠,再调整 GNOME、Zsh 与终端外观。

所在专题Arch Linux ↗
约 12 分钟阅读开始阅读

本文整理自 shorinkiwata/archlinuxinstall,保留原教程的操作深度并进行匿名化与风险校正。安装包名、扩展、驱动和界面可能随滚动更新变化,以下命令均为阅读示例,没有在此任务中执行或验证。

显卡与休眠的前提#

切换显卡可能中断图形会话,先保存工作并确认有可用 TTY/恢复入口。GPU 管理工具的模式依赖硬件和固件,不能只凭品牌套用。

休眠配置不止添加 hook:还需交换目标、initramfs 恢复机制及可用的恢复位置。现代 UEFI + systemd 环境可使用 HibernateLocation 自动记录位置;手动配置 swapfile 时应指定文件所在设备与 resume_offset。Btrfs 的 offset 用以下命令取得,不能照抄其他机器的数值:

sudo btrfs inspect-internal map-swapfile -r /swap/swapfile

若需要手动设置内核参数:

resume=UUID=<SWAP_BACKING_FILESYSTEM_UUID> resume_offset=<BTRFS_SWAPFILE_OFFSET>

改动后重建当前使用的 initramfs/UKI 和引导配置,再重启验证。使用加密交换、Secure Boot lockdown 或特殊内核时另行核对支持条件。

笔记本#

显卡切换

切换为集显模式

asus 华硕用户可以用 supergfxctl

Linux for ROG Notebooks

yay -S supergfxctl
sudo systemctl enable --now supergfxd.service
扩展下载GPU supergfxctl switch
使用方法:
Integrated supergfxctl --mode Integrated
Hybrid supergfxctl --mode Hybrid
VFIO supergfxctl --mode Vfio
AsusEgpu supergfxctl --mode AsusEgpu
AsusMuxDgpu supergfxctl --mode AsusMuxDgpu

envycontrol

GitHub - bayasdev/envycontrol: Easy GPU switching for Nvidia Optimus laptops under Linux

  • 笔记本 BIOS 内切换为混合模式
yay -S envycontrol
  • 安装 gnome 插件,GPU Profile Selector
https://extensions.gnome.org/extension/5009/gpu-profile-selector/
  • 在右上角切换显卡至 integrated

混合模式下用独显运行程序

PRIME

sudo pacman -S nvidia-prime
  • 命令行内使用 prime-run 命令使用独显运行软件
prime-run firefox
  • 使用 pinapp 修改.desktop 文件,在 command 的最前面加上 prime-run

在 gnome 桌面环境下右键快捷方式选择使用独显运行

sudo pacman -S switcheroo-control
sudo systemctl enable --now switcheroo-control

电源管理

Power management/Suspend and hibernate - ArchWiki

休眠到硬盘

硬盘上必须有交换空间才能休眠到硬盘

  • 添加 hook
sudo vim /etc/mkinitcpio.conf
BusyBox-based initramfs 使用 resume hook,必须放在 udev 和必要的存储解锁钩子之后;systemd-based initramfs 已有恢复机制,不额外加入 resume。
  • 重新生成 initramfs
sudo mkinitcpio -P
  • reboot
reboot
  • 使用命令进行休眠
systemctl hibernate

内核参数

[HowTo] Disable watchdogs (and silence "watchdog did not stop!") - Contributions / Tutorials - Manjaro Linux Forum

sudo vim /etc/default/grub

在 GRUB_CMDLINE_LINUX_DEFAULT 中只加入经排障确认需要的参数。nowatchdog 和 watchdog 驱动黑名单会关闭相关故障检测,不应默认添加;模块名须按实际硬件确认。 pcie_aspm=force 可能在不兼容设备上造成锁死或数据风险,不作为通用节电参数。只有定位具体问题、确认支持并准备回退后才试验。

power-profiles-daemon

性能模式切换,有三个档位,performance 性能、balanced 平衡、power-saver 节电 power-profiles-daemon 与 TLP 等工具各有适用条件;避免同时启用冲突的管理器。

sudo pacman -S power-profiles-daemon
sudo systemctl enable --now power-profiles-daemon

实用插件扩展

power tracker #显示电池充放电
auto power profile #配合powerProfilesDaemon使用,可以自动切换模式
power profile indicator # 配合powerProfilesDaemon使用,顶栏显示当前模式

美化#

更换壁纸

右键桌面选择更换背景

扩展美化

arch + gnome美化教程_哔哩哔哩_bilibili

# 安装扩展
lock screen background #更换锁屏背景
blur my shell #透明度美化
hide top bar #隐藏顶栏
burn my windows #应用开启和打开的动画
user themes #主题,浏览器搜索gnome shell theme下载主题
logo menu # top bar的左上角显示一个logo,好玩

主题美化

  • 去掉标题栏用来关闭窗口的 x
gsettings set org.gnome.desktop.wm.preferences button-layout 'appmenu:'

光标主题

主题下载网站 [https://www.gnome-look.org/browse?cat=107&ord=latest%5D%28https%3A%2F%2Fwww.gnome-look.org%2Fbrowse%3Fcat%3D107&ord=latest) 将下载的.tar.gz 文件里面的文件夹放到~/.local/share/icons/目录下,没有 icons 文件夹的话自己创建一个

gnome 主题

[https://www.gnome-look.org/browse?cat=134&ord=latest%5D%28https%3A%2F%2Fwww.gnome-look.org%2Fbrowse%3Fcat%3D134&ord=latest) 通常下载页面都有指引,文件路径是~/.themes/,放进去之后在 user themes 扩展的设置里面改可以改

终端美化

  • 安装字体
sudo pacman -S ttf-jetbrains-mono-nerd
  • 安装 zsh
sudo pacman -S zsh
  • 修改 shell 为 zsh
chsh -s /usr/bin/zsh
# 登出
# 启动终端按0生成默认的配置文件

starship

Starship

sudo pacman -S starship
vim ~/.zshrc
eval "$(starship init zsh)"

preset 主题

https://starship.rs/presets/ 挑一个自己喜欢的,下载后改名为 starship.toml,移动到~/.config 目录

语法高亮和自动补全

Zsh 高亮插件一般放在其他会修改 ZLE 的插件之后;以下仍保留原配置项,可按当前插件说明调整加载顺序。

  • 语法检查、补全、tab
sudo pacman -S zsh-syntax-highlighting zsh-autosuggestions zsh-completions
vim ~/.zshrc

写入

# 语法检查和高亮
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
# 开启tab上下左右选择补全
zstyle ':completion:*' menu select
autoload -Uz compinit
compinit
source ~/.zshrc

ghostty 美化

  • 下载 catppuccin 颜色配置,粘贴到~/.config/ghostty/themes/
https://github.com/catppuccin/ghostty?tab=readme-ov-file
  • 修改~/.config/ghostty/config 配置文件,例如下载的是 frappe 的话:
theme = Catppuccin Frappe # 按已安装主题名称选择,可用 ghostty +list-themes 查看
  • 隐藏标题栏
window-decoration = none
  • 设置透明度
background-opacity=0.8
  • 设置字体和字体大小
font-family = "Adwaita Mono"
font-size = 15

官方核对入口#

ArchWiki:PRIME。

ArchWiki:Power management/Suspend and hibernate。

Ghostty 配置参考。

TLP 官方文档。

参考与延伸

  1. 原教程:shorinkiwata/archlinuxinstall ↗
  2. ArchWiki:PRIME ↗
  3. ArchWiki:Power management/Suspend and hibernate ↗
  4. Ghostty 配置参考 ↗
  5. TLP 官方文档 ↗

根据技术笔记重新整理,示例使用通用名称。

沿专题继续阅读

Arch Linux

  1. 01Arch Linux 的哲学与安装规划
  2. 02内核管理、systemd-boot 与 UKI
  3. 03Pacman Hook、AUR 与构建安全
  4. 04Btrfs 子卷布局与 Snapper 快照
  5. 05LUKS2、Secure Boot 与 TPM2 加固
  6. 06性能选择与日常维护清单
  7. 07Pacman 常用命令与参数记忆
  8. 08Pacman 下载慢的诊断与镜像选择
  9. 09informant:Arch 新闻与 Pacman Hook
  10. 10Arch Linux 与 Btrfs:手动安装和 archinstall
  11. 11GNOME 桌面、输入法与快照配置
  12. 12GNOME 笔记本管理与桌面美化
  13. 13Arch Linux 的 KVM、GPU 直通与游戏
  14. 14Arch 桌面的交换空间、内核与排障
CONTINUE READING / 下一篇Arch Linux 的 KVM、GPU 直通与游戏

建立虚拟机与设备直通环境,并区分 Steam、Wine 和 Waydroid 的运行边界。