joshgoebel / keyszer

a smart, flexible keymapper for X11 (a fork/reboot of xkeysnail )
Other
69 stars 15 forks source link

Add environment overrides API function #138

Closed RedBearAK closed 1 year ago

RedBearAK commented 1 year ago

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.

RedBearAK commented 1 year ago

Superceded by PR #157