Skip to content

waycrate/sweet

Repository files navigation

sweet

Simple Wayland Event Encoding Text

V2 config file parser for swhkd. Developed through Google Summer of Code 2024.

What it does

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.

Roadmap

  • 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

Extra features

  • 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.

See it in action

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages