Kubuntu English keyboard layout with Serbian special letters right Alt variant.
Made and tested in Kubuntu 24.04. But I think it will work in Ubuntu too. At least the layout structure is the same there.
It's just better to manually insert new variants and make backups of course.
Also, in case of failure, for example, if you do not register a new variant,
the keyboard may partially not work after reboot.
You can use the on-screen keyboard and return, correct or restore the backup.
New versions of the layout and registration files can be replaced completely, or existing ones can be edited.
You can change the default layout settings manually:
- You need to add a new variant to the US layout file /usr/share/X11/xkb/symbols/us

- You need to register the new variant in /usr/share/X11/xkb/rules/evdev.xml

- Reboot, and then choose a new variant of layout in the keyboard settengs "English with Serbian latin ralt(US, us_rs)"
Now you can enter special characters of the Serbian alphabet by holding down the right Alt key:
Z -> Ž
X -> Ć
C -> Č
N -> Nj
S -> Š
D -> Đ
F -> Dž
L -> Lj