Running Ubuntu on a MacBook Pro
May 26, 2024 · 4 min readNote: This post is a work in progress, and mainly for my notes. It’s current as of May 2024!.
I had a ten year old MacBook Pro lying around not really doing anything. It wasn’t doing very well with the macOS either, so decided to run Ubuntu on it. Ubuntu was my main development environment from about 2008 until about 2011, and I miss it.
However, as a life long Mac user, the keyboard shortcuts and combinations are too much muscle memory for me to try and move away from. Also, this is a fun side project. I’m not entirely moving over to Ubuntu, so I don’t really want to change my muscle memory too much.
This post tries to explain how best to modify Ubuntu to make it more like the macOS experience from a keyboard point of view. For example Copy and Paste is cmd+c
and cmd+v
respectively.
Hardware
This post centres around the following hardware:
- MacBook Pro (Retina, 13-inch, Early 2015)
- Model Identifier:
MacBookPro12,1
- Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz
- 8GB Ram
Identified by lscpu
and dmidecode
.
I’ve also run a second Samsung monitor with this setup, and all is working fine (tm)!
Key mapping
As per this article we need to update the /usr/share/X11/xkb/symbols/pc
file.
So let’s go ahead and update it:
sudo vim /usr/share/X11/xkb/symbols/pc
We need to make these changes (Replace what is already defined for those key mappings).
key <LCTL> { [ Super_L ] };
key <LWIN> { [ Control_L ] };
key <RCTL> { [ Super_R ] };
key <RWIN> { [ Control_R ] };
Once you have made these changes, you need to restart your machine.
Keyboard settings
Now let’s change some keyboard shortcuts in settings.
- Open Settings
- Go to the Keyboard section
- Click View and Customize Shortcuts
Let’s update the following sections. Note that the UI here will still say ctrl
instead of cmd
as we mapped that at an underlying system level.
Navigation
- Switch applications - Set this to
cmd+tab
. - Hide all normal windows - Set this to
cmd+shift+h
. This is because in terminal, I’m so use to doctrl+d
this is really jarring, when all the windows go.
System
- Show all apps - Set this to
cmd+space
- This gives a spotlight feel to it.
Camera
The camera did not work after the standard install. However, this open source project worked fine for me. Just follow their instructions.
Tmux
If you use tmux, and you did the above, depending on what your leader key was, you might have some issues. Prior to this exercise, I had the leader key set to C-a
. This now becomes cmd+a
with the above key mapping changes. Yep, this means it’s different depending on whether I’m on macOS, or Linux. I did consider using a different tmux.conf
or have an extended one for each OS. However, mapping cmd
looked a little tricky.
I’ve capitulated, and moved my leader key to be M-a
. This means it will be consistent on both OS’s. This is a minimal change to the way I work, but I can live with it.
However, I did have to make a slight change to iTerm.
Settings… > Profiles and pick your profile. Then Keys, and change Left Option Key to be Esc+
.
What I like
So, after all this, what do I actually like about it?
- The
cmd+alt+ctrl+shift+arrow
combination to move a window to a new workspace is just :chef-kiss: - The control centre widget (top right) is really nice. I can even control the keyboard lights from there.
- Much improved from Ubuntu 8.04 (The first Ubuntu I used).
- It’s nice to (re)try new things.
What I’m missing
… but will learn, or learn to adapt.
- The
#
is now rightalt+3
. - Wording shifting is now
cmd
and notalt
. - Tab shifting is catching me out all the time. e.g.
cmd+shift+[]
etc, vsfn+cmd+arrows
. - Navigation in browsers (Chrome):
cmd+[]
vsalt-arrows
. - I think iTerm is richer than Gnome Terminal, but tmux softens the edges a little.
- I actually miss copy/pasting stuff between iCloud accounts!
Summary
I could certainly be a fully functional software engineer on an Ubuntu OS. The fact that a lot of apps are now in your browser really helps. This entire weekend was backed with Spotify playing seamlessly.
Onwards…