all repos — site @ a42c40a5139962c6e93557cec0b9921e55212c96

source for my site, found at icyphox.sh

pages/blog/flow-x13.md (view raw)

  1---
  2template:
  3slug: flow-x13
  4title: The Asus ROG Flow X13
  5subtitle: My hunt for a new laptop has finally concluded
  6date: 2022-05-02
  7---
  8
  9![](https://cdn.icyphox.sh/3NZ1u.jpg)
 10
 11I've been on the lookout for a new laptop for a while now. While the HP
 12Envy was good -- is good -- the measly 8 gigs of RAM was struggling to
 13hold in all the beefy stuff that I run these days (skaffold, k3s, etc.).
 14And it being a "budget" laptop of its time didn't do its chassis any
 15favors -- the bottom was very scratched because the rubber bumpons
 16came off; the keyboard deck had some rather mysterious scuff marks.
 17Anyway, off I went looking for a replacement.
 18
 19My requirements for a laptop are somewhat specific. From the title it's
 20obvious that I'd like to have good Linux support; here's a list of
 21other things that I expect to see:
 22
 23- HiDPI: Any resolution above 1080p (or 1200p). I look at text all day,
 24  and I'd like it to be _crispy_.
 25- 13" - 14": I don't like overly large or heavy laptops. I think 13.3
 26  inches is the perfect screen size; 14 is a compromise.
 27- A decent CPU: I don't really do anything very compute intensive, but
 28  an i7 or a Ryzen 7 should be ideal.
 29- 32 GB RAM: Having struggled with 8 gigs for so long made this a hard
 30  requirement. Never again will I have to `pkill gopls`.
 31
 32I can't say I had a specific budget in mind, but anything more than 140k
 33INR (1.4L, ≈1800 USD) is somewhat hard to justify. Listed below were the
 34contenders for the prestegious position of being my laptop of choice:
 35
 36- **Tuxedo InfinityBook Pro 14**: While this ticks all the boxes, the
 37  cost including shipping (as of this writing) is about 1700 EUR. And
 38  that's without opening the massive, stinky can of worms called Indian
 39  Customs. Expecting a very lenient 40% duty, it's safe to say it's
 40  _batshit expensive_.
 41- **ThinkPad X13**: Lenovo's site allows you to customize orders for
 42  certain models, and these will be custom built and shipped from China.
 43  The nice thing is Lenovo takes care of the customs and shipping and
 44  other logistics. The not-nice thing is it takes a minimum of _12
 45  weeks_ -- at least for the X13. That's 4 whole months. I think I'll
 46  pass.
 47
 48With that preface out of the way, the machine I finally settled on was
 49(as the title reads) the **Asus ROG Flow X13**. My model set me back by
 50about 130,000 INR (1.3L, ≈1700 USD). The trick was to look in the
 51"gaming laptops" section, because this model didn't show up anywhere in
 52the thin-and-light/productivity/ultrabook searches. And it doesn't look
 53gamery at all. Here's what my Dad had to say, as a serial ThinkPad user:
 54
 55> "It looks like a ThinkPad."
 56
 57## hardware
 58
 59I opted to buy the 2021 model because, really, the only difference in
 60the 2022 model is the marginally better CPU and a MUX switch. I don't
 61care much for either. The octa-core Ryzen 9 5900HS has more compute
 62power than I could ever need.
 63
 64The chassis is made of a "magnesium alloy", with a grooved finish that
 65feels very nice to touch. There's very minimal branding -- one somewhat
 66"iridescent" label with the Republic of Gamers logotype on one corner of
 67the lid, and the ROG logo on the right palm-rest, made out of the same
 68groove design.
 69
 70| | |
 71| ---- | ---- |
 72| ![](https://cdn.icyphox.sh/J2SN2.jpg) | ![](https://cdn.icyphox.sh/0wFTQ.jpg) |
 73
 74The hinges are sturdy and allow for 360° rotation. The lid can be opened
 75with a single finger, which is much appreciated. The screen itself is a
 76gorgeous 4K (3840×2400) touch screen panel. While the need need for 4K
 77on a 13" screen is questionable, I welcome it wholeheartedly. It is the
 78best screen I've used; the colors are punchy, text is (naturally) very
 79crisp. It's glossy, and attracts a ton of fingerprints. A stylus is
 80included in the box -- or at least it was for me -- but I haven't found
 81much use for it after the initial excitement.
 82
 83![](https://cdn.icyphox.sh/s7u2n.jpg)
 84
 85The keyboard is pretty good. Given the choice, I wouldn't have picked
 86the font on the caps, but I suppose it could be worse. Three backlight
 87modes for low, medium and high brightness exist. These can be controlled
 88via the sysfs device at `/sys/class/leds/asus::kbd_backlight/`. The
 89dedicated volume buttons are nice and work out of the box; the mic-mute
 90toggle key however needs special treatment to get detected by X11 --
 91adding the below udev rule did the trick:
 92
 93```nix
 94udev.extraHwdb = ''
 95  evdev:input:b0003v0B05p19B6*
 96    KEYBOARD_KEY_ff31007c=f20
 97'';
 98```
 99
100For ports, you get a USB-C and a USB-A on the right along with the power
101button; on the left: a 3.5mm headphone/microphone jack, a HDMI 2.0 port,
102and the proprietary XGm port for use with the [XG
103Mobile](https://rog.asus.com/in/external-graphic-docks/2021-rog-xg-mobile-model/)
104external GPU. The eGPU port, while being generally useless to me, also
105happens to contain a USB-C port, bringing the total to two. The ports
106selection could be better -- a single USB-A is one too less, forcing me
107to have to use a dongle to connect both my keyboard and mouse.
108
109| | |
110| ---- | ---- | 
111| ![](https://cdn.icyphox.sh/xyYII.jpg) | ![](https://cdn.icyphox.sh/z-Y1R.jpg) |
112
113The entire package weighs in at about 1.3 kilograms, which is just as
114much as my HP Envy. For how well it's built, I'm not complaining.
115
116Finally, here's the full spec list:
117- Ryzen 9 5900HS, 8 cores & 16 threads
118- 32 GB LPDDR4X RAM @ 4266MHz
119- Nvidia GeForce GTX 1650 Max-Q, 4 GB GDDR6
120- 1 TB SSD
121
122## software
123
124Installing NixOS was straightforward. Basically everything works out of
125the box. I'd have liked to run OpenBSD on it, but I unfortunately
126require Linux for work. NixOS, while I understand nothing of Nix (the
127language), works well enough. Being able to configure your entire system
128from one single place is quite nice. Overall, it's a lot more cohesive
129than other Linux systems.
130
131The Nvidia GPU is handled surprisingly well. Looks like Linux has
132improved a lot in this regard. "Offload mode" is especially neat -- you
133can selectively "offload" certain tasks (like running Steam) to the GPU,
134and otherwise have it suspended. Here's how I do it:
135
136```nix
137{ pkgs, ... }:
138
139pkgs.writeShellScriptBin "nvidia-offload"
140  ''
141    export __NV_PRIME_RENDER_OFFLOAD=1
142    export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0
143    export __GLX_VENDOR_LIBRARY_NAME=nvidia
144    export __VK_LAYER_NV_optimus=NVIDIA_only
145    exec -a "$0" "$@"
146  ''
147```
148
149Now simply run
150
151```sh
152$ nvidia-offload steam
153```
154
155to have Steam run on the GPU. Use the `nvidia-smi` tool to inspect
156processes currently using the GPU.
157
158The laptop has an accelerometer to detect when it's in tablet mode, and
159invert the display accordingly. Unfortunatly, I couldn't figure out how
160to get it to work in X11/cwm. Instead, I wrote a handy script to rotate
161the display and the touch input:
162
163```nix
164{ pkgs, ... }:
165
166let
167  xrandr = "${pkgs.xorg.xrandr}/bin/xrandr";
168  xinput = "${pkgs.xorg.xinput}/bin/xinput";
169in
170pkgs.writeShellScriptBin "invert"
171  ''
172    orientation="$(${xrandr} --query --verbose | grep eDP | cut -d ' ' -f 6)"
173    if [[ "$orientation" == "normal" ]];
174    then
175      echo "turning screen upside down..."
176      ${xrandr} -o inverted
177      ${xinput} set-prop 'ELAN9008:00 04F3:2C82' 'Coordinate Transformation Matrix' -1 0 1 0 -1 1 0 0 1
178      ${xinput} set-prop 'ELAN9008:00 04F3:2C82 Stylus Pen (0)' 'Coordinate Transformation Matrix' -1 0 1 0 -1 1 0 0 1
179      ${xinput} set-prop 'ELAN9008:00 04F3:2C82 Stylus Eraser (0)' 'Coordinate Transformation Matrix' -1 0 1 0 -1 1 0 0 1
180    else
181      echo "reverting back to normal..."
182      ${xrandr} -o normal
183      ${xinput} set-prop 'ELAN9008:00 04F3:2C82' 'Coordinate Transformation Matrix' 1 0 0 0 1 0 0 0 1
184      ${xinput} set-prop 'ELAN9008:00 04F3:2C82 Stylus Pen (0)' 'Coordinate Transformation Matrix' 1 0 0 0 1 0 0 0 1
185      ${xinput} set-prop 'ELAN9008:00 04F3:2C82 Stylus Eraser (0)' 'Coordinate Transformation Matrix' 1 0 0 0 1 0 0 0 1
186    fi
187  ''
188```
189
190Then, simply run `invert` to toggle your current orientation:
191```sh
192▲ invert
193turning screen upside down...
194
195▲ invert
196reverting back to normal...
197```
198
199Battery life could be better, but with TLP/powertop + switching the CPU
200governor to `powersave` on battery, I get about 7 - 8 hours on light
201workloads, and about 5 on heavy. I'm going to guess the 4K panel is to
202blame.
203
204Also worth mentioning is the [Asus Linux](https://asus-linux.org)
205project. They have some useful resources for running Linux on Asus
206laptops, and [asusctl](https://gitlab.com/asus-linux/asusctl) /
207[supergfxctl](https://gitlab.com/asus-linux/supergfxctl) -- two great
208tools for managing power profiles, fan curves and the dGPU.
209
210Overall, I couldn't be happier with this machine. It wasn't cheap, but
211it sure does check all the boxes and it's incredibly future proof. As
212for my trusty old HP Envy 13, I haven't decided yet what to do with it.
213It'll most probably end up in my closet, enshrined under a layer of
214clothes.
215
216You can find all the scripts mentioned in this post (and more!)
217[here](https://github.com/icyphox/dotfiles/tree/master/nix).