For some reason it works if you -print
and pipe the output to xkbcomp
:
setxkbmap \
-I ~/.config/xkb/ \
-rules evdev-local \
-layout "my-us(mdvp)" \
-print |
xkbcomp -I ~/.config/xkb/ - "$DISPLAY"
I don’t think there is anything wrong with your layout. I tried setting
it up with setxkbmap
directly, but even with the -verbose
option the
output is not helpful:
Warning! Multiple definitions of rules file
Using command line, ignoring X server
Warning! Multiple definitions of keyboard layout
Using command line, ignoring X server
Trying to build keymap using the following components:
keycodes: evdev+aliases(qwerty)
types: complete
compat: complete
symbols: pc+my-us(mdvp)+inet(evdev)+terminate(ctrl_alt_bksp)
geometry: pc(pc104)
Error loading new keyboard description
This is with the default verbose level. But even if I set it to 10,
which is apparently the max level, it just outputs “locale is C” as well
as where it tries to look for the rules file, in addition to the above.
It does not output anything more about why it fails to load the keyboard
description.
One of the reasons why I prefer to pipe to xkbcomp
instead of just
using setxkbmap
is because the former seems to give better error
messages.
Best Answer
Three useful commands:
1. Get the current keyboard layout, from this topic :
Returns layout(variant) where variant is optional
2. Know if the current keyboard layout is layout(variant):
Or without "(variant)".
Returns nothing is not.
3. Set the keyboard layout to a specified value:
Where variant is optional.
(see
man setxkbmap
for more informations)What you can do:
1. Create a simple executable (
chmod +x file
) script that changes the keyboard layout on the fly, depending on the current one. For instance, if we deal with the first point:2. With your keyboard shortcuts manager, assign the
Shift-CapsLock
keys to this script.Good luck!