Skip to content

Instantly share code, notes, and snippets.

@bernhardfritz
Last active August 1, 2025 06:14
Show Gist options
  • Select an option

  • Save bernhardfritz/f250ceaec666a974341b422debb6ae1a to your computer and use it in GitHub Desktop.

Select an option

Save bernhardfritz/f250ceaec666a974341b422debb6ae1a to your computer and use it in GitHub Desktop.
MacBook-friendly Ubuntu tweaks

MacBook-friendly Ubuntu tweaks

I recently decided to switch from macOS BigSur 11.7.10 to Ubuntu 24.04 LTS after Apple decided to no longer provide updates for my MacBook Pro 11,1. During this transition I learned about various tweaks to improve user experience for MacBook users.

As a MacBook user you are probably used to keyboard shortcuts involving the ⌘ command key like ⌘ command+C and ⌘ command+V to copy/paste respectively. However, in Ubuntu pressing the ⌘ command key by default will open the Activities Overview which is similar to the Exposé view in macOS which is not what we want. As it turns out, Ubuntu involves the control key for almost all combinations you may be used to that involve the ⌘ command key in macOS. Luckily Ubuntu is quite configurable and we can tailor it to our needs.

Prerequisites

gnome-tweaks

sudo apt update
sudo apt install gnome-tweaks

keyd

sudo add-apt-repository ppa:keyd-team/ppa
sudo apt update
sudo apt install keyd

Set up macOS-like keybinds

For this we will use a piece of software called keyd.

With keyd installed setting up macOS keybinds is as easy as dropping the default.conf linked below into your /etc/keyd/ directory and running sudo keyd reload.

After this you will notice left control now opens Activities Overview. This is a side-effect of swapping ⌘ command and control keys with the keyd configuration we just applied. We can easily fix this behavior with gnome-tweak-tool.

Open your Applications View and search for "Tweaks".

Navigate to Keyboard and bind "Overview Shortcut" to "Right Super".

Note: This effectively stops Activities Overview from being opened accidentally when pressing control because ⌘ command aka "Super" is remapped to control and there is no right control key on a MacBook.

Screenshot from 2024-08-20 23-54-30 Screenshot from 2024-08-23 20-26-06

Note: The rest of this guide assumes you have swapped control and ⌘ command using keyd as described above. If you see depictions or references of "Ctrl" and "Super" in screenshots of this guide please don't be confused as they are interpreted the other way around from this point forward.

Open the Activities Overview and the Applications View with Exposé and Launchpad keys

MacBooks have dedicated keys, typically located at F3 and F4 to open what's known as exposé view and Launchpad in macOS.

These views closely resemble what is known in Ubuntu as the Activities Overview and the Applications View and it's quite handy to have a quick way to access them.

Open your Applications View and search for "Settings".

Navigate to Keyboard > View and Customize Shortcuts > System and reassign "Show the overview" and "Show all apps" to F3 and F4 respectively (without pressing fn).

Screenshot from 2024-08-21 21-23-35 Screenshot from 2024-08-21 21-14-08 Screenshot from 2024-08-21 22-28-27

Note: Alternatively you can also place three fingers on the touchpad and gesture upwards to open the Activities Overview. To open the Applications View, place three fingers and gesture upwards again.

Take screenshots with command+shift+3 and command+shift+4

Open your Applications View and search for "Settings".

Navigate to Keyboard > View and Customize Shortcuts > Screenshots and reassign "Take a screenshot" and "Take a screenshot interactively" to ⌘ command+shift+3 and ⌘ command+shift+4 respectively.

Screenshot from 2024-08-21 21-23-35 Screenshot from 2024-08-21 21-14-08 Screenshot from 2024-08-21 21-45-12

Control audio player with media keys

For some reason media keys like previous track, play/pause, next track that are typically located on F7, F8 and F9 respectively are not assigned by default.

Open your Applications View and search for "Settings".

Navigate to Keyboard > View and Customize Shortcuts > Sound and Media and reassign "Next track", "Play (or pause/play)" and "Previous track" to F7, F8 and F9 respectively (without pressing fn).

Screenshot from 2024-08-21 21-23-35 Screenshot from 2024-08-21 21-14-08 Screenshot from 2024-08-21 21-47-42

Set up application-specific keybinds

Copy/paste in terminal with command+C and command+V

Press ⌘ command+option+T to open Terminal.

Click on the menu icon and then on "Preferences" to open Terminal Preferences.

Select "Shortcuts", double click the column right to "Copy" and press ⌘ command+C to define a new shortcut for "Copy".

Note: This will also remap interrupt to use ⌘ command+shift+C instead.

Next, double click the column right to "Paste" and press ⌘ command+V.

Screenshot from 2024-08-21 20-02-08 Screenshot from 2024-08-21 20-18-17 Screenshot from 2024-08-21 20-18-23

Open previous/next editor in VS Code with command+shift+[ and command+shift+]

Open VS Code.

Press ⌘ command+shift+P and search for "keyboard".

