Key Remapping - LeandroTheDev/arch_linux GitHub Wiki
- vim /usr/share/X11/xkb/symbols/yourkeyboard
xkb_symbols "abnt2" {
// This is the base keyboard laguage from reference
include "latin"
// The name of the keyboard to be show in kde
name[Group1]="Portuguese (Brazil)";
// Overwriting upper keys in the top of the keyboard
key <TLDE> { [ apostrophe, quotedbl, notsign, notsign ] };
key <AE02> { [ 2, at, twosuperior, onehalf ] };
key <AE03> { [ 3, numbersign, threesuperior, threequarters ] };
key <AE04> { [ 4, dollar, sterling, onequarter ] };
key <AE05> { [ 5, percent, cent, threeeighths ] };
key <AE06> { [ 6, dead_diaeresis, notsign, diaeresis ] };
key <AE12> { [ equal, plus, section, dead_ogonek ] };
// Overwriting QWE
key <AD01> { [ q, Q, slash, slash ] };
key <AD02> { [ w, W, question, question ] };
key <AD03> { [ e, E, degree, degree ] };
key <AD04> { [ r, R, registered, registered ] };
key <AD11> { [ dead_acute, dead_grave, acute, grave ] };
key <AD12> { [ bracketleft, braceleft, ordfeminine, dead_macron ] };
key <BKSL> { [ bracketright, braceright, masculine, masculine ] };
// Overwriting ASD
key <AC10> { [ ccedilla, Ccedilla, dead_acute,dead_doubleacute ] };
key <AC11> { [ dead_tilde,dead_circumflex, asciitilde, asciicircum ] };
key <AC01> { [ a, A, backslash, backslash ] };
key <AC02> { [ s, S, bar, bar ] };
// Overwriting ZXC
key <LSGT> { [ backslash, bar, dead_caron, dead_breve ] };
key <AB03> { [ c, C, copyright, copyright ] };
key <AB07> { [ m, M, mu, mu ] };
key <AB10> { [ semicolon, colon, dead_belowdot, dead_abovedot ] };
// Additional key from the right side of the left shift
key <AB11> { [ slash, question, degree, questiondown ] };
include "kpdl(comma)"
include "level3(ralt_switch)"
};
AE01-AE10
AD01-AD12
AC01-AC12
AB01-AB12
- Download
hawck-git
auracle
Workaround for some bugs
- sudo setfacl -m 'g:uinput:rw' /dev/uinput
Enabling hawck
- sudo systemctl enable hawck-inputd
- sudo systemctl start hawck-inputd
I dont know, the docs is not clear enough
- hawck-macrod
Create your remapping
- vim ~/.config/hawck/scripts/example.hwk
-- Pressing C-a should insert the character "b"
down + ctrl + key "a" => insert "b"
Instanciating it to hawck
- hawck-add ~/.config/hawck/scripts/example.hwk
To enable it
- chmod +x ~/.config/hawck/scripts/example.hwk
To disable it
- chmod -x ~/.config/hawck/scripts/example.hwk