I want to create a custom keyboard layout based on my German keyboard layout (de
).
The idea is to have a two-group layout and have the Caps-Lock to be the Mode_switch
key. That remap seems to work according to xev
.
However, the second group layout does not work.
When I press [CAPS]+[H] --> "h" occurs ("`" expected).
Here is my symbols file called de_ext
:
default
xkb_symbols "basic" {
include "de"
name[Group1]="de";
name[Group2]="de2";
// the H button should become accent grave when in second group
override key <AC06> {
type[Group2]="ALPHABETIC",
symbols[Group2]= [ grave, grave ]
};
override key <CAPS> { [ Mode_switch, Caps_Lock ] };
};
Edit 1:
@quixotic is right, this actually works when set directly. I also tried copying the de_ext
file to /usr/share/X11/xkb/
and then running setxkbmap de_ext
which also works.
However, it does not work when adding the layout to /usr/share/X11/xkb/rules/evdev.xml
with
<layout>
<configItem>
<name>de_ext</name>
<shortDescription>xy</shortDescription>
<description>German extended</description>
<languageList>
<iso639Id>ger</iso639Id>
</languageList>
</configItem>
</layout>
Although the new layout appears in my layout selection on my Ubuntu 17.04 taskbar, when I select it, the CAPS-Lock button has a different behavior as explained above. What works is that CAPS-Lock is the Mode_switch (I checked with xev
), however, the second group doesn't seem to be selected because when pressing [CAPS]+[H] it doesn't work. Any idea what the difference could be when using the Ubuntu/Gnome Layout Switcher?
Edit 2:
When calling xkbcomp $DISPLAY broken.xkb
, these are the things I noticed:
- The name of my xkb_symbols is:
xkb_symbols "pc+prg+de:2+us:3+inet(evdev)"
My Layout has three groups instead of two (I noticed that even my default German layout gets two layouts although only one is defined in
symbols/de
)name[group1]="German"; name[group2]="German"; name[group3]="English (US)";
Almost all keys get three groups / layouts, whereas the second is the same as the first and the third one is an English keyboard layout. My own changes to the letters are not included.
key <AC01> { type[group1]= "FOUR_LEVEL_ALPHABETIC", type[group2]= "FOUR_LEVEL_ALPHABETIC", type[group3]= "ALPHABETIC", symbols[Group1]= [ a, A, ae, AE ], symbols[Group2]= [ a, A, ae, AE ], symbols[Group3]= [ a, A ] };
Here is what I get for the letter H
key <AC06> { type[group1]= "FOUR_LEVEL_ALPHABETIC", type[group2]= "ALPHABETIC", type[group3]= "ALPHABETIC", symbols[Group1]= [ h, H, hstroke, Hstroke ], symbols[Group2]= [ h, H ], symbols[Group3]= [ h, H ] };
My change for the Caps-Lock button is included without modifications
What I assume: there must be some rule in the default (ubuntu?) xkb configuration which modifies all symbols to include additional layouts as an additional group. Is there any way I can stop that rule for my xkb symbol to fire?
setxkbmap -layout de -option -print > foo.xkb
, editfoo.xkb
and add these mods to thexkb_symbols
section, then load withxkbcomp foo.xkb $DISPLAY
). how are you loading these symbols? are you sure there's no option set that's conflicting? (clear withsetxkbmap -option
to be sure.)xkbcomp $DISPLAY working.xkb
... when not:xkbcomp $DISPLAY broken.xkb
... then compare the two to see what's different.i3wm
oropenbox
or another gnome-less environment for testing.