So, I gave up on Windows after about a month of giving it a go and switched to Ubuntu. There were a couple of things to tweak here and there, but overall, I found myself productive a lot quicker than I did in Windows. And this was in the first week of installing Ubuntu.

This post details some of the tweaks I’ve had to make during the first week or so.

Keyboard

Changing CapsLock and Control is easy: do it via the Gnome Tweak Tool. Unfortunately, if you have a Japanese keyboard, where the CapsLock key doubles as the Eisuu key when using an IME, this can confuse the IME. So, I ended up making CapsLock an additional Control key. I don’t need CapsLock anyway. IF I NEED TO SCREAM AT SOMEONE I JUST HOLD SHIFT DOWN WITH MY PINKIE.

Changing the “backslash underscore” key to work as “underscore backslash” was also easy. I followd the instructions in the community guide and tweaked /usr/share/X11/xkb/symbols/jp from:

    key <AB11> { [ underscore, backslash] };

to:

    key <AB11> { [ backslash, underscore] };

So now, when I press the 11th key on the bottom row, I get an underscore. If I hold shift and press that key, I get a backslash. This is much better for me because, as a programmer, I use underscores way more often than I use backslashes. On top of that, another key in the top row already corresponds to backslash. You have to log out and back in for the change to take effect: not sure how to achieve this otherwise.

Originally, I tried to achieve the above using xmodmap but that wasn’t the way to go, because xmodmap settings don’t persist.

Wireless Broken After Unsuspend

After a day or so of working, I got a nasty surprise: upon unsuspending the notebook, I was unable to connect to WiFi.

Luckily, I wasn’t the first to encounter this problem. The solution appears to remove the reload the wireless driver module. Finding out the name of the module is easy:

$ sudo lshw -C network
  *-network
       description: Wireless interface
       product: Wireless 8265 / 8275
       vendor: Intel Corporation
       physical id: 0
       bus info: pci@0000:02:00.0
       logical name: wlp2s0
       version: 78
       serial: 14:4f:8a:70:46:b2
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
       configuration: broadcast=yes driver=iwlwifi driverversion=4.15.0-29-generic firmware=34.0.1 ip=192.168.2.127 latency=0 link=yes multicast=yes wireless=IEEE 802.11
       resources: irq:157 memory:ee200000-ee201fff
  *-network
       description: Ethernet interface
       product: Ethernet Connection (4) I219-LM
       vendor: Intel Corporation
       physical id: 1f.6
       bus info: pci@0000:00:1f.6
       logical name: enp0s31f6
       version: 21
       serial: 8c:16:45:38:f6:8b
       capacity: 1Gbit/s
       width: 32 bits
       clock: 33MHz
       capabilities: pm msi cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=e1000e driverversion=3.2.6-k firmware=0.1-4 latency=0 link=no multicast=yes port=twisted pair
       resources: irq:155 memory:ee300000-ee31ffff

In my case, the driver was iwlwifi. To reload it, I had to do:

$ sudo modprobe -r iwlwifi && sudo modprobe -i iwlwifi

Finally, I had to restart the network manager:

$ sudo systemctl restart network-manager

After a few seconds, the WiFi was back.

WiFi Reception

I noticed that the WiFi indicator shows a sub-optimal signal strength. I’m reasonably close to my station, and the MacBook used to show 100% strength from where I usually sit. This may be worth investigating.

Gnome

The extensions.gnome.org thing is pretty cool. You can manage Gnome extensions via your browser, instead of installing them manually. I’ve installed two so far:

  1. NoAnnoyance - disable those annoying “XYZ window is ready pop-ups”, and just show “XYZ Window” straight away
  2. Hibernate option - good, but only works once you’ve logged in

Bluetooth

Had to install blueman, the built-in app wasn’t discovering anything at all. My MagicTrackpad was easy to connect to and pair:

https://wiki.ubuntu.com/Multitouch/AppleMagicTrackpad

The trick was to hold the power button for 10s, until the light started flashing rapidly (more than once a second).

The story with the MagicKeyboard was a bit longer, but also had a happy ending, at least for now. At first, “hcitool scan” refused to discover it at all. After some shamanic incantations (mostly just hammering it with hcitool), it was discoverable, but wouldn’t pair. It’s light would flash, but not very rapidly, slower than for the MagicTrackpad. I could “add” it via blueman, but it wasn’t paired. I read somewhere that you have to press “fn + F6” to get it out of numlock mode, so I tried that a few times, out of desperation, but to no avail.

At one point I noticed the light was flashing more rapidly than before. I tried to pair, and blueman gave me a code to enter on the keyboard. I entered it and the keyboard paired!

I miss not being able to tell how much charge is left in the batteries, but that’s a relatively minor complaint.

Now I just have to tweak the layout so that it resembles the notebook’s native layout as much as possible.

Display

The built-in WQHD display is simply stunning. After working with it for a few hours, it’s difficult to go back to the MacBook Air without cringing. That said, things do require a little bit of tweaking to get right on Ubuntu.

First, at that resolution (WQHD is 2560x1140), things start to get pretty small. By default, Ubuntu lets you scale things, but only in integer increments: 100% (the default), 200% (things become twice as large) and 300% (didn’t even bother). At 100% things are a bit too small, but at 200% they are a bit too large.

Luckily, there’s a tool that allows you to set non-integer scaling factors. The appropriately named “Gnome Tweak Tool” has a “Fonts” section that helps you achieve just that. Other apps have their own support for scaling. For example, Firefox has a layout.css.devPixelsPerPx option hidden in the about:config section. Telegram has its own thing.

At this stage, the internal display is all set and ready to rock. When I work from my office, I prefer to work with an external display: it’s bigger, so it’s easier on the eyes; and it sits at around eye-level, so it’s better for my neck and shoulders (PSA: hunching over your laptop is not good for posture). My external display is a 23-inch Mitsubishi Diamondcrysta (probably a Japan-only model) that has a native resolution of 1920x1080. It’s been my trusty companion since I arrived in Japan over 8 years ago, but now it’s getting outperformed by a laptop display that is less than half its’ physical size! The problem for me is that now I have to undo all the tweaks that I applied in the above paragraph:

  1. Set scale to 100%
  2. Tweak the non-integer scaling factor to be 1.0
  3. Tweak apps like Firefox and Telegram to go back to “normal” scaling

This isn’t a huge deal since I only have to do this when I go in/out of clamshell mode, which doesn’t happen that often. Nevertheless, I’ll be looking for a way to script the above changes so I can get them out of the way quickly. Stay tuned :)