Merge contents of effects/, scripts/ and plugins/
Extensions are divided in three categories: effects, scripts, and binary plugins. This creates a separation, which is reflected in the associated APIs. For example, effects must use only the things available in libkwineffects, scripts can only use whatever is exposed in the workspace wrapper + window, binary plugins have only a few restrictions. It gets worse when the line between them gets blurry, for example that's what we see in the declarative effects that use the things available in libkwineffects and also normal scripting APIs, there's EffectScreen
and Output
, VirtualDesktop
and uint
-based virtual desktop ids, etc.
It would be great to unify the extensions to simplify the plugin api. For example, the effects could use the existing infrastructure in scripting or binary plugins but with a couple of new classes or functions to start/register effects, e.g.
class MyEffect extends Effect {
};
Compositor.registerEffect(MyEffect);
Workspace.windowAdded.connect(window => console.log(window.caption, "was added");
As the first step, it's worth merging effects/, plugins/ and scripts/ directories like what we did with the backends. We would need to be careful with translations. After that, it's worth exploring exposing effect specific APIs in the normal scripting API.