This document contains the complete setup guide for a personal Arch Linux system running on a Huawei MateBook X Pro 2021. It covers hardware-specific configurations, system setup, desktop environment configuration, and application installation.
The system uses Hyprland as the primary window manager with a suite of Wayland-native tools for daily computing.
For a second machine that keeps Windows and runs Arch as a dorm development host, follow the remote development laptop guide. It covers NVIDIA, remote access, and migration separately from this MateBook-specific setup.
TLP is the power management tool of choice:
systemctl enable tlp --nowIn addition to TLP, we also use matebook-applet and huawei-wmi for battery threshold control:
yay -S matebook-applet huawei-wmiThe Huawei applet owns the saved charging thresholds. Install the resume hook
with sudo ./dotfiles-huawei-wmi/install.sh from the repository root. Its TLP
drop-in disables TLP’s native battery control so the two resume hooks cannot
overwrite each other’s settings; TLP still manages power saving. See
the Huawei threshold guide for installation, verification, and troubleshooting.
Install the firmware:
sudo pacman -S sof-firmwareFollow this GitHub issue to fix sound issues on Huawei MateBook devices.
The built-in sensor is a Goodix 27c6:5125 (USB, power button). As of
2026-09 it is not supported by libfprint and has no Linux driver; Goodix
does not publish one. Verified locally: with fprintd / libfprint
1.94.100 installed, fprintd-enroll reports “No devices available” (only
the match-on-chip goodixmoc driver exists upstream; 5125 is a
match-on-host CDC device). The community reverse-engineering effort at
goodix-fp-linux-dev
is still at the protocol-dump stage for this chip, and the proprietary
Ubuntu/Lenovo Goodix driver only covers 27c6:550a.
The standard stack (fprintd, pulls in libfprint) is installed so it
starts working automatically once a driver lands. To re-check after a
system update:
fprintd-enroll # succeeds once a driver exists; until then: "No devices available"If it ever gets detected, enroll with fprintd-enroll and enable
pam_fprintd.so in PAM for sudo / hyprlock.
intel-ucode for Intel processors:
sudo pacman -S intel-ucodeUsing nftables and ufw:
sudo pacman -S iptables-nft ufwDefault configuration for ufw:
sudo ufw default deny
sudo ufw allow from 192.168.0.0/24
sudo ufw allow Deluge
sudo ufw limit ssh
sudo ufw enableHyprland is a dynamic tiling Wayland compositor.
The active config is ~/.config/hypr/hyprland.lua. Hyprland prefers it over
hyprland.conf after a full session restart; hyprctl reload cannot switch
the running session from one config format to the other.
hypr/hyprland.lua selects the native scrolling layout and loads shared
settings, bindings, and autostart from hypr/hyprland_common.lua.
hyprland_without_hy3.lua selects dwindle; its filename is retained from
the earlier hy3 setup. The Lua entry points do not currently require hy3.
The first window on an empty workspace opens at full width; subsequent
scrolling columns open at 75% width. A window.open_early callback selects
scrolling.column_width from the destination workspace’s window count before
the new column is created. fullscreen_on_one_column is disabled so opening
or closing another column preserves existing column widths. SUPER + W and
SUPER + SHIFT + W cycle the focused column through the configured widths.
SUPER + Space runs script/hypr-window-switcher.sh, which uses hyprctl,
jq, and Rofi to select and focus a window across scrolling workspaces.
misc.focus_on_activate is enabled in the shared Lua config for both layouts.
This lets applications bring their windows into focus when they request
activation, such as after opening a link or clicking a notification action.
Apply changes with hyprctl reload and check
hyprctl getoption misc:focus_on_activate; it should report bool: true.
Using xdg desktop portal:
sudo pacman -S xdg-desktop-portal-hyprland xdg-desktop-portal-gtkUsing waybar for status bar:
sudo pacman -S waybarThe right side starts with custom/dayline-focus and ends with custom/dayline.
The focus module runs dayline waybar-focus to show the recorded time of the
current focus session (blue dot while running, amber while paused; the tooltip
names the task). Left-click toggles the Dayline widget; right-click toggles the
focus session. custom/dayline, Hyprland startup, and SUPER + T /
SUPER + A also use /home/wste/code/Dayline/.venv/bin/dayline from an
external project. That executable is a local dependency, not part of this
dotfiles repository. A window rule puts the Dayline panel on the special
workspace special:dayline; SUPER + A toggles that workspace, or runs
dayline ui show when the panel is closed.
Using rofi as application launcher:
sudo pacman -S rofi-waylandAnd in hyprland_common.lua:
local menu = "rofi -show combi"Using copyq as clipboard manager:
sudo pacman -S copyqUse hyprshot for screenshots:
yay -S hyprshotThe active Print binding selects a region with slurp, captures it with
grim, and sends the result to the clipboard with wl-copy.
Notification center:
sudo pacman -S swayncScreen lock and idle management:
sudo pacman -S hyprlock hypridleManual controls are separate:
| Shortcut | Action |
|---|---|
SUPER + SHIFT + I | Toggle the lid sleep hold (also blocks suspend, as before) |
SUPER + I | Toggle the idle hold: pause automatic locking, screen-off, and idle suspend |
SUPER + SHIFT + Esc | Lock immediately, including while either hold is active |
The holds use systemd-inhibit through two user services in systemd/user/.
script/toggle-inhibit.sh lid and script/toggle-inhibit.sh idle toggle them
independently; script/toggle-inhibit-lid-sleep.sh keeps the existing lid entry
point. Notifications keep the earlier Toggled … Inhibition title and service
started=/=stopped wording, reporting success only after the inhibitor is acquired.
Repeated shortcut presses are serialized with flock from util-linux.
The lid service retains --what=handle-lid-switch:sleep; idle locking and
screen-off remain active. The idle service uses --what=idle, which Hypridle
respects by default (general.ignore_systemd_inhibit = false). Hypridle stays
running, so manual locking and locking before sleep still work. Idle hold alone
allows lid sleep and manual suspend; use both holds to pause both behaviors.
Existing media-player checks remain in place. See the
Hypridle configuration and
systemd inhibitor documentation.
Compare existing units and back up separate files before creating these links:
mkdir -p ~/.config/systemd/user
ln -s ~/dotfile/systemd/user/inhibit-lid-sleep.service ~/.config/systemd/user/inhibit-lid-sleep.service
ln -s ~/dotfile/systemd/user/inhibit-idle.service ~/.config/systemd/user/inhibit-idle.service
systemctl --user daemon-reload
hyprctl reloadStart these services on demand; do not enable them at login. A hold lasts until
toggled off or the user service manager stops. After editing a unit, run
systemctl --user daemon-reload; an active hold uses the new unit on its next
start. Toggle a hold and inspect systemd-inhibit --list to verify it, or check
systemctl --user is-active inhibit-lid-sleep.service inhibit-idle.service.
No Hypridle restart is needed to toggle a hold.
Using awww (successor to swww) for animated wallpapers:
yay -S awwwAdd to the hyprland_common.lua startup hook:
hl.on("hyprland.start", function()
hl.exec_cmd("awww-daemon")
end)GTK theme is managed via config files in the dotfiles repository:
gtk-3.0/settings.ini— UsesAdwaita-dark(GTK3)gtk-4.0/settings.ini— UsesAdwaitawithprefer-dark-theme(GTK4)
Copy these to ~/.config/ to apply:
cp gtk-3.0/settings.ini ~/.config/gtk-3.0/settings.ini
cp gtk-4.0/settings.ini ~/.config/gtk-4.0/settings.iniQt theming is set via qt6ct:
sudo pacman -S qt6ctUse xdg-mime to change the default program that opens a specific type. For example to set default PDF reader to okular:
xdg-mime default okularApplication_pdf.desktop application/pdf
xdg-mime query default application/pdf # should be "okularApplication_pdf.desktop"Used previously on X11. Configuration is preserved but not actively maintained.
Wayland port of i3. Not currently in use.
Previously used for testing. Configuration no longer actively maintained.
Using fcitx5 with rime and 雾凇拼音:
yay -S fcitx5-im fcitx5-rime rime-ice-gitUsing theme Nord-Dark.
The live Fcitx5 profile selects keyboard-us and rime. The repository’s
fcitx5/profile is an older Pinyin snapshot; compare it with the live profile
before deploying it. Rime customization is in rime/default.custom.yaml,
linked to ~/.local/share/fcitx5/rime/default.custom.yaml. After changing
the schema or bindings, use the Rime menu’s Deploy action. Keep generated
dictionaries and user data in the surrounding live directory.
Install Japanese/Chinese font support:
sudo pacman -S ttf-hanaminsudo pacman -S firefox/* hide the tabs on the top of the window */
:root{
--sidebar-hover-width: 22px;
--sidebar-visible-width: 140px;
}
#TabsToolBar {
visibility: collapse;
}
#TabsToolbar, #sidebar-header{
display: none !important;
}
#sidebar-box {
position: relative !important;
overflow: hidden;
max-width: var(--sidebar-hover-width) !important;
}
#sidebar-box:hover {
transition: all 200ms !important;
max-width: var(--sidebar-visible-width) !important;
}sudo pacman -S firefox-i18n-zh-cnYou can choose to refresh Firefox and redo the above configuration.
On Firefox 150 with Wayland/HiDPI, extension popups such as uBlock Origin can render extremely large and stop registering clicks correctly. The workaround from this Arch Linux forum thread is:
- Open
about:config. - Set
widget.wayland.fractional-scale.enabledtofalse.
A PDF reader:
sudo pacman -S okularA dictionary tool:
sudo pacman -S golden-dict-ngA citation manager:
sudo pacman -S zoteroNote-taking application. To make rnote or other GTK applications have a proper view, we have to use default GTK config file. Adding this to the .desktop file may solve the problem:
env XDG_CONFIG_HOME=/tmp/empty-configProxy client:
yay -S clash-verge-rev-binFast, native terminal emulator written in Zig:
sudo pacman -S ghosttyConfiguration is at ~/.config/ghostty/config. See the Ghostty documentation for configuration options.
Using fish as the interactive shell:
sudo pacman -S fishThe separate live ~/.config/fish/config.fish also initializes Kimi’s bin
directory. Its path setup skips fish_add_path when the directory is already
in $fish_user_paths, so repeated source calls return success rather than
fish_add_path’s “nothing added” status 1.
fish/functions/claude.fish wraps the claude command in Fish. Its shared
checker is script/clash-network-check.fish. It requires
Clash Verge Rev’s running API to report TUN enabled, global mode and a
selected Taiwan proxy. The checker uses the first existing socket in this order:
/run/clash-verge-service/users/<uid>/verge-mihomo.sock for service mode,
$XDG_DATA_HOME/io.github.clash-verge-rev.clash-verge-rev/verge-mihomo.sock
for app mode (default data directory: ~/.local/share), then the legacy
/tmp/verge/verge-mihomo.sock. Manual selector groups are followed;
automatic/fallback/load-balancing groups and direct routes are rejected.
The Taiwan check uses the selected node’s name. Failed or unverifiable checks
block startup; there is no external exit-country request.
Dependencies are Fish, curl and jq. The function is linked individually into
~/.config/fish/functions/claude.fish; other live Fish files stay independent.
On another machine, inspect any existing destination before creating the link:
ln -s ~/dotfile/fish/functions/claude.fish ~/.config/fish/functions/claude.fish
source ~/.config/fish/functions/claude.fish
claude --proxy-check # check only; does not start Claude
claude # check, then start; normal Claude arguments are forwardedNew Fish shells autoload it. The wrapper only checks the running configuration before launching Claude with the existing environment. It does not set proxy variables or change Clash settings; network routing stays under Clash TUN. This guards terminal startup only: it does not monitor later Clash changes, existing/background sessions or launches from other apps.
The T3 desktop launcher and its Claude provider use the same TUN/Global/Taiwan
startup check. No wrapper sets proxy variables or changes Clash settings.
script/t3code-guard.sh launches the installed /usr/bin/t3code after
the check, and shows a notification if blocked. The launcher override
t3code/t3code.desktop is linked at
~/.local/share/applications/t3code.desktop; ~/.local/bin/t3code
links to the guarded script. fish/functions/t3.fish is linked at
~/.config/fish/functions/t3.fish and guards the app-owned t3 CLI in Fish.
Use t3 --proxy-check to check without launching the CLI.
The desktop owns the local server in ~/.t3. Do not install the background
service for this desktop-managed setup: it starts at login and prevents the
desktop from opening with “This T3 home is unavailable”. If it is installed,
run t3 service uninstall --base-dir ~/.t3, then reopen the desktop. This
removes the service registration without deleting projects, conversations or
settings. Check with t3 service status --base-dir ~/.t3.
The desktop wrapper selects --password-store=gnome-libsecret so Electron uses
KeePassXC’s enabled Secret Service under Hyprland. Keep the database exposing
the default collection unlocked before launching T3. Without this selection,
automatic detection can leave secure storage unavailable and prevent saving
remote connections. Fully quit T3 and reopen it through the guarded launcher
after changing this flag; opening another window does not restart Electron.
See Electron’s secure storage backends.
T3’s claudeAgent provider has Binary path set to
/home/wste/dotfile/script/claude-guard.sh in
~/.t3/userdata/settings.json. The wrapper checks before each Claude process
spawn, including SDK sessions and provider probes, then executes the existing
~/.local/bin/claude. It preserves the SDK’s standard input/output protocol.
The previous settings file is backed up under
~/.local/state/dotfile/backups/t3code/. Other provider settings are preserved.
See T3’s Claude provider settings.
Restart T3 after changing its provider Binary path so existing sessions use the
guard. New Fish shells load t3.fish automatically; an existing shell can run
source ~/.config/fish/functions/t3.fish. The installed app and T3’s generated
CLI/URL-handler files are unchanged. Direct launches of the installed app and
its generated URL handler can bypass the desktop startup check, while the
configured Claude provider still checks on process spawn. These are startup
checks, not monitoring of existing connections or restrictions on local files.
Using zoxide for directory jumping:
sudo pacman -S zoxide fzf
zoxide init fishTerminal file manager with drag-and-drop and clipboard support:
sudo pacman -S yazi parallel ripdrag xclipPlugins (managed via ya pkg):
ya pkg add boydaihungst/restore
ya pkg add simla33/ucpKey features:
- Press
C-nin Yazi to drag and drop selected files - Press
C-yin Yazi to copy selected files to system clipboard (Wayland + XWayland viaucp.yazi) - Press
dto trash,Dto delete permanently,u/Uto restore (last / interactive) - Directories visited in Yazi update zoxide frecency (
yazi/init.lua) - Fish integration:
ycommand changes cwd on exit
yay -S onedrive-abrauneggThe client runs as the packaged onedrive.service user unit in monitor mode,
not from Hyprland autostart. The tracked drop-in
systemd/user/onedrive.service.d/memory.conf caps it at 1 GiB of RAM with no
swap, because long-running monitor sessions have grown past 10 GiB. At the cap
the kernel kills the client and the unit’s Restart=on-failure starts a new one.
Stop any client started by hand or by an older autostart first, so two
instances do not share ~/OneDrive and its database:
systemctl --user stop onedrive.service
pkill -x onedrive
mkdir -p ~/.config/systemd/user/onedrive.service.d
ln -sf ../../../../dotfile/systemd/user/onedrive.service.d/memory.conf \
~/.config/systemd/user/onedrive.service.d/memory.conf
systemctl --user daemon-reload
systemctl --user enable --now onedrive.serviceCheck output and restarts with journalctl --user -u onedrive. Each exit
logs the run’s memory peak; a Failed with result 'oom-kill' line means the cap
was reached.
Using Doom Emacs as the primary text editor:
git clone --depth 1 https://github.com/doomemacs/doomemacs ~/.config/emacs
~/.config/emacs/bin/doom installMaintenance instructions are in doom/AGENTS.md. Edit
doom/config.org and tangle it to the ignored doom/config.el.
Module/package changes also require doom sync and an Emacs reload or restart.
The Markdown checker style is doom/mdl-style.rb, referenced by config.org.
The Python formatter is Ruff for both python-mode and python-ts-mode;
install it with sudo pacman -S ruff.
PDFs opened with find-file or Dired, and PDF file links followed in Org,
use the system’s default viewer through xdg-open. This requires xdg-utils
and the openwith Emacs package; run doom sync after deployment, then
reload or restart Emacs. Check the current viewer with
xdg-mime query default application/pdf; see Default Applications to change it.
The custom n agenda command shows the 10-day agenda with a lower TODO list.
The TODO list ignores entries with dates, so scheduled tasks, deadlines, habits,
and timestamped items do not repeat below the agenda.
The cc +lsp module uses clangd. Start or reconnect it with M-x lsp;
enabling lsp-mode alone does not start a server.
If startup reports Symbol's function definition is void: nil from
lsp-ts-query, doom/config.org initializes its parser-directory setting
before client loading to work around the installed package’s broken default.
The existing Vim settings are managed in vim/vimrc, linked from ~/.vimrc.
Terminal Vim uses a steady block cursor in normal mode and a thin vertical bar
in insert mode. It restores the terminal’s default cursor when exiting.
Restart Vim or run :source ~/.vimrc after editing the config.
To deploy on another machine, compare any existing ~/.vimrc first and move it
to a backup before creating the link:
ln -s ~/dotfile/vim/vimrc ~/.vimrcThis manages only the vimrc. The existing auto-pairs.vim plugin stays under
~/.vim/plugin/; plugins and runtime state such as .netrwhist are kept outside
the repository. The original vimrc was backed up before linking on 2026-10-07.
Cross-cutting issues that don’t fit in specific sections:
- Firefox performance: See Firefox section for refresh instructions
- Sound after suspend: See Sound (MateBook) section
This repository contains active desktop configs, separately deployed snapshots, and preserved utilities. Deployment differs by component; editing a repository file only changes the live setup when the destination points to that file.
- Inspect
git status --shortandgit diff -- <target-files>. Preserve existing changes and untracked additions. AI agents follow AGENTS.md; Doom work also follows doom/AGENTS.md. - Locate the source and its live destination. Use
ls -ldandreadlink -fto check links; compare independent files before copying or linking them. There is no general installer or Stow manifest in this repository. - Make a focused source change. Tangle Doom’s literate config when needed; leave unrelated snapshots, application state, and bundled plugins alone.
- Check the affected file, deploy it if needed, then reload and verify the changed behavior. Documentation-only changes need no desktop reload.
- Keep this guide aligned with setup/usage changes. Change
AGENTS.mdonly when a policy update is explicitly requested. Review the scoped diff andgit diff --check. Use a focused branch, stage explicit paths, and create GPG-signed Conventional Commits. Push the branch and open a pull request with the relevant validation. Obtain an independent subagent review, address findings, and merge after required checks pass unless the request calls for an unmerged pull request.
For example, compare Fish before deploying a change:
readlink -f ~/.config/fish/config.fish
diff -u fish/config.fish ~/.config/fish/config.fish
fish -n fish/config.fishThe diff command returns status 1 when the files differ. Resolve the intended
changes on both sides before deployment; a whole-directory copy can overwrite
newer live configuration and shell state.
Verified locally on 2026-10-05; re-check these relationships when moving the repository or configuring another machine. These live destinations are symlinked to their counterparts in this repository:
| Repository directories | Live location |
|---|---|
hypr, doom, ghostty, waybar, rofi, yazi, swaync | ~/.config/<directory> |
gtk-3.0, gtk-4.0 | ~/.config/<directory> |
rime/default.custom.yaml | ~/.local/share/fcitx5/rime/default.custom.yaml (single-file link) |
Added on 2026-10-07: vim/vimrc is linked to ~/.vimrc as a single file.
The remaining checked destinations have different deployment behavior:
| Repository source | Local finding |
|---|---|
fish/ | Independent live files under ~/.config/fish/; config.fish differs |
nvim/ | Independent live config; init.lua differs; the repository’s Lua loader/spec files are absent |
fcitx5/ | Independent live files; config, profile, and theme file differ; live profile uses Rime |
sway/ | Independent live config; differs from the preserved repository copy |
starship/starship.toml | Separate matching copy under ~/.config/starship/; ~/.config/starship.toml is absent, so verify STARSHIP_CONFIG before deployment |
alacritty/, i3/, nushell/ | No corresponding directory under ~/.config/ on this machine |
One runtime dependency lives outside the repository:
- Dayline:
/home/wste/code/Dayline/.venv/bin/dayline, called by Hyprland and Waybar.
Added on 2026-10-08: systemd/user/inhibit-lid-sleep.service and
systemd/user/inhibit-idle.service are linked individually under
~/.config/systemd/user/. The previous separate lid unit was backed up before
linking. Both holds are controlled by script/toggle-inhibit.sh.
systemd/user/onedrive.service.d/memory.conf is linked individually into
~/.config/systemd/user/onedrive.service.d/; onedrive.service itself is the
packaged unit from /usr/lib/systemd/user/ and is enabled at login.
There is no unified test suite. Use checks suited to the edited file:
- Fish:
fish -n <file.fish>. - Lua:
luac -p <file.lua>for syntax, followed by application-specific checks. - Shell:
sh -n <file.sh>orbash -n <file.sh>according to its shebang. - systemd user units:
systemd-analyze --user verify <file.service>. - TOML/JSON: parse with Python
tomllib/json. Waybar’sconfig.jsonccontains comments and needs a JSONC-aware parser, such asjson5. - Doom: tangle and check Lisp as described in
doom/AGENTS.md; sync module or package changes. - Vim:
vim -N -n -i NONE -es -u vim/vimrc '+if !empty(v:errmsg) | cquit | endif' '+qall!', then check the cursor when entering insert mode and returning to normal mode. - Hyprland: after a deployed config change, inspect
hyprctl configerrorsand exercise the affected binding/layout. - Docs: verify file references and run
git diff --check.
Apply these steps after checking deployment:
| Component | Reload / Apply Step |
|---|---|
| Hyprland | hyprctl reload for the current format; session restart for Hyprlang/Lua migration |
| Doom Emacs | Tangle config.org; doom sync after init.el / packages.el changes; reload or restart Emacs |
| Fish | In Fish, source ~/.config/fish/config.fish after deployment |
| Waybar | killall waybar && waybar |
| Swaync | swaync-client --reload-config / swaync-client --reload-css |
| Ghostty / Yazi / Neovim | Restart the application after deployment |
| Vim | Restart Vim or run :source ~/.vimrc |
| Rime | Use the Deploy action in the Fcitx5 Rime menu |
| Rofi | The next launch reads the config |
| Lid / idle hold units | systemctl --user daemon-reload; toggle an active hold off/on to use an edited unit |
The repo-local Codex skill at .agents/skills/check-application-updates/ tracks
installed application versions and reviews available updates against the config
files declared in .app-update-tracker.json. Invoke the skill when an update
check is needed; it does not run in the background or install packages.
When hy3 is enabled, Hyprland updates are blocked until hy3’s current HyprPM
manifest contains a compatibility pin for the exact target release commit.
README.md- Introduction and getting starteddocs/computer.org- System setup, deployment, usage, and troubleshootingAGENTS.md- Shared agent maintenance workflow;CLAUDE.mdredirects to it.agents/skills/- Repo-local Codex skills.app-update-tracker.json- Application version baseline and update remindershypr/- Hyprland window manager configurationdoom/- Doom Emacs configuration (editconfig.org, notconfig.el)fish/- Fish shell configurationghostty/- Ghostty terminal configurationnvim/,alacritty/- Secondary editor/terminal configuration snapshotsvim/- Vim settings linked to~/.vimrcwaybar/- Status bar configurationrofi/- Application launcher configurationyazi/- Terminal file manager configurationfcitx5/- Older Pinyin settings;rime/- Current Rime customizationswaync/,starship/- Notification center and shell prompt configurationgtk-3.0/- GTK3 theme configurationgtk-4.0/- GTK4 theme configurationscript/- Hyprland window switcher and sleep-inhibition helperssystemd/user/- On-demand lid sleep and idle hold services; OneDrive memory cap drop-indotfiles-huawei-wmi/- Battery threshold restore hook and its installersway/,i3/- Preserved fallback desktop configurationsnushell/,pwsh/,scoop/- Alternate shell and Windows setup snapshotsclang-format/- C/C++ formatting settings;a9/- Standalone utility/data
doom/config.elis generated and ignored by Git; editconfig.org.fish/fish_variablesis shell-managed state.nushell/history.txtis saved history, not shell configuration. Review these separately from source changes.fish/fish_variables.rejandwaybar/style.css.bacare preserved reject/backup files; they are not normal editing entry points.yazi/plugins/contains bundled third-party code, including local edits. Inspect its diff before updating dependencies withya pkg.