Why does X loses my keyboard key mapping?

Petter Adsen petter at nillabs.com
Wed Aug 2 07:08:16 UTC 2017


On 02/08/17 01:30, Rick wrote:
> Hi,
> 
> On my 16.04, I re-map some keyboard keys at login using "xmodmap
> /home/rick/.Xmodmap" in a shell script. I rarely log out and usually,
> sometime after 24 hours the system re-maps the keyboard back to its
> default key settings. Would anyone have any idea what would cause X to
> do this?

This is because xmodmap is now obsolete, replaced by the XKB tools.
xmodmap is no longer guaranteed to work correctly, and any modifications
made with it will be overwritten the next time an XKB tool runs.

Look into using setxkbmap and xkbcomp instead.

https://unix.stackexchange.com/questions/65507/use-setxkbmap-to-swap-the-left-shift-and-left-control/65600
http://www.pixelbeat.org/docs/xkb_remap/

Petter




More information about the ubuntu-users mailing list