qanata
March 30, 2026 ยท View on GitHub
Application-aware layer switching for kanata on sway.
qanata watches the focused sway window and tells kanata which layer to use.
How it works
mainis the default layer.- If the focused application matches a file in
~/.config/keyboard/apps/, qanata switches to that layer. - If no matching file exists, qanata falls back to
main.
Example:
~/.config/keyboard/apps/org.telegram.desktop
If Telegram is focused, qanata sends org.telegram.desktop to kanata and kanata switches to that layer.
Run
cargo run -- --port 7070
Useful flags:
--debugfor debug logs--tracefor trace logs--white-list-file <path>to ignore apps that should not trigger layer changes
Overlay
The overlay window is optional and controlled by the overlay feature:
cargo run --features overlay -- --port 7070
Nix development shell
This repository includes a flake.nix for development dependencies.
- Enable Flakes in your Nix configuration.
- Install direnv, for example with
nix profile install nixpkgs#direnv. - Clone the repository and enter it.
- Allow the environment with
direnv allow.
After that, the shell provides the build and runtime dependencies used by the project.
Statistics
The repository also includes a small script for visualizing kanata logs:
./run_stats.sh --file path/to/kanata/log
Log format:
actual_key_presses|layer|resulting_key_press
Reference
For a real configuration example, see my kanata config.
Status
This project is still experimental. It works, but it is not polished yet.