Results 1 to 2 of 2

Thread: Persistent remapping of keys with setxkbmap or Xorg configuration

  1. #1
    Join Date
    Jan 2017
    Beans
    7

    Question Persistent remapping of keys with setxkbmap or Xorg configuration

    This didn't seem to be getting much attention in the Desktop Environment subforum, so I figured I would post it here. I have been wracking my brain over the past week or so with what should be a straight forward problem. I want to *permanently* swap the CapsLock and Ctrl keys on my laptop. I emphasise the permanently because I know how to do this on an ad hoc basis easily from the command line with a minor tweak to the keyboard map:

    Code:
    setxkbmap -option ctrl:swapcaps
    The problem with this is I have to execute it every time I boot up, wake from sleep/hibernate, or connect a USB keyboard. This quickly gets annoying, and this really feels like something that should be persistently set on a per user basis.

    After extensive Google searching and on this forum, I have drawn up the following dead ends:

    1. Setting a "Startup Application" with the appropriate command works for initial login, but then the keyboard gets reset upon sleep/hibernate and USB keyboard connection. This is the solution I see posted everywhere, but its not really a solution. Example: https://ubuntuforums.org/showthread....t=keyboard+map
    2. I dove into X11/Xorg configuration. Creating any version of .x<something> in my home directory has no efffect (e.g. ~/.xinitrc, ~/.Xkbmap, ~/.Xmodmap, ~/.profile)
    3. Tried placing a script in /etc/X11/xorg.conf.d/ but that has no effect either.
    4. I don't have a /etc/X11/xorg.conf file present and I don't particularly want to generate one. Also, I would rather not make a setting that is universal across users and not portable across devices.
    5. It seems like the above doesn't work because of gdm3 taking over the Xsession generation and possibly some involvement of Wayland (although I have confirmed my user session is X11 and not Wayland). I looked at the file /etc/gdm3/Xsession and confirmed that it does source the ~/.x<something> files, but then those settings must get overwritten at some point.


    Does anyone have any insight through this swamp? It seems like the desktop/display manager situation for Ubuntu is an absolute mess with no definitive documentation.

    My system:
    Code:
    5.3.0-28-generic #30~18.04.1-Ubuntu SMP Fri Jan 17 06:14:09 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

  2. #2
    Join Date
    Jul 2008
    Location
    The Left Coast of the USA
    Beans
    Hidden!
    Distro
    Kubuntu

    Re: Persistent remapping of keys with setxkbmap or Xorg configuration

    Duplicate closed.
    Please read The Forum Rules and The Forum Posting Guidelines

    A thing discovered and kept to oneself must be discovered time and again by others. A thing discovered and shared with others need be discovered only the once.
    This universe is crazy. I'm going back to my own.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •