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:
- Checking the env var XKB_DEFAULT_LAYOUT (depends on the desktop env installed if there is one at all)
- Checking with localectl status (systemd dependent)
- Guessing with the env var LANG result
- 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.
I think it'd be nice to have, alongside this recently merged PR, an autodetection feature when the configuration for the keyboard is empty:
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:
I don't know if there are better solutions and I hesitate between 1. and 2. for the priority order.