Skip to content

Instantly share code, notes, and snippets.

@legndery
Created February 18, 2022 15:58
Show Gist options
  • Save legndery/eecfc6e755b202599f4c3a6544976d0d to your computer and use it in GitHub Desktop.
Save legndery/eecfc6e755b202599f4c3a6544976d0d to your computer and use it in GitHub Desktop.
Remap ALT->CTRL, CTRL->CTRL, WIN->ALT. The most common mac XKBOPTIONS
///////////////////////////////////////////
// /usr/share/X11/xkb/symbols/altwin //
///////////////////////////////////////////
// Ctrl is mapped to the Alt, Alt to the Super, and Win to the Ctrl keys.
// partial modifier_keys
// xkb_symbols "ctrl_alt_win" {
// key <LALT> { [ Control_L, Control_L ] };
// key <RALT> { type[Group1] = "TWO_LEVEL",
// symbols[Group1] = [ Control_R, Control_R ] };
// key <LWIN> { [ Alt_L, Meta_L ] };
// key <RWIN> { [ Alt_R, Meta_R ] };
// key <LCTL> { [ Super_L ] };
// key <RCTL> { [ Super_R ] };
// modifier_map Control { <RALT>, <LALT> };
// modifier_map Mod1 { <LWIN>, <RWIN> };
// modifier_map Mod4 { <LCTL>, <RCTL> };
// };
// Ctrl is mapped to the Alt, Alt to the Super, and Win to the Ctrl keys.
partial modifier_keys
xkb_symbols "ctrl_alt_win" {
key <LALT> { [ Control_L, Control_L ] };
key <RALT> { type[Group1] = "TWO_LEVEL",
symbols[Group1] = [ Control_R, Control_R ] };
key <LWIN> { [ Alt_L, Meta_L ] };
key <RWIN> { [ Alt_R, Meta_R ] };
// key <LCTL> { [ Super_L ] };
// key <RCTL> { [ Super_R ] };
modifier_map Control { <RALT>, <LALT> };
modifier_map Mod1 { <LWIN>, <RWIN> };
// modifier_map Mod4 { <LCTL>, <RCTL> };
};
@legndery
Copy link
Author

Change in /etc/defaults/keyboard

XKBOPTIONS="altwin:ctrl_alt_win"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment