This article is adapted from shorinkiwata/archlinuxinstall, retaining the original tutorial’s operational detail while anonymizing it and correcting risk-related guidance. Package names, extensions, drivers, and interfaces may change with rolling updates. All commands below are examples for reading; they were neither executed nor validated in this task.
Prerequisites for graphics switching and hibernation#
Switching GPUs may interrupt the graphical session. Save your work first and make sure you have a working TTY or recovery entry point. The modes offered by GPU management tools depend on hardware and firmware; do not apply them based on brand alone.
Configuring hibernation involves more than adding a hook: it also requires a swap target, an initramfs resume mechanism, and a usable resume location. Modern UEFI + systemd environments can use HibernateLocation to record the location automatically. When configuring a swapfile manually, specify the device containing the file and resume_offset. Obtain the Btrfs offset with the following command; do not copy a value from another machine:
sudo btrfs inspect-internal map-swapfile -r /swap/swapfileIf kernel parameters need to be set manually:
resume=UUID=<SWAP_BACKING_FILESYSTEM_UUID> resume_offset=<BTRFS_SWAPFILE_OFFSET>After making changes, rebuild the initramfs/UKI and boot configuration currently in use, then reboot and verify. Check support requirements separately when using encrypted swap, Secure Boot lockdown, or a specialized kernel.
Laptops#
Switching GPUs
Switch to integrated graphics mode
ASUS users can use supergfxctl
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
- Switch the laptop BIOS to hybrid mode
yay -S envycontrol
- Install the GNOME extension GPU Profile Selector
https://extensions.gnome.org/extension/5009/gpu-profile-selector/
- Use the upper-right menu to switch the GPU to integrated
Run applications on the discrete GPU in hybrid mode
PRIME
sudo pacman -S nvidia-prime
- Use the prime-run command in a terminal to run software on the discrete GPU
prime-run firefox
- Use pinapp to edit the .desktop file, adding prime-run at the beginning of the command
In the GNOME desktop environment, right-click the shortcut and select the option to run with the discrete GPU
sudo pacman -S switcheroo-control
sudo systemctl enable --now switcheroo-control
Power management
Power management/Suspend and hibernate - ArchWiki
Hibernate to disk
Swap space on disk is required for hibernation
- Add the hook
sudo vim /etc/mkinitcpio.conf
BusyBox-based initramfs 使用 resume hook,必须放在 udev 和必要的存储解锁钩子之后;systemd-based initramfs 已有恢复机制,不额外加入 resume。
- Regenerate the initramfs
sudo mkinitcpio -P
- reboot
reboot
- Hibernate using a command
systemctl hibernate
Kernel parameters
sudo vim /etc/default/grub
Add only parameters confirmed necessary through troubleshooting to GRUB_CMDLINE_LINUX_DEFAULT. nowatchdog and watchdog driver blacklists disable the relevant fault detection and should not be added by default; confirm module names against the actual hardware. pcie_aspm=force may cause lockups or data risks on incompatible devices and is not a general-purpose power-saving parameter. Experiment only after identifying a specific problem, confirming support, and preparing a rollback.
power-profiles-daemon
There are three performance profiles: performance, balanced, and power-saver. Tools such as power-profiles-daemon and TLP each have their own suitable use cases; avoid enabling conflicting managers at the same time.
sudo pacman -S power-profiles-daemon
sudo systemctl enable --now power-profiles-daemon
Useful extensions
power tracker #显示电池充放电
auto power profile #配合powerProfilesDaemon使用,可以自动切换模式
power profile indicator # 配合powerProfilesDaemon使用,顶栏显示当前模式
Appearance customization#
Change the wallpaper
右键桌面选择更换背景
Customize with extensions
Arch + GNOME Customization Tutorial | Bilibili
# 安装扩展
lock screen background #更换锁屏背景
blur my shell #透明度美化
hide top bar #隐藏顶栏
burn my windows #应用开启和打开的动画
user themes #主题,浏览器搜索gnome shell theme下载主题
logo menu # top bar的左上角显示一个logo,好玩
Customize themes
- Remove the x used to close windows from the title bar
gsettings set org.gnome.desktop.wm.preferences button-layout 'appmenu:'
Cursor theme
Theme download site [https://www.gnome-look.org/browse?cat=107&ord=latest%5D%28https%3A%2F%2Fwww.gnome-look.org%2Fbrowse%3Fcat%3D107&ord=latest) Place the folder inside the downloaded .tar.gz file in ~/.local/share/icons/; create the icons folder if it does not exist
GNOME theme
[https://www.gnome-look.org/browse?cat=134&ord=latest%5D%28https%3A%2F%2Fwww.gnome-look.org%2Fbrowse%3Fcat%3D134&ord=latest) Download pages usually provide instructions. The file location is ~/.themes/; after placing the files there, change the theme in the user themes extension’s settings
Terminal customization
- Install fonts
sudo pacman -S ttf-jetbrains-mono-nerd
- Install zsh
sudo pacman -S zsh
- Change the shell to zsh
chsh -s /usr/bin/zsh
# 登出
# 启动终端按0生成默认的配置文件
starship
sudo pacman -S starship
vim ~/.zshrc
eval "$(starship init zsh)"
Preset themes
https://starship.rs/presets/ Choose one you like, download it, rename it to starship.toml, and move it to the ~/.config directory
Syntax highlighting and autocompletion
Zsh highlighting plugins generally belong after other plugins that modify ZLE. The original configuration entries are retained below; adjust the loading order according to the current plugin documentation.
- Syntax checking, completion, and tab
sudo pacman -S zsh-syntax-highlighting zsh-autosuggestions zsh-completions
vim ~/.zshrc
Write the following
# 语法检查和高亮
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 customization
- Download the catppuccin color configuration and paste it into ~/.config/ghostty/themes/
https://github.com/catppuccin/ghostty?tab=readme-ov-file
- Edit the ~/.config/ghostty/config configuration file. For example, if you downloaded frappe:
theme = Catppuccin Frappe # 按已安装主题名称选择,可用 ghostty +list-themes 查看
- Hide the title bar
window-decoration = none
- Set transparency
background-opacity=0.8
- Set the font and font size
font-family = "Adwaita Mono"
font-size = 15
Official verification resources#
ArchWiki: Power management/Suspend and hibernate.
Ghostty Configuration Reference.
References & further reading
- Original Tutorial: shorinkiwata/archlinuxinstall ↗
- ArchWiki: PRIME ↗
- ArchWiki: Power management/Suspend and hibernate ↗
- Ghostty Configuration Reference ↗
- Official TLP Documentation ↗
Adapted from technical notes. Examples use generic names.
Continue along a reading path
Arch Linux
- 01Arch Linux philosophy and installation planning
- 02Kernel management, systemd-boot, and UKIs
- 03Pacman hooks, the AUR, and build security
- 04Btrfs subvolume layouts and Snapper snapshots
- 05Hardening with LUKS2, Secure Boot, and TPM2
- 06Performance choices and an everyday maintenance checklist
- 07Common Pacman commands and how to remember their flags
- 08Diagnosing slow Pacman downloads and choosing mirrors
- 09informant: Arch news and Pacman hooks
- 10Arch Linux with Btrfs: manual installation and archinstall
- 11Configuring GNOME, input methods, and snapshots
- 12GNOME laptop management and desktop customization
- 13KVM, GPU passthrough, and gaming on Arch Linux
- 14Swap, kernels, and troubleshooting on an Arch desktop