New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add 'plugin_trait' feature to pop-launcher-toolkit #113
Conversation
Very interesting. It'd be useful to include an example in the examples sub-directory of the toolkit package, and the optional methods should have an empty method implementation by default so you don't have to write |
I have added a default impl for the optional functions as suggested and removed the feature. I was tempted to copy paste the mpd plugin example but it would be better to implement something a little less specific . I was thinking about pid search and kill. I will probably update the PR tomorrow. |
I don't think the example has to be necessarily useful in any way. For now, we could have a curated list of third party plugins mentioned in the readme. In the future, it'd be ideal to have a repository (or branch of this repository) with a file containing machine-readable curated plugin releases that the pop-launcher could use for installing and updating plugins. |
I still think the mpd example doesn't fit. You would need to have a running instance of a mpd server on your machine to make the example work.
That would be awesome ! The past few days me and a friend have been looking into alfred workflows collections How would you generalize the installation process though ? Then we would just need to Let me know if it suits you, I would be glad to help. |
I think it'd be fine to provide a developer flag for installing a plugin from source, but perhaps the curated repository should be maintaining a list of release tarballs and their shasums, extracted directly to the plugin directory into a directory of the name of the plugin. A more restrictive installation process for curated plugins would be ideal from a security perspective. |
Just added a simple plugin example that run |
54aa121
to
627e4ca
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR add a
plugin_trait
feature which provides a helper trait to write plugins.It reduces the boiler plate needed by wrapping the stdin message passing in a default
run
function, and the stdout messages inrespond_with
.Additionally it implement the same logging behavior the default plugins have.
For a concrete example you can take a look at pop-launcher-mpd