I followed these instructions.
The command xmodmap -pke >~/.Xmodmap correctly creates the file .Xmodmap. I find the line for x (keykote 53) and replace it with "keycode 53 = x X x X c C c C c C". Expekted behavior: altgr+x = c, altgr+shift+x = C.
I duplicate .Xmodmap ant rename the duplicate .xinitrc. I replaced the contents with the text xmodmap .Xmodmap. Then I ran xmodmap .Xmodmap.
Observed behavior: Altgr + x = », Altgr + Shift + x = >.
The exercise seems to have had no effect.
(I would have put this as a comment on that answer, but I'm not allowed to.)
System info:
Ubuntu 22.04.5, 64-bit
GNOME version: 42.9
Windowing system: Wayland
Model: HP laptop 14-dk0xxx