Ubuntu on MacBook: Making Linux Feel Like macOS

If you’ve ever tried running Ubuntu on a MacBook, you’ll know the keyboard just feels… wrong. Command keys don’t do what you expect, Option keys aren’t Alt, and all those macOS shortcuts you love are suddenly broken. Add in the trackpad quirks and F-key frustrations, and you quickly realize Linux doesn’t magically turn your MacBook into a perfect clone of macOS — at least, not out of the box.

But here’s the good news: with a few small tweaks, you can have all the macOS behaviors you expect, while keeping the full power and customizability of Ubuntu. This post is your ultimate guide.

Keyboard: Command, Option, Control — Fixed

By default, Ubuntu treats the MacBook keyboard like any other PC. That means:

  • ⌘ (Command) acts as Super (used for GNOME shortcuts, but not Ctrl-like shortcuts)
  • ⌥ (Option) acts as Alt, which is okay
  • Ctrl stays where it is, but your muscle memory wants Command

We fix this with GNOME Tweaks or a simple command-line setup.

Step 1: Install GNOME Tweaks

sudo apt install gnome-tweaks

Open Tweaks, go to Keyboard & Mouse → Additional Layout Options.

  • Swap Ctrl and Win: Makes ⌘ behave like Ctrl
  • Alt/Win swap (optional): Makes ⌥ behave as Alt

Step 2: Apply via CLI (Wayland-safe)

gsettings set org.gnome.desktop.input-sources xkb-options "['ctrl:swap_lwin_lctl','altwin:swap_lalt_lwin']"

Check with:

gsettings get org.gnome.desktop.input-sources xkb-options

Step 3: Make ⌘+Space Spotlight-style

gsettings set org.gnome.settings-daemon.plugins.media-keys search "['space']"

Press ⌘+Space — instant search.

Step 4: Optional: ⌘ alone → Activities Overview

gsettings set org.gnome.mutter overlay-key 'Super_L'

Now pressing Command alone opens Activities, just like pressing Mission Control on macOS.

Trackpad Tweaks

MacBook trackpads are amazing hardware, but Linux doesn’t always get it right out of the box. Here’s how to fix it:

  1. Natural Scrolling: Settings → Mouse & Touchpad → Enable Natural Scrolling
  2. Tap-to-Click: Settings → Mouse & Touchpad → Tap to click
  3. Gestures (optional): Install touchegg for multi-finger gestures:
    sudo apt install touchegg
    touchegg &
    
    Map three-finger swipe to workspace switch, pinch to zoom, etc.

F-Key and System Controls

MacBook function keys control brightness, volume, and media. Out of the box, Linux may require fn to trigger them.

  • Brightness keys: Usually just work; if not, install brightnessctl
    sudo apt install brightnessctl
    
  • Volume keys: Check GNOME Settings → Keyboard Shortcuts → Sound
  • Media keys: Install playerctl for multimedia key mapping

System Polish

Want your Ubuntu to look like macOS too? A few aesthetic tweaks:

  • Fonts: San Francisco / SF Mono (Mac-like fonts)
  • Apple’s San Francisco font isn’t bundled with Linux, but you can get it from Apple’s official developer site:

    1. Go to Apple Developer Fonts and log in with your Apple ID.
    2. Download SF Pro or SF Mono.
    3. Extract the .zip file.
    4. Copy the .otf files to your local fonts directory:
      mkdir -p ~/.local/share/fonts/SF-Pro
      cp ~/Downloads/SF-Pro/*.otf ~/.local/share/fonts/SF-Pro/
      
    5. Refresh the font cache:
      fc-cache -f -v
      
    6. Select San Francisco (SF Pro) or SF Mono in GNOME Tweaks, Terminal, or apps.

    SF Mono is perfect for terminals — GNOME Terminal → Preferences → Profile → Text → Custom Font → SF Mono.

  • Window Buttons: GNOME Tweaks → Themes → Adjust buttons to left
  • Dock: Use Dash to Dock or Dash to Panel for a macOS-style dock
  • Backgrounds: Match macOS default wallpaper for familiarity

One-Line Setup Script

#!/bin/bash
# MacBook keyboard remap for Ubuntu
gsettings set org.gnome.desktop.input-sources xkb-options "['ctrl:swap_lwin_lctl','altwin:swap_lalt_lwin']"
gsettings set org.gnome.settings-daemon.plugins.media-keys search "['space']"
gsettings set org.gnome.mutter overlay-key 'Super_L'
echo "MacBook keyboard remap applied!"

Save as macbook-ubuntu-tweaks.sh, make executable:

chmod +x macbook-ubuntu-tweaks.sh
./macbook-ubuntu-tweaks.sh
Run it once — remaps persist across reboots.

Wrapping Up

With these tweaks, Ubuntu feels so much more like macOS on your MacBook. Shortcuts behave as expected, trackpad gestures are natural, F-keys work without fighting, and the system even looks familiar.

It’s a blend of the power and flexibility of Linux with the polish and muscle memory of macOS. For anyone using a MacBook as their main Linux machine, these tweaks are essential — and the best part? They’re fully reversible if you want to experiment.

Next
Next

BSOD