/

Switching from Linux to Mac

Overview

I switched from Linux on a ThinkPad to MacOS on a MacBook Pro. In this post I’ll explain why and then how.

If you are a Linux user thinking of switching to Mac, hopefully some of this will be useful.

Whatever you end up using, I hope you enjoy your time!

Why I started using Linux

Nobody starts on Linux. I grew up using Windows and eventually switched to a Mac in my 30s.

I was using a Mac when I got my first job as a self-taught web developer in 2017 at the age of 35. Everyone I worked with also used a Mac. It was a sea of Apple logos.

But our servers were running Linux and it became clear to me that the best developers had some understanding of Linux. We used Vagrant for local Linux servers and when something would go wrong we’d run:

sudo systemctl restart nginx

What did this do? I wasn’t sure. sudo meant admin, I thought. We have sudo on Macs. The rest, I was assured, was how “just Linux”.

I had no clue about unix users, what a root user was, what systemd was, and why this command worked. But I felt like I should know.

My time on Linux

I took the plunge. I bought a ThinkPad T580 and installed Ubuntu. I immediately ran into graphics card driver issues (Nvidia) and a coworker had to help me resolve the issues. In retrospect he just installed a few proprietary packages, but at the time it seemed like magic.

During the next four years I used Linux exclusively. I went from Ubuntu, to Arch, to NixOS. I did everything from the commandline. I went from knowing nothing, to knowing quite a bit about how a Unix system actually works. I was at home in the terminal, used many shells, compiled software, used tiling window managers, set environment variables, monitored processes, and learned Vim.

I was having fun! Most of the time.

Why Mac?

Although a lot of great developers use Linux, I couldn’t help but notice that many great developers used Macs. Brian Kernighan, Mitchell Hashimoto, Thorsten Ball, just to name a few. These people are more accomplished than I’ll ever be, and they don’t use Linux as their desktop OS. (They all use Linux in one way or another, of course.)

I had no intention of switching back to using a Mac. There would be too much I’d miss about Linux. But when my job required me to switch to using a Mac, I found the process surprisingly easy.

Very quickly I realized that my work Mac was more reliable than my NixOS ThinkPad. The battery life was incredible, the fans never kicked in, it was fast, and all software worked out of the box. I found myself preferring the Mac to my ThinkPad.

There were still plenty of things I preferred on Linux. But with a bit of tweaking, I could get my Mac working pretty well.

And so I bought a Mac. A 2023 M3 MacBook Pro. I’m typing this blog post on it.

My Recommendations for Linux users switching to Mac

Package Manager

Homebrew has been an incredibly reliable package manager for me. It’s so reliable that I even used it for my user level package manager toward the end of my time on Linux.

Terminal/Shell

If you’re a Linux user like I was a Linux user, you spend a lot of time in the terminal. This is good news, because the terminal remains mostly the same on a Mac. MacOS’s default shell is ZSH, but I use Fish these days. It’s so easy to configure, especially with Fisher.

I use WezTerm as my terminal emulator. I like that it’s fast and extremely configurable.

Everything you’d expect to work in the terminal works on MacOS.

Keyboard

Key Repeat

From the terminal, I run these commands to set the key repeat speed:

defaults write -g InitialKeyRepeat -int 10
defaults write -g KeyRepeat -int 1

This allows me to move more quickly in Vim. I know holding down a key is a bad practice.

Key Bindings

I’ve played around with a few different ways of setting up keybindings, but Karabiner Elements has worked best for me.

Here are my favorite two rules in Karabiner Elements:

  1. Open a terminal quickly with ⌘⇧return
  2. Caps lock is escape when tapped and CTRL when held
"rules": [
    {
        "description": "open terminal",
        "manipulators": [
            {
                "from": {
                    "key_code": "return_or_enter",
                    "modifiers": {
                        "mandatory": [
                            "left_gui",
                            "shift"
                        ]
                    }
                },
                "to": [
                    {
                        "shell_command": "open -na wezterm --args start --always-new-process"
                    }
                ],
                "type": "basic"
            }
        ]
    },
    {
        "description": "Caps is escape when tapped and control when held",
        "manipulators": [
            {
                "from": {
                    "key_code": "caps_lock",
                    "modifiers": {
                        "optional": [
                            "any"
                        ]
                    }
                },
                "to": [
                    {
                        "key_code": "left_control"
                    }
                ],
                "to_if_alone": [
                    {
                        "key_code": "escape"
                    }
                ],
                "type": "basic"
            }
        ]
    }
]

Raycast - App launcher, window manager, and more

I use Raycast for everything. It is an app launcher (like dmenu or rofi), but it does so much more. Raycast is my dictionary, my emoji picker, my clipboard history, my window manager (yes!), shooting confetti (yes!!), launching a VPN, etc.

Raycast is as essential to me now as is the terminal and vim.

I messed around with Yabai, a tiling window manager for MacOS, before ditching tiling window management. Raycast allows me to move windows around with ease. It’s good enough!

CleanShot X

CleanShot is the only paid application I’ll mention. It allows me to to take screenshots, annotate them, and make them look very pretty.

code screenshot
This is a screenshot taken using CleanShot

But CleanShot can do more than take pretty screenshots. It can do video recordings very well, too. I use it for all my screen recordings at work. I strongly encourage you to try it out.

AltTab - Application switcher

AltTab allows me to switch between applications quickly. I use it mostly to switch between to the most recent two applications, like my terminal and web browser. The killer functionality is the application preview.

No Dock

I remove the MacOS Dock as much as possible. I shrink it down, auto hide it, and put it on the left side of the screen. I never use it. It’s gone.

What I’m taking with me from Linux

I’m not using Linux as my desktop OS anymore, but I’m taking a few things with me. These things aren’t unique to Linux, but Linux is where I found them.

  1. A love of the terminal.
  2. Shell scripts.
  3. A demand for agility.
  4. Vim.
  5. Plain text.
  6. An understanding of how operating systems work (admittedly limited)