Skip to content

Document How to Script and Contribute Custom Mux Modes #17

@ruffsl

Description

@ruffsl

Summary:
Encourage developer involvement and upstream contributions by documenting how users can create and contribute their own custom mux modes. The process is straightforward for those with basic Rust knowledge and a working development environment.

How to Create a Custom Mux Mode:

  1. Create a new source file in the src/mux_modes/ directory.
  2. Define a new struct implementing the MuxMode trait, specifically the handle_event method.
  3. Update mod.rs to:
    • Import the new module
    • Add the new mode to the ModeType enum
    • Extend the factory function to dispatch the new mode
  4. Rebuild and run CtrlAssist, selecting your new mode via the CLI.

Advanced Ideas:

  • Explore forwarding additional CLI arguments to custom mux modes (e.g., ctrlassist mux --mode toggle -- --button=select to override the default toggle button).
  • Consider using clap subcommand or argument injection for mode-specific configuration.
  • Document best practices for structuring, testing, and submitting new mux modes upstream.

Notes:

  • Lowering the barrier for scripting and contributing mux modes will foster innovation and community involvement.
  • Example templates and documentation should be provided to guide new contributors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationenhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions