Before updating to 26.04.1 I had modified .xmodmap to give me grave accents on the vowels in my dvorak keyboard layout. This no longer works now that I have gone to Ubuntu Studio 26.04.1, I presume because it uses Wayland instead of X11. I have searched for a way to easily modify the keyboard layout, but in vain.
I did try the input-remapper package, but couldn’t work out how to get the accents over the letters. Does anyone have a simple solution for me?
Wayland compositors are usually using the same XKB keyboard layout library and definitions as X11 server/clients. Both library and configuration format are very flexible and allow easy customization, also user specific.
This blog post from the author describes it. Here is another blog post describing exactly your problem - switching from xmodmap to the native Wayland layout definition.
If you have questions about implementing it, show your current keyboard layouts and earlier Xmodmap content.
Thanks for the reply. I did find the second of those links, but it looked pretty complicated to follow; but I’ll go back and have another look and see if I can understand it. My current keyboard layout is Dvorak (English UK, dvorak with UK punctuation) and the bit of .Xmodmap that I edited reads
keycode 38 = a A a A agrave NoSymbol agrave
keycode 39 = o O o O ograve NoSymbol ograve
keycode 40 = e E e E egrave NoSymbol egrave
keycode 41 = u U u U ugrave NoSymbol ugrave
keycode 42 = i I i I igrave NoSymbol igrave
so that the Level 3 Shift key always produced vowels with grave accents.
I am confused. The Level 3 is the third column. The accented characters in your case would be produced by the Level 5 and Level 7 (actually, Level 5 + Level 3 normally) shifts.
The key immediately to the right of the space bar (labelled Level 3 Shift on my keyboard map) and the relevant vowel key. With my previous setup that produced à etc, but now it gives me à,ô,é,û,î - so they are all wrong apart from the à.
That sounds like what I need, but in your rules file, the key codes, the letters/numbers seem pretty random - not sure where to check them, but in my dvorak layout the vowels are the first five keys in the middle row. I have created these files, but the layout is not showing up for me in the keyboard options. Will try rebooting to see if it picks them up.
xkb_symbols "dvorakukpa" {
include "gb(dvorakukp)"
name[Group1]="English (UK, Dvorak, with UK punctuation and accented characters)";
key <AC01> { [ a, A, agrave, agrave ] };
key <AC02> { [ o, O, ograve, ograve ] };
key <AC03> { [ e, E, egrave, egrave ] };
key <AC04> { [ u, U, ugrave, ugrave ] };
key <AC05> { [ i, I, igrave, igrave ] };
};
No, it’s not showing up as an option. I have created .config/xkb/symbols/gb
cat .config/xkb/symbols/gb
include "gb(dvorakukp)"
name[Group1]="English (UK, Dvorak, with UK punctuation and accented characters)";
key <AC01> { [ a, A, agrave, agrave ] };
key <AC02> { [ o, O, ograve, ograve ] };
key <AC03> { [ e, E, egrave, egrave ] };
key <AC04> { [ u, U, ugrave, ugrave ] };
key <AC05> { [ i, I, igrave, igrave ] };
};
and created .config/xkb/rules/evdev.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xkbConfigRegistry SYSTEM "xkb.dtd">
<xkbConfigRegistry version="1.1">
<layoutList>
<layout>
<configItem>
<name>gb</name>
</configItem>
<variantList>
<variant>
<configItem>
<name>dvorakukpa</name>
<shortDescription>dvorakukpa</shortDescription>
<description>English (UK, Dvorak, with UK punctuation and accented characters)</description>
</configItem>
</variant>
</variantList>
</layout>
</layoutList>
</xkbConfigRegistry>
~>
So that looks ok to me - but it’s not appearing in the English(UK) list for me.
Why they belong to root? They are supposed to be in your home directory and of course belong to you (although I do not think it matters). Where are these files located?
The good news is that it is now showing up in the list. The bad news is that when I try to see the layout I get this error message.
Keycodes above 256 (e.g. <I256>) are not supported by X and are ignored
Error: No Symbols named "dvorakukpa" in the include file "gb"
Exiting
Abandoning symbols file "(null)"
and it reverts to the original layout.
So near and yet …. but I really appreciate all the help you are giving. Thank you for your time and trouble.