HybridBar icon indicating copy to clipboard operation
HybridBar copied to clipboard

[Feature] Implement Scripting

Open vars1ty opened this issue 1 year ago • 1 comments

Warning This is a complex feature and is not guaranteed to be implemented.

Compile from the dedicated branch at your own risk, it may break at any time.


Using Rune, add scripting support for labels as a start, then assuming everything works well, implement it to a larger degree.

vars1ty avatar Mar 06 '23 08:03 vars1ty

Paused for now due to several reasons:

  1. Adding scripting would require yet another key for widgets, making it all a huge mess
    • This can be solved by removing support for the command key, letting the user call execute themselves.
  2. It would break all current configs if a proper, clean solution was introduced. If just a new key named script was added, then it would bring in more complexity to the codebase.

Benefits of having scripting though:

  1. More control of Hybrid
  2. You're free to implement more advanced functions, rather than hacking around with it
  3. Widgets can be dynamically added/removed
  4. Custom widget types to an extent
  5. Custom user-defined functions and variables
  6. Access to more optimized functions, rather than having to use shell-commands for everything, which adds a lot of overhead when called frequently

Downsides of implementing scripting:

  1. If done properly, all configs that use the command key will break, although it takes little to no effort from the user to fix it
  2. More documentation has to be added to reflect on how to use/transition to using scripts
  3. More prone to user errors
  4. Less beginner-friendly (hence new examples will be made to help out beginners)

vars1ty avatar Mar 13 '23 18:03 vars1ty