Skip to content

[Feature request] Keyboard layout autodetection #86

Description

@jruelle23

I think it'd be nice to have, alongside this recently merged PR, an autodetection feature when the configuration for the keyboard is empty:

[keyboard]
# Keep unset for autodetection
# layout = ...

There are multiple ways of doing that detection, and the tricky part can be in which priority order we want them to occur, my first draft would be:

  1. Checking the env var XKB_DEFAULT_LAYOUT (depends on the desktop env installed if there is one at all)
  2. Checking with localectl status (systemd dependent)
  3. Guessing with the env var LANG result
  4. Fallback to "us" if none works or an unexpected error happens.

I don't know if there are better solutions and I hesitate between 1. and 2. for the priority order.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions