Skip to content

Instantly share code, notes, and snippets.

@felipsmartins
Last active June 16, 2023 19:03
Show Gist options
  • Save felipsmartins/96a77a563048503f864216dd0eae8f11 to your computer and use it in GitHub Desktop.
Save felipsmartins/96a77a563048503f864216dd0eae8f11 to your computer and use it in GitHub Desktop.
AKKO ABNT2 remap keys (GNOME)
# keycode 105: tecla ctrl direito
# keycode 108: tecla alt direito (AKA AltGr)
# os comandos abaixo transforma seu "AltGr" em ";" e o "Ctrl direito" em ":"
xmodmap -e "keycode 105 = colon"
xmodmap -e "keycode 108 = semicolon"
# Ou imprimir:
# ";" quando <Ctrl direito> for pressionado
# ":" quando <Ctrl direito> + <Shift> for pressionado
xmodmap -e "keycode 105 = semicolon colon"
# xmodmap -verbose ~/.xmodmaprc
keycode 105 = semicolon colon
# OU
# Desktop Entry (~/.config/autostart/my-xmodmap.desktop)
[Desktop Entry]
Type=Application
Name=AKKO ABNT2 keyboard
Comment=Modificador para teclado AKKO ABNT2
Terminal=false
Exec=xmodmap -e "keycode 105 = semicolon colon"
Icon=/usr/share/icons/Adwaita/scalable/devices/input-keyboard-symbolic.svg
# caso queira reverter o efeito do xmodmap:
setxkbmap -layout br
# "br" é o ABNT2 lauoyt
# ==============================
# se tentar mapear via setkeyscode isso nao vai funcionar para teclados USB:
# https://bugzilla.redhat.com/show_bug.cgi?id=211803
# "USB keyboards have standardized keycodes and setkeycodes doesn't affect them at all."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment