Simple Wayland Event Encoding Text
V2 config file parser for swhkd. Developed through Google Summer of Code 2024.
This sweet little parser is to be gradually integrated into the swhkd repo itself. For now, the grammar for the config parser is being implemented in this isolated repository.
As of now, the parser prints all the bindings that a given inputs file can expand to.
- Bindings
- Modifiers
- Regular keys
- Shorthands
- Ranges
- Omissions
- Send and on release attributes
- Unbinds
- Modes
- Oneoff
- Swallow
-
@mode
in commands
- Comments
- Imports
- Merge definitions from all imports
- Tests
- Integration into downstream
- Warn user if input config is not a regular file
- Set a maximum file size cap for configs (limit configurable in the
build.rs
) - Map keys and modifiers to internal representation (evdev enum variants) in a single pass
Want to learn how the code works? Check out my blog where I cover each topic as I implement them.
To see a structured representation of the sample config file after parsing, run the following:
cargo r -- hotkeys.swhkd
To run all available tests, run cargo test