A GNOME/Wayland keyboard configuration that makes a standard PC keyboard behave more like macOS: the physical Alt key (next to the spacebar, where macOS Cmd lives) becomes the primary modifier for app shortcuts, window management, and launcher access.
On a Mac, your thumb rests on Cmd. Copy, paste, tab switching, app switching, and Spotlight all use Cmd. On a PC keyboard, Cmd does not exist, but Alt sits in the same ergonomic position. This setup swaps the internal meaning of Alt and Ctrl so that your thumb naturally controls the actions you use most.
Key benefits:
- Ergonomics: Your strongest thumb controls copy/paste, tab switching, and app switching instead of your pinky on
Ctrl. - Consistency across apps: Browsers, terminals, and editors already use
Ctrlfor shortcuts; after the swap, those shortcuts move to the macOSCmdposition. - Muscle memory: If you switch between a Mac and a Linux machine, the modifier placement stays the same.
- Speed: Direct workspace switching (
Super + 1..4) and a launcher underAlt + Spacereduce hand travel to the mouse. - Caps Lock as additional Shift: The unused Caps Lock key sends
Shift, adding an easier-to-reach Shift key under the left pinky. Both original Shift keys still work normally.
- Physical
Alt→ sendsCtrl - Physical
Ctrl→ sendsAlt Caps Lock→ additionalShift(Left and Right Shift still work normally)
| Shortcut | Action |
|---|---|
Alt + Tab |
Window/app switcher |
Alt + Shift + Tab |
Switch backward |
| `Alt + `` | Cycle windows of the same app |
| `Alt + Shift + `` | Same-app cycle backward |
Alt + F4 |
Close window |
Alt + F10 |
Maximize / unmaximize |
Alt + F7 |
Move window |
Alt + F8 |
Resize window |
Alt + Space |
Open GNOME search / launcher |
Most apps already use Ctrl for these, so they move to the physical Alt key:
| Shortcut | Action |
|---|---|
Alt + C / Alt + V / Alt + X |
Copy / paste / cut |
Alt + Z / Alt + Shift + Z |
Undo / redo |
Alt + T |
New tab |
Alt + W |
Close tab |
Alt + Shift + T |
Reopen closed tab |
Alt + R |
Reload |
Alt + F |
Find |
Alt + 1..9 |
Switch to tab 1–9 |
Alt + [ / Alt + ] |
Previous / next tab (with keyd on Linux / AHK on WSL) |
| Shortcut | Action |
|---|---|
Super + Return |
Open terminal (ptyxis) |
Super + E |
Open editor (zed) |
Super + B |
Open browser (firefox) |
Super + Shift + S |
Interactive screenshot |
Super + 1..4 |
Switch to workspace 1–4 |
Super + Shift + 1..4 |
Move window to workspace 1–4 |
- Ptyxis: remapped to
Ctrl + 1..0, soAlt + 1..0switches tabs. The defaultCtrl + PageUp/Ctrl + PageDownshortcuts move to the previous / next tab; keyd (Linux) and the AHK script (WSL) translateAlt + [/Alt + ]into those chords. - WezTerm: patch included (
configs/wezterm-tab-switching.patch) that addsCtrl + 1..9tab switching plusCtrl + [/Ctrl + ]andCtrl + PageUp/Ctrl + PageDownfor previous / next tab.
- Firefox:
user.jsmakesCtrlthe primary accelerator, soAlt + 1..9switches tabs andAlt + C/Vcopies/pastes. - Chromium / Chrome / Edge: already use
Ctrl + 1..9for tabs, so the swap makesAlt + 1..9work immediately. - Previous / next tab (
Alt + [/Alt + ]): withkeyd(Linux) or the AutoHotkey script (WSL) installed, these chords are translated intoCtrl + PageUp/Ctrl + PageDown, which Firefox and Chromium already use for previous / next tab.
Physical Alt + [ / Alt + ] is translated into the standard Ctrl + PageUp / Ctrl + PageDown tab-switching chords so it works in Firefox, Chrome, Edge, WezTerm, and Windows Terminal.
Install keyd and load the included config:
# Fedora
sudo dnf copr enable alternateved/keyd
sudo dnf install keyd
# Ubuntu 25.04+ / Debian 13+
sudo apt install keyd
# Arch
sudo pacman -S keydThen copy the config and start the daemon:
sudo install -Dm644 configs/keyd.conf /etc/keyd/default.conf
sudo systemctl enable --now keyd
sudo keyd reloadkeyd runs below the display server, so the same config works on Wayland, X11, and even a Linux VT.
Run the AutoHotkey v2 script on the Windows host:
# From the windows/ directory, double-click keyboard-macos.ahk,
# or place a shortcut to it in your Startup folder.The script now sends Ctrl + PageUp / Ctrl + PageDown when you press physical Alt + [ / Alt + ]. Add the windows/windows-terminal-shortcuts.json actions to Windows Terminal so the same chords switch WSL tabs.
- GNOME 40+ on Wayland or X11
gsettingsanddconf- Firefox (if using the Firefox profile tweak)
ptyxisorwezterm(if using the terminal tab-switching tweaks)
The configuration was built on Fedora 44 Workstation (GNOME Classic on Wayland) and is fully Wayland-native.
This setup does not use any X11-specific tools such as xmodmap, xbindkeys, xcape, or setxkbmap. Everything is configured through GNOME's gsettings/dconf and D-Bus interfaces, which work identically on both Wayland and X11 GNOME sessions.
- The modifier swap (
Alt↔Ctrl,Caps Lock→Shift) is applied viaorg.gnome.desktop.input-sources xkb-options, which is honored by the Wayland compositor. - Custom shortcuts (
Super+Return,Super+E,Alt+Space, etc.) are registered with GNOME's media-keys daemon. - Window management (
Alt+Tab,Alt+F4) is handled by Mutter on both display servers. - The screenshot shortcut calls GNOME Shell directly over D-Bus, so it works on Wayland without X11 screenshot tools.
If you log out and choose a different GNOME session type (Classic, standard, Xorg, or Wayland), the same keyboard configuration will follow your user account.
git clone https://github.com/dporkka/linux-keyboard-setup.git
cd linux-keyboard-setup./apply.shThe script will:
- Back up your current GNOME, IBus, and Ptyxis settings to
~/.local/share/linux-keyboard-setup-backups/ - Load the GNOME keyboard and shortcut settings
- Clear IBus triggers so
Alt + Spaceopens GNOME search - Load the Ptyxis tab-switching configuration
- Copy
firefox-user.jsto all detected Firefox profiles
cd ~/.config/wezterm
git apply /path/to/linux-keyboard-setup/configs/wezterm-tab-switching.patchLog out and log back in. Firefox needs a restart as well for user.js to take effect.
Everything should work out of the box. The script uses gsettings, dconf, and gdbus, all installed by default.
sudo dnf install gnome-tweaks # optional, useful for visual shortcut inspectionInstall the required tools if they are missing:
sudo apt update
sudo apt install dconf-cli gnome-shell- Terminal: Ubuntu's default terminal is
gnome-terminal, notptyxis. Theapply.shscript automatically detects the first available terminal (ptyxis,gnome-terminal,kgx,alacritty,wezterm) and updates theSuper+Returnlauncher. - Editor:
zedmay not be installed on Ubuntu. Theapply.shscript detectszed,code,gnome-text-editor,gedit, ornvimand updates theSuper+Elauncher accordingly. - Firefox snap: Ubuntu ships Firefox as a snap by default. Snap Firefox profiles live under
~/snap/firefox/common/.mozilla/firefox/. Theapply.shscript copiesuser.jsto that location in addition to the standard~/.mozilla/firefox/path. - Ubuntu Dock: Ubuntu uses the Ubuntu Dock extension, which may override some
Super+numberbehavior. IfSuper+1..4for workspaces does not behave as expected, open Settings → Keyboard → Keyboard Shortcuts → View and Customize Shortcuts → Navigation and check that no dock shortcuts conflict. - Pop Shell: If you use Pop!_OS with Pop Shell, review
configs/gnome-wm-keybindings.dconfbefore applying, since Pop Shell adds its own tiling shortcuts that may overlap. - Wayland vs Xorg: Ubuntu 22.04+ defaults to Wayland but still supports Xorg at the login screen. This configuration works on both because it uses GNOME settings rather than X11 tools.
Install the required tools if they are missing:
sudo apt update
sudo apt install dconf-cli gnome-shell- Terminal: Debian's default GNOME terminal is
gnome-terminal.apply.shwill detect and use it automatically. - Editor:
geditorgnome-text-editorare the most common graphical editors on Debian.apply.shdetectszed,code,gnome-text-editor,gedit, ornvim. - Firefox: Debian ships Firefox as a native
.debpackage (or Firefox ESR in some releases). Profiles are at~/.mozilla/firefox/. If you installed Firefox from a flatpak or snap, copyconfigs/firefox-user.jsto the appropriate profile directory manually. - Stock GNOME: Debian uses a very close-to-stock GNOME session, so the default shortcuts in this repo should apply cleanly.
- Wayland vs Xorg: Debian defaults to Wayland for GNOME when available, but Xorg is still an option at login. The configuration works on both.
Install the required tools:
sudo pacman -S dconf gnome-shell gsettings-desktop-schemas-
Terminal: Arch does not ship a default terminal. Common choices are
alacritty,wezterm,gnome-terminal, orkitty.apply.shdetects any of the supported terminals and updates the launcher. -
Editor:
zedandcodemay need to be installed from the AUR or official repositories.apply.shfalls back tognome-text-editor,gedit, ornvimif those are present. -
Firefox: The standard Arch package stores profiles at
~/.mozilla/firefox/. If you use the Flatpak, profiles are under~/.var/org.mozilla.firefox/.mozilla/firefox/. -
AUR packages:
ptyxisandzedare often only available through the AUR. If you want the exact Fedora defaults, install them first; otherwiseapply.shwill pick the next available terminal/editor. -
Minimal GNOME installs: If you installed only
gnome-shellwithout the full GNOME group, verify the required schemas exist:gsettings list-schemas | grep -E "wm.keybindings|media-keys"
-
Wayland vs Xorg: Arch GNOME defaults to Wayland but supports Xorg. The configuration works on both display servers.
This configuration targets GNOME. For KDE Plasma, Sway, or Hyprland you would need different tooling:
- KDE Plasma: use
kwriteconfig5and System Settings → Shortcuts. - Sway / i3: configure in
~/.config/sway/config. - Hyprland: configure in
~/.config/hypr/hyprland.conf.
The core idea (swap Alt and Ctrl via XKB, then bind the system switcher to the new Ctrl position) translates to any environment, but the files here are GNOME-specific.
This repo also includes a Windows-compatible layer in the windows/ directory:
windows/keyboard-macos.ahk— AutoHotkey v2 script that remapsAlt+C/V/X,Alt+1..9,Caps Lock -> Shift, andCtrl+Tab -> Alt+Tab.windows/windows-terminal-shortcuts.json— Windows Terminal keybindings soAlt+1..9switches WSL tabs.windows/README.md— full Windows/WSL installation instructions.
Because WSL receives keyboard input from Windows, running the AutoHotkey script on the Windows host makes the same shortcuts work in WSL terminals and GUI apps. See windows/README.md for details.
Run the revert script to restore the backed-up settings, GNOME dock shortcuts, IBus triggers, Ptyxis defaults, and the WezTerm keys.lua from git:
./revert.shThen log out and back in.
Alt + SpacerequiresControl + Spaceto be free. The apply script clears the IBus input-method triggers. If you type in multiple languages, re-enable IBus in Settings → Keyboard and pick a different launcher shortcut.Super + 1..4replaces the default GNOME dock app launchers. If you want those back, remove the workspace bindings or reassign them to different keys.- This setup assumes a US English layout (
us). Other layouts may need adjusted XKB options.
configs/
gnome-input-sources.dconf # xkb options: Alt/Ctrl swap, Caps Lock as additional Shift
gnome-media-keys.dconf # custom shortcuts (terminal, editor, browser, screenshot, search)
gnome-wm-keybindings.dconf # window manager shortcuts (switcher, close, maximize, etc.)
gnome-shell-keybindings.dconf # workspace and dock shortcuts
ptyxis.dconf # terminal tab-switching config (numbered tabs)
firefox-user.js # Firefox accelerator key tweak
wezterm-tab-switching.patch # WezTerm Ctrl+number / Ctrl+bracket / Ctrl+PageUp tab bindings
keyd.conf # Linux keyd config for Alt+[ / Alt+] previous/next tab
windows/
keyboard-macos.ahk # AutoHotkey v2 script for Windows/WSL
windows-terminal-shortcuts.json # Windows Terminal tab-switching keybindings
README.md # Windows/WSL setup guide
apply.sh # Apply all settings (Linux)
revert.sh # Restore previous settings (Linux)
MIT — feel free to adapt this for your own setup.