Add environment overrides API function #138
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes
Add a dict and function to support user injected overrides to manually specify the environment from config.
Naming emphasizes to the user that the use of the API will short-circuit (override) any auto-detection features the keymapper may implement or have available. If anything is pushed from config via the function, other areas will be designed to accept these pushed values as taking precedence over the detection algorithms.
The only good reason to use the API is if the detection algorithms fail, such as if the user is in a customized environment where common sources of information such as /etc/os-release or
XDG_SESSION_DESKTOP
are unavailable, empty or incorrectly populated with unusual values, but the user is sure that the environment is compatible with keyszer.Nothing in current main is designed to use this information, but Wayland support will require it. This will be the bypass to get keyszer working if the environment detection algorithm fails for any reason. Might be required if the user is using a system-level systemd service file running as another user, and the environment is Wayland.