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
[Feature request] Ability to provide input parameters to plugin #160
Comments
I think we can generalize this to user-defined environment variables. Plugin developer defines supported env variables, like this:
And than we expose this in Plugin settings for user to override |
How about? <swiftbar.environment>
<var1>default value</var1>
<var2>default value</var2>
<var3></var3>
<var4 />
</swiftbar.environment> |
I think I'm going to stick with It is live in the beta, you can try it |
Ok |
This comment has been minimized.
This comment has been minimized.
plugin file |
Please keep it within #167, these are not related |
Apologies. |
I will test this in latest beta today evening |
Hi @bilal-fazlani, did you have a chance to try this one? |
Hey sorry, I got busy during week. Since tomorrow is Saturday, I can test this. |
Still don't see anything in settings
|
Ah, sorry, nothing in UI at this point, only metadata support and internal logic. I’m adding the UI in the next build |
Ok 👍 . I can test that once it is available. |
Can you email me if UI needs translation? Happy to provide any new Dutch translations if needed. Not on Github everyday, so not sure if I would miss a notification of some sorts. |
Hello @melonamin Are xbar variables supported for backward compatibility with plugin re repo? |
Hey @romansavrulin,
UI edit is working, but probably not the way you expect. Instead of updating values in plugin's source code it puts them into source file metadata(file extended attributes), this feature works only in SwiftBar |
@melonamin I believe it is not working as expected. I've put
|
Ah, got it, <xbar.var> are not supported. |
Any alternative options? |
No, not at the momen. SwiftBar doesn't support parametrization in the same sense as xbar, yet. I don't like how xbar approaches this, but didn't came up with a better version myself yet. |
Proposal
A plugin developer can publish input parameter requirement in the metadata file (xattr). These parameters can have default values too
Users can then configure plugins by providing (or overriding) input parameters using SwiftBar UI
SwiftBar can provide these input parameters to plugin using environment variables
The text was updated successfully, but these errors were encountered: