There's already a definition for that in xkeyboard-config. You can add it to your keymap by setting the altwin:alt_win
option.
Using setxkbmap
:
setxkbmap -option altwin:alt_win [...]
Or in xorg.conf
:
Section "InputClass" Identifier "keyboard-all" MatchIsKeyboard "on" Driver "evdev" Option "XkbOptions" "altwin:alt_win" EndSection
Or you can modify the keymap manually using xmodmap
:
keycode 133 = Alt_L keycode 134 = Alt_R