1

I am using "Ubuntu Xorg" inside of Ubuntu 21.10, cause on normal Ubuntu it was not possible for me to set up xmodmap inside of gnome applications (e.g. Firefox, LibreOffice, Terminal). My aim with xmodmap is to reconfigure the keys "AltGr" + "y" and "AltGr" + "x". And I don't found some other applications inside of Linux to do that.

My wish now is to fix the settings on login. So I worked all the solutions from this post, but nothing helps. This solutions are working inside of the other Ubuntu configuration, but not inside of Ubunto Xorg. How can I set xmodmap on autostart inside of Ubuntu Xorg?

  • 1
    gnome-shell and the internationalization keyboard selector step on xmodmap, so even if you do get it working on startup, it gets reset by other things. – user10489 Feb 06 '22 at 16:51
  • The correct solution is to use xkb instead of xmodmap, but it's not as easy. xmodmap is all but obsolete due to internationalization changes. – user10489 Oct 20 '22 at 01:55

1 Answers1

1

You could try to add this to your shell start profile for example. It should work if you've set a terminal as a startup application. However, it might slowdown subsequent terminals. But probably only on first launch. You will need to modify this to check for what your particular remap value will return.

# ~/.zshrc
mysetting=$(xmodmap -pke | grep 135)
if [ $mysetting != 'keycode 135 = Control_R NoSymbol Control_R' ]; then
  sleep 4 && xmodmap ~/.Xmodmap &
fi

lacostenycoder
  • 398
  • 1
  • 4
  • 14