Click on "Preferences: Open Keyboard Shortcuts (JSON).

Copy/paste the file content of keybindings.json linked below and save.

Screenshot from 2024-08-23 20-37-45 Screenshot from 2024-08-23 20-52-39

Set up macOS-like Multi-Touch gestures

Compared to macOS the number of available gestures in Ubuntu is quite limited.

Open your Applications View and search for "Settings".

Navigate to Mouse & Touchpad > Touchpad

Screenshot from 2024-08-21 21-23-35 Screenshot from 2024-08-23 21-49-36

Three finger drag

Possibly the most loved multi-touch gesture by far is the three finger drag feature which can be enabled on macOS in Accessibility preferences.

Unfortunately this feature did not arrive in Ubuntu yet. There are some experimental solutions out there but I haven't yet found a solution that works reliably.

Threads to watch:

Disable touchpad acceleration

Open your Applications View and search for "Tweaks".

Navigate to Mouse & Touchpad and disable "Touchpad Acceleration".

Screenshot from 2024-08-20 23-54-30 Screenshot from 2024-08-23 22-33-59

Locate the Dock along the bottom edge of the screen

If you are used to macOS you may prefer your Dock to be located along the bottom edge of your screen.

Open your Applications View and search for "Settings".

Navigate to Ubuntu Desktop > Dock > Position on Screen and select "Bottom".

Screenshot from 2024-08-21 21-23-35 Screenshot from 2024-08-23 22-06-27 Screenshot from 2024-08-23 21-42-16

Optional: Change placement of window titlebar buttons

This is a matter of taste. Compared to macOS the placement of the buttons in the window titlebar in Ubuntu is on the right side by default. You can change this behavior if you prefer left-aligned buttons instead.

Open your Applications View and search for "Tweaks".

Navigate to Windows > Titlebar Buttons > Placement and select "Left".

Screenshot from 2024-08-20 23-54-30 Screenshot from 2024-08-23 22-43-59
# NOTE: to use this, rename this file to default.conf and put in /etc/keyd/
[ids]
*
[main]
# Swap control/meta
control = layer(meta)
meta = layer(control)
[control]
# Move cursor to beginning of line
left = home
# Move cursor to end of Line
right = end
# Move cursor to beginning of file
up = C-home
# Move cursor to end of file
down = C-end
# As soon as tab is pressed (but not yet released), we switch to the
# "app_switch_state" overlay where we can handle Meta-Backtick differently.
# Also, send a 'M-tab' key tap before entering app_switch_sate.
tab = swapm(app_switch_state, M-tab)
# Meta-Backtick: Switch to next window in the application group
# - A-f6 is the default binding for 'cycle-group' in gnome
# - keybinding: `gsettings get org.gnome.desktop.wm.keybindings cycle-group`
` = A-f6
# app_switch_state modifier layer; inherits from 'Meta' modifier layer
[app_switch_state:M]
# Meta-Tab: Switch to next application
# - keybinding: `gsettings get org.gnome.desktop.wm.keybindings switch-applications`
tab = M-tab
# Meta-Backtick: Switch to previous application
# - keybinding: `gsettings get org.gnome.desktop.wm.keybindings switch-applications-backward`
` = M-`
[control+shift]
[ = C-S-tab
] = C-tab
[alt]
left = C-left
right = C-right
// Place your key bindings in this file to override the defaults
[
{
"key": "ctrl+shift+tab",
"command": "workbench.action.previousEditor"
},
{
"key": "ctrl+pageup",
"command": "-workbench.action.previousEditor"
},
{
"key": "ctrl+tab",
"command": "workbench.action.nextEditor"
},
{
"key": "ctrl+pagedown",
"command": "-workbench.action.nextEditor"
},
{
"key": "ctrl+c",
"command": "workbench.action.terminal.copySelection",
"when": "terminalTextSelectedInFocused || terminalFocus && terminalHasBeenCreated && terminalTextSelected || terminalFocus && terminalProcessSupported && terminalTextSelected || terminalFocus && terminalTextSelected && terminalTextSelectedInFocused || terminalHasBeenCreated && terminalTextSelected && terminalTextSelectedInFocused || terminalProcessSupported && terminalTextSelected && terminalTextSelectedInFocused"
},
{
"key": "ctrl+shift+c",
"command": "-workbench.action.terminal.copySelection",
"when": "terminalTextSelectedInFocused || terminalFocus && terminalHasBeenCreated && terminalTextSelected || terminalFocus && terminalProcessSupported && terminalTextSelected || terminalFocus && terminalTextSelected && terminalTextSelectedInFocused || terminalHasBeenCreated && terminalTextSelected && terminalTextSelectedInFocused || terminalProcessSupported && terminalTextSelected && terminalTextSelectedInFocused"
},
{
"key": "ctrl+v",
"command": "workbench.action.terminal.paste",
"when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported"
},
{
"key": "ctrl+shift+v",
"command": "-workbench.action.terminal.paste",
"when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported"
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment