Ctrl K

i3 Alt Mod Key on Arch

Switch i3 from the Super key to the Alt key on Arch by changing the i3 mod setting, fixing the X modifier map, loading Xmodmap from i3, and verifying the setup after reboot.

Switch i3 from Super to Alt on Arch. This workflow changes i3 from Mod4 to Mod1, fixes the X modifier map so Alt_L belongs to mod1, keeps Super_L under mod4, loads the mapping automatically when i3 starts, and verifies the setup after reboot.

Target state

Use Alt as the i3 modifier key instead of Super. In i3, Mod1 maps to Alt and Mod4 maps to Super. The final setup should keep Alt_L under mod1 and Super_L under mod4.

set $mod Mod1
  • Mod1 is the Alt modifier group.
  • Mod4 is the Super or Windows key modifier group.
  • i3 reads $mod from ~/.config/i3/config.
  • X11 decides which physical keys belong to mod1 and mod4.
  • Changing only the i3 config is not enough if Alt_L is still mapped under mod4.

Check the current i3 mod setting

Open the i3 config and check the active mod line.

grep -n "set \$mod" ~/.config/i3/config

A Super based setup usually shows Mod4.

set $mod Mod4

An Alt based setup should use Mod1.

set $mod Mod1

Change i3 from Super to Alt

Edit the i3 config and change the mod line from Mod4 to Mod1.

nano ~/.config/i3/config

Use this line:

set $mod Mod1
  • Do not replace all keybindings manually if they already use $mod.
  • Bindings such as $mod+Return, $mod+d, and $mod+Shift+r will automatically move from Super to Alt.
  • Only hardcoded Mod4 bindings need to be changed manually.

Check for hardcoded Super bindings

Search for direct Mod4, Super_L, Mod1, or Alt_L references. A clean config should mostly use $mod instead of hardcoded Mod4.

grep -n "Mod4\|Super_L\|Mod1\|Alt_L" ~/.config/i3/config
  • The expected required line is set $mod Mod1.
  • Replace hardcoded Mod4 keybindings with $mod unless there is a specific reason to keep Super for that shortcut.
  • Do not remove normal $mod bindings.

Check the X modifier map

Check which physical keys X11 currently assigns to each modifier group.

xmodmap -pm

A broken mixed state can look like this. In this state, i3 listens to Mod1, but the physical left Alt key is still under mod4.

mod1        Alt_R, Meta_L
mod4        Alt_L, Super_L, Super_R

The correct state should look like this.

mod1        Alt_L, Alt_R, Meta_L
mod4        Super_L, Super_R
  • Alt_L must be under mod1.
  • Super_L should stay under mod4.
  • If Alt_L is under mod4, Alt based i3 shortcuts will not work correctly.

Create the Xmodmap fix

Create ~/.Xmodmap to move Alt_L and Alt_R to mod1 and keep Super_L and Super_R under mod4.

cat > ~/.Xmodmap <<'EOF'
clear mod1
clear mod4

add mod1 = Alt_L Alt_R Meta_L
add mod4 = Super_L Super_R
EOF

Apply the mapping immediately.

xmodmap ~/.Xmodmap

Verify the result.

xmodmap -pm
  • Alt_L should now appear under mod1.
  • Super_L should now appear under mod4.
  • Seeing Alt_L twice is usually harmless if the key works and Alt_L is under mod1.

Load Xmodmap from i3

Add the Xmodmap load command to the i3 config so the mapping is applied automatically when i3 starts.

nano ~/.config/i3/config

Add this line near the other startup commands.

exec --no-startup-id xmodmap ~/.Xmodmap
  • This applies the Alt and Super modifier mapping when i3 starts.
  • The mapping is applied after login, not on the display manager login screen.
  • This is enough for i3 keyboard shortcuts after login.

Reload and restart i3

Reload the config first. If the shortcut is not working yet, run the command from an existing terminal.

i3-msg reload
i3-msg restart

Test the common i3 shortcuts with Alt.

ShortcutExpected action
Alt+EnterOpen terminal
Alt+dOpen the configured launcher if bound
Alt+SpaceOpen Rofi app launcher if this setup uses Mod+Space
Alt+TabOpen Rofi window switcher if this setup uses Mod+Tab
Alt+Shift+rReload i3 config

Disable Firefox Alt menu focus

When i3 uses Left Alt as the Mod1 key, Firefox can still capture a plain Alt press and show or focus the top menu bar. Disable this inside Firefox so Alt based i3 shortcuts do not visually trigger the Firefox menu.

Open Firefox and go to about:config. Search for this preference and set it to false.

ui.key.menuAccessKeyFocuses = false

If Alt combinations still interfere with Firefox menu access, also search for this preference and set it to 0.

ui.key.menuAccessKey = 0
  • This is a Firefox specific setting.
  • It does not change the i3 config.
  • It prevents Firefox from showing or focusing the top menu when Left Alt is used as the i3 modifier key.
  • Restart Firefox after changing the preferences.

Verify after reboot

Reboot and verify that the modifier map survives a fresh login.

xmodmap -pm

The important lines should show Alt under mod1 and Super under mod4.

mod1        Alt_L, Alt_R, Meta_L
mod4        Super_L, Super_R
  • If Alt_L is under mod1 after reboot, the setup is persistent.
  • If Alt_L returns to mod4 after reboot, check that the xmodmap startup line exists in ~/.config/i3/config.
  • If the i3 shortcuts still do not work, check whether the keybindings use $mod or hardcoded Mod4.

Final config summary

The final setup has one i3 config change and one Xmodmap file.

grep -n "set \$mod\|xmodmap\|Xmodmap" ~/.config/i3/config

Expected i3 config lines:

set $mod Mod1
exec --no-startup-id xmodmap ~/.Xmodmap

Expected ~/.Xmodmap content:

clear mod1
clear mod4

add mod1 = Alt_L Alt_R Meta_L
add mod4 = Super_L Super_R

Debug commands

grep -n "set \$mod" ~/.config/i3/config

grep -n "Mod4\|Super_L\|Mod1\|Alt_L" ~/.config/i3/config

grep -n "xmodmap\|Xmodmap" ~/.config/i3/config

cat ~/.Xmodmap

xmodmap -pm

xev
  • Use grep on set $mod to confirm i3 is using Mod1.
  • Use the Mod4 and Alt search to find hardcoded keybindings.
  • Use the xmodmap search to confirm i3 loads ~/.Xmodmap.
  • Use cat ~/.Xmodmap to confirm the saved mapping file.
  • Use xmodmap -pm to confirm the live modifier state.
  • Use xev if the physical key does not report as Alt_L.

Config file locations

  • i3 window manager config: ~/.config/i3/config
  • X modifier mapping file: ~/.Xmodmap
  • The i3 mod line controls which modifier group i3 uses.
  • The Xmodmap file controls which physical keys belong to mod1 and mod4.
  • Use Mod1 for Alt based i3 shortcuts.
  • Use Mod4 for Super based i3 shortcuts.

Resources