Skip to content

Instantly share code, notes, and snippets.

@ansrivas
Last active August 4, 2020 23:20
Show Gist options
  • Save ansrivas/c55943dd43e7bcbc0b4f1df55bca8711 to your computer and use it in GitHub Desktop.
Save ansrivas/c55943dd43e7bcbc0b4f1df55bca8711 to your computer and use it in GitHub Desktop.
update key mapping

use xenv to capture the keys which you want to replace

  • Get original key mapping using xmodmap -pke > ~/keymaptable
$ cat ~/.Xmodmap
! -*- coding: utf-8 -*-
! swapped 49 with 94
keycode  94 = grave asciitilde dead_circumflex degree U2032 U2033 grave asciitilde
keycode  49 = less greater less greater bar brokenbar bar dead_belowmacron

Reload after applying the config xmodmap ~/.Xmodmap

Create this file to make sure its read when x11 starts

$ cat  ~/.xinitrc
if [ -s ~/.Xmodmap ]; then
    xmodmap ~/.Xmodmap
fi

create file

cat ~/.xinitrc
xmodmap .Xmodmap
cat ~/.Xmodmap
clear control
keycode 94 = Control_R
keycode 37 = Control_L
keycode 105 = Control_L
add control = Control_L Control_R
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment