└── README.md /README.md: -------------------------------------------------------------------------------- 1 | # GNU/Linux on Huawei MateBook X (2017) 2 | 3 | > Brain dump: MateBook X running Debian Linux 4 | 5 | ![](https://web.archive.org/web/20170805112512if_/https://www.notebookcheck.net/fileadmin/Notebooks/Huawei/MateBook_X/4zu3_huawei_matebook_x_teaser.jpg) 6 | 7 | ## Background 8 | 9 | First Huawei MateBook X was released in 2017. 10 | It came with proprietary Microsoft Windows 10 and there was very little information available on its Linux support. 11 | 12 | I am running Debian on it. This repository documents what works and what does not. 13 | 14 | ## Linux Support Matrix 15 | 16 | | Device | Model | Works | Notes | 17 | | --- | --- | :---: | --- | 18 | | Processor | Intel Core i5-7200U | 💚 Yes | 4 cores (2 real ones), power states etc work out of the box (TODO: document) | 19 | | Graphics | Intel HD Graphics 620 | 💚 Yes | via standard kernel driver (TODO: document) | 20 | | Memory | 8192 MB | 💚 Yes | | 21 | | Display | 13.3 inch 16:9, 2160x1440 (2K) | 💚 Yes | resolution is correctly detected by `xrandr`, backlight control does not work via native function keys, but works via additional scripts (see [Display Backlight](#display-backlight)) | 22 | | Storage | LITEON CB1-SD256, 256 GB | 💚 Yes | via standard kernel driver (TODO: document) | 23 | | Soundcard | Intel Kaby Lake-U/Y PCH - High Definition Audio with Dolby ATMOS | 💚 Yes | via standard kernel driver, it also works fine with `pulseaudio` (TODO: document) | 24 | | Speakers | "Dolby ATMOS" | 👁️‍🗨️ Kinda | Right now only left speaker works, but it is not noticable as the sound feels quite "centered". I'm hoping a kernel update or some other fix for it will come out eventually to address this. | 25 | | Ports | 1 USB 3.0 / 3.1 Gen1, 1 USB 3.1 Gen2 | 💚 Yes | [USB-PD](https://en.wikipedia.org/wiki/USB_PD) works only via left port, but it is a hardware limitation of the laptop | 26 | | Fingerprint Reader | proprietary sensor made by Huawei | 🚫 No | It is located on the power button, which itself is fully functional | 27 | | Wifi | Intel Dual Band Wireless-AC 8265 (a/b/g/n/ac) | 💚 Yes | requires kernel 4.12 and firmware from Debian Testing (TODO: document) | 28 | | Bluetooth | Intel (idVendor:0x8087, idProduct:0x0a2b) | 💚 Yes | ([see details below](#bluetooth)) | 29 | | Airplane Mode | Wifi+Bluetooth | 💚 Yes | ([see details below](#airplane-mode)) | 30 | | Battery | 40 Wh Lithium-Polymer | 💚 Yes | Everything works: current status, chargin/discharging rate and remaining battery time estimates | 31 | | Lid | ACPI-compliant | 💚 Yes | Works as expected: I can just close the lid and it sleeps | 32 | | Keyboard | | 👁️‍🗨️ Mostly | Some function keys do not work (eg. display brightness control), but there is ongoing dev in [aymanbagabas/Huawei-WMI/issues/2](https://github.com/aymanbagabas/Huawei-WMI/issues/2) | 33 | | Touchpad | | 💚 Yes | Tap-to-click can be enabled via `libinput` ([see details below](#touchpad)) | 34 | | Port Extender | USC-C dongle included with laptop | 💚 Yes | Full-size HDMI works as expected | 35 | 36 | ## Power Management 37 | 38 | Been testing it with Debian Stable + backported kernel 4.12. I've installed laptop-mode-tools (instead of TLP) and minimalist i3-wm (instead of Gnome). With this setup and my workflow (mostly browser + ssh) the battery lasts for around 6-7 hours. Switching to more intensive things like code compilation or video encoding for prolonged time cuts battery to around 4 hours. 39 | 40 | TODO: document `laptop-mode-tools` 41 | 42 | ## Touchpad 43 | 44 | I prefer natural (reversed) scrolling and tap-to-click. 45 | Both behaviors are disabled by default, but can be easily enabled via libinput. 46 | 47 | To test, change a property manually: 48 | 49 | ``` 50 | $ xinput list | grep Touchpad 51 | ↳ ELAN2201:00 04F3:3056 Touchpad id=10 [slave pointer (2)] 52 | 53 | $ xinput list-props 10 | grep Tapping\ Enabled 54 | libinput Tapping Enabled (280): 0 55 | 56 | $ xinput set-prop 10 280 1 57 | 58 | $ xinput list-props 10 | grep Tapping\ Enabled 59 | libinput Tapping Enabled (280): 1 60 | ``` 61 | 62 | To make it permanent, create `/etc/X11/xorg.conf.d/40-libinput.conf` with: 63 | 64 | ``` 65 | Section "InputClass" 66 | Identifier "touchpad catchall" 67 | MatchIsTouchpad "on" 68 | Driver "libinput" 69 | EndSection 70 | 71 | Section "InputClass" 72 | Identifier "tap-by-default" 73 | MatchIsTouchpad "on" 74 | MatchDriver "libinput" 75 | Option "Tapping" "on" 76 | Option "NaturalScrolling" "true" 77 | Option "AccelSpeed" "1" 78 | #Option "TappingButtonMap" "lmr" 79 | EndSection 80 | ``` 81 | 82 | ## Display Backlight 83 | 84 | Backlight control may not work out of the box in userland tools such as `xbacklight`. 85 | 86 | To activate it, create `/etc/X11/xorg.conf.d/30-intel.conf` with: 87 | 88 | ``` 89 | Section "Device" 90 | Identifier "Card0" 91 | Driver "intel" 92 | Option "Backlight" "intel_backlight" 93 | EndSection 94 | ``` 95 | 96 | Reload X11. Now `xbacklight +10` should increase brightness by 10%. Hardware keys do not work yet, but one can to bind this to any keyboard combination (eg. `Mod4` (Windows key) + `F1` (brightness key)) 97 | 98 | If you want to get visual feedback on every change consider using [backlight-ctrl.sh](https://github.com/lidel/dotfiles/blob/master/bin/backlight-ctl.sh). 99 | 100 | 101 | ## Bluetooth 102 | 103 | Tested with a mouse (MX Anywhere 2S) and worked as expected. 104 | 105 | Following `apt install bluetooth` from [BluetoothUser](https://wiki.debian.org/BluetoothUser) guide should be enough. 106 | I also installed `blueman` and run `blueman-applet &` for a handy tray icon in i3 status bar. 107 | 108 | ### Bluetooth Troubleshooting 109 | 110 | Bluetooth registers itself as an USB device and default power saving settings may be too aggressive for wireless mouse and keyboard. In my case mouse was unable to wake up from autosuspend so for now I just disable it on boot: 111 | 112 | ```bash 113 | # Prevents the Bluetooth USB card from autosuspending, which (as of this edit) borks it 114 | # Include this somewhere it gets called at boot, for optimal effect; e.g. /etc/rc.local 115 | # Credit: http://ubuntuforums.org/showthread.php?t=2159645&page=6&p=12926730#post12926730 116 | 117 | BTUSB_DEV="8087:0a2b" 118 | BTUSB_BINDING="$(lsusb -d "$BTUSB_DEV" | 119 | cut -f 1 -d : | 120 | sed -e 's,Bus ,,' -e 's, Device ,/,' | 121 | xargs -I {} udevadm info -q path -n /dev/bus/usb/{} | 122 | xargs basename)" 123 | 124 | 125 | echo "Disabling autosuspend for Bluetooth USB device: $BTUSB_BINDING..." 126 | echo -1 > "/sys/bus/usb/devices/$BTUSB_BINDING/power/autosuspend_delay_ms" 127 | ``` 128 | 129 | 130 | If you are using a power management solution, you may want to see instructions below: 131 | 132 | #### TLP 133 | 134 | > I use `tlp` for power management. I had to set `USB_AUTOSUSPEND=0` in `/etc/default/tlp` to prevent random outages of USB and bluetooth (requiring a cold restart to correct). [#](https://github.com/lidel/linux-on-huawei-matebook-x-2017/issues/5#issue-339338858) 135 | 136 | #### Laptop Model 137 | 138 | If you use `laptop-mode` for power management, disable or tweak suspend rules in `/etc/laptop-mode/conf.d/bluetooth.conf`. 139 | 140 | 141 | ## Airplane Mode 142 | 143 | Works as expected. 144 | 145 | `rfkill list` shows current status of radio interfaces: 146 | 147 | ``` 148 | rfkill list ~ 149 | 0: phy0: Wireless LAN 150 | Soft blocked: no 151 | Hard blocked: no 152 | 11: hci0: Bluetooth 153 | Soft blocked: no 154 | Hard blocked: no 155 | ``` 156 | 157 | Toggling "airplane mode": `rfkill block all` / `rfkill unblock all` 158 | --------------------------------------------------------------------------------