My keyboard is not programmer friendly so I want to manually change how some keys work:
Alt gr + z should produce |
not «
Alt gr + x should produce <
not »
Alt gr + c should produce >
not ¢
How would I go about doing that?
$ setxkbmap -query
rules: evdev
model: pc105
layout: is,us
variant: ,
The best way is a quite difficult way: editing the keyboard layout files. The link refers to the Ubuntu documentation. Although the edit itself would be minimal to do what you want, how to find the keys and where to edit is more tricky to get your head around. Still, a little specific help with the one of the edits:
The keycode for z is 52 on my system as seen using the
xev
tool. As indicated in the file /usr/share/X11/xkb/keycodes/evdev, that corresponds with the scancode<AB01>
. Locate that key in your keyboard layout file, e.g. for me,/usr/share/X11/xkb/symbols
, and adapt the third field, which stands for the combination with AltGr:becomes
bar
is also found fromxev
, or can be found in/usr/include/X11/keysymdef.h