Matebook Arch Tweak Note

This is a collection of notes of setting up and tweaking Arch Linux on Huawei Notebook 13. There are quite some existing write-ups about installing Arch on Matebook, among which I found this one most complete and useful. My post is more focused on my opinions and choices.


Before actually installing Arch, the first thing is to launch the stock Windows and check if everything works. It will be harder to get warrant later. Plus, Huawei provides BIOS updates as Windows executables. Though it is possible to install it on Linux, it's much simpler and more reliable to install it on Windows. Just grab and run the exe.

Matebook Specifics


As stated earlier, Huawei provides BIOS updates as Windows executables. There are some tutorial and scripts about installing it on Linux, but they look complex and I would rather to use the old one. There are even reports of the updates degrading the performance, anyway.

Driver for battery and the Fn key

There is huawei-wmi that provides the battery protection function and the Fn key setting. The driver requires Linux kernel ⩾ 5.0, and is included in Linux ⩾ 5.5. So there is no need to install it separately.

However, there is a small problem with the battery protection. The setting will get reset randomly every a few days. The only solution is to repeatedly set it. I created /etc/systemd/system/huawei.service with the following content and systemctl enable huawei to set it automatically on startup.

Description=Huawei Battery Protection

ExecStart=/usr/bin/sh -c 'echo "70 80" > /sys/devices/platform/huawei-wmi/charge_control_thresholds'


Gnome and Wayland






Desktop Applications


Though not liking the recent moves of Google towards their definition of Web, Chromium is still my favorate browser. However, the standard build does not run on Wayland. XWayland works almost great, unless together with fractional scaling. Unfortunatly, the resolution of Matebook forces me to use 150% scaling, and it makes the text on XWayland apps blurry.

There are on going works to support Wayland and the AUR packages chromium-ozone and electron-ozone are usable, though with some issues like random crashing (about once an hour). They take several hours to build and keep CPU 100% during the building, so I usually build them on cloud and download the packages later via a custom repository.

Due to the numerous bugs in chromium-ozone, I keep tor-browser installed as a backup. Incidentally, it can be used to access some cool websites as well.

Video Player

The Gnome project provides totem (also simply called Videos). It is quite simple and looks nice. However, it depends on the disastrous gst-plugins-bad, which has a huge indirect dependencies, including python2. (Update: python2 is finally removed, hooray🎉)

Since I use ffmpeg, which comes with an extremely simple player called ffplay, I decided to use that as my default player. Beyond it, chromium is also an option, but I find ffplay more handy when the file name does not contains common video extname. chromium will try to download it unless the file is called "xxx.mp4".

To let Gnome and xdg-open recognize ffplay, add the following desktop description to ~/.local/share/applications/ffplay.desktop.

#!/usr/bin/env xdg-open
[Desktop Entry]
Exec=ffplay %U

A caveat is that manually calling update-desktop-database ~/.local/share/applications is required, which is usually done by pacman hooks.

ffplay doesn't even have a single button on its UI. All controls are hidden in man ffplay. The most frequently used commands for me are:

  • right mouse click to seek to percentage in file corresponding to fraction of width;
  • left/right arrow to backward/forward 10 seconds, and down/up arrows for 1 minute;
  • p to pause, and q to close;
  • and double click to (un)fullscreen.
  • Other Applications


    Some kinds of proxy softwares must be there for a Chinese developer. shadowsocks-libev is very light and stable. However, it is losing its market and alternatives like V2ray are emerging. Unlike shadowsocks, V2ray is huge and the implementation is chaotic.

    Thus I wrote v2socks. It is a simple implementation of the vmess protocol and socks5. The usage is very similar to shadowsocks-libev, i.e. no need to create a dedicated config file. More importantly, it is a single 270K binary without any dependencies except for glibc. For comparison, the official v2ray core is 43M, and the 99% functionalities are not being used and only act as attack surfaces. Switching proxies can sometimes become annoying too, so I also wrote a simple gnome extension for proxy subscription and switching.

    Apart from forward proxing, reverse proxing can be very handy too. For example, I may updated my blog and want to check it on my phone without deploying. I use frp for this task. It is also bloated IMO, including very unnecessary things like admin dashboard. I have planned to write a lighter alternative.

    For temporary proxy like download a paper from school, the ubiquitous ssh -D is probably the best choice.