Add support for Gnome 45, which breaks backward extension
compatibility. We now ship and maintain two extensions :/.
The main change in Gnome seems to be the switch from a custom
import implementation to 'standard' ES6 style imports.
The init method also seems to have inexplicably
been swapped out in favour of extending a magic
class.
This patch takes the opportunity to clean up some residual cruft
and move the extension code out of the mapper script.
Specifically:
- Ship distinct extensions for Gnome 42-44 and Gnome 45 in /usr/local/share/keyd
- Move the named pipe to XDG_RUNTIME_DIR
- Initialize the pipe inside the extension instead of the script
to avoid potential race conditions during initialization.
Replace hacky Sway and Hypr application detection logic with a generic
wayland implementation that works for wlroots based compositors.
This also provides the scaffolding for adding Gnome/KDE support
in the future should they decide to implement the requisite
protocols.
Sometimes in Sway, when an application goes from fullscreen to
windowed mode, there is neither a "app_id" or "window_properties"
attribute. Avoid throwing an exception for this case.
A potential race condition exists on systems where keyd-application-mapper
is started before keyd (ideally this shouldn't happen, but exotic
setups exist). To allow initialization order to be reversed, we simply
eliminate the ping check on script initialization.
Removing this is mostly harmless since keyd -e will silently
fail until the daemon is started anyway, and any errors will show up
in the log file.