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 WIP

Extra features

  • Warn user if input config is not a regular file
  • Set a maximum file size cap for configs
  • 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

All the examples that are currently tested against are piled up in the hotkeys.swhkd file. These are to be ported to actual cargo tests.

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

Contributing

This repo is for cathedral style development. I'm assigned with creating the parser and there's potential financial transactions involved. Contributions are NOT welcome.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages