(This answer is about xmodmap only. I'm sure it's possible to do this with XKB, I just don't know how.)
Modifiers and keysyms are assigned independently. But you get strange effects if you don't set them consistently. I think all you're missing is the add
command to assign a modifier to Meta_L
, though you may also need to clear and reassign the modifier keys. You may replace Mod1
and Mod2
by Mod3
, Mod4
and Mod5
: they are interchangeable, just make sure you don't use one for two different purposes.
clear Mod1
clear Mod2
remove Lock = Caps_Lock
keysym Caps_Lock = Alt_L
keysym Alt_L = Meta_L
add Mod1 = Alt_L Alt_R
add Mod2 = Meta_L Meta_R
I have the same issue. From the doc, one could guess that the correct syntax would be something like that :
$ setxkbmap -I$HOME/.config/xkb -option mine:accent
Note : ~
doesn't work with the -I
option
with
~/.config/xkb/symbols/azerty_altgr
partial default
xkb_symbols "accent" {
include "level3(ralt_switch)"
key <AE02> { [ NoSymbol, NoSymbol, eacute, NoSymbol ] };
key <AE07> { [ NoSymbol, NoSymbol, egrave, NoSymbol ] };
key <AE09> { [ NoSymbol, NoSymbol, asciicircum, NoSymbol ] };
key <AE10> { [ NoSymbol, NoSymbol, agrave, NoSymbol ] };
};
or whatever symbole file you have and
~/.config/xkb/rules/evdev
! option = symbols
mine:accent = +azerty_altgr(accent)
Unfortunately, it doesn't work.
The only solution I found is the following :
Use the same files described above. Set all native option using setxkbmap -option caps:swapescape,whatever
. Then :
$ setxkbmap -print > tempfile.txt
and edit tempfile.txt
in order to add your custom option in the xkb_symbols
line :
xkb_keymap {
xkb_keycodes { include "evdev+aliases(qwerty)" };
xkb_types { include "complete" };
xkb_compat { include "complete" };
xkb_symbols { include "pc+us+fr:2+inet(evdev)+capslock(swapescape)+azerty_altgr(accent)" };
xkb_geometry { include "pc(pc104)" };
};
and finaly :
xkbcomp -I$HOME/.config/xkb tempfile.txt $DISPLAY
It can be generalised for any number of options.
This solution is deprecated according to Archlinux wiki.
Best Answer
Not sure if it helps (as not purely in
setxkbmap
), but:Change back:
You can check with something like:
to get keycodes.