mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-11-14 12:53:43 +01:00
skhd and whkd can give one key a different action in each application, or none (skhd's ~, whkd's Ignore), and skhd has a blacklist of applications in which no key is taken. The engine decides from the focused application whether such a key is active: inactive, it reaches the application, which is how a key passes through. What it needs is to be told which application has the focus. The bridge reports the desktop entry of every window with its class, and the table now keeps it. Table::focused_application returns the executable, the app id (or X11 class) and the desktop entry of the window KWin activated last, a dialog included, or nothing once that window is gone. The KWin backend hands it to kwin::hotkeys::focus after every event of the bridge; only a change reaches the engine's thread, and an engine that starts begins with the focus as it was last seen. The engine matches the names of the file against the three, ignoring case. The names in an skhdrc or a whkdrc are those of macOS and Windows applications, so the daemon takes --app-alias NAME=ALIAS[,ALIAS]..., more than once, for the engine's app_aliases. Unit tests cover the focus of the table and the calls of a scoped key as the focus moves, an alias included. The VM test vm-keys-engine grows a section with wev and foot open and --app-alias terminal=foot: in wev, Alt+G (for the terminal only) and Alt+N (which wev ignores) reach wev and run nothing; in foot both run their bindings; back in wev, Alt+G reaches wev again.