Skip to content
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

Plugin with multiple files #387

Open
olfway opened this issue Sep 24, 2023 · 7 comments
Open

Plugin with multiple files #387

olfway opened this issue Sep 24, 2023 · 7 comments

Comments

@olfway
Copy link

olfway commented Sep 24, 2023

What would be easier if plugin can be a macos bundle / simple folder / zip file with multiple files and resources instead of single file

Similar request in xbar: matryer/xbar#791

@dchevell
Copy link

#358 would effectively address this, and I think in a simpler/more flexible way. Imagine:

<swiftbar plugin folder>/MyPlugin/
<swiftbar plugin folder>/MyPlugin/myscript.sh
<swiftbar plugin folder>/MyPlugin/.swiftbarignore
<swiftbar plugin folder>/MyPlugin/core/<a bunch of files>
<swiftbar plugin folder>/MyPlugin/lib/<a bunch of files>

Your .swiftbarignore file would just contain some entries like core/* and lib/*, and SwiftBar itself would run your "entrypoint" script and ignore everything else.

@melonamin
Copy link
Contributor

I've been thinking about plugin bundles for a while, but not sure that the upsides are bigger than additional complexity.

And I think @dchevell is right, the #358 along with built in support for per plugin CACHE\DATA folders (#200) should be enough.

But I'm open to suggestions, if @olfway you can build a case for adding the bundles.

@olfway
Copy link
Author

olfway commented Sep 29, 2023

My idea was to split icon resources and maybe some helper scripts out of main script.
So, it's seems it's already possible with .swiftbarignore, thanks @dchevell!

But as far as I understand it's not possible now to install this "multi-files" plugins with swiftbar's plugins repository manager, right?

@melonamin
Copy link
Contributor

it's not possible now to install this "multi-files" plugins with swiftbar's plugins repository manager,

Yeah, thats correct. I guess it could be added as zip, which SwiftBar will automatically extract.

@olfway
Copy link
Author

olfway commented Sep 30, 2023

I wonder if it's possible to somehow add it as directory to repo but then download it as zip?

Actually, there is an api to get list of files and folders for any path, for example:
https://api.github.com/repositories/49141197/contents/Cloud

@melonamin
Copy link
Contributor

The problem is that Plugin Repository is based on xbar.com and to make this happen we would need to implement this change on their end, which is probably not going to happen(the project in light maintenance mode).

Adding this feature only for custom Plugin Repositories would be a too narrow use case(?).

SwiftBar can install plugins directly from URL, maybe I can add this feature there, but it will be exclusivly for GitHub.

@peanball
Copy link
Contributor

you could always append the zip file to the end of your script and unzip it "from the end of the script" into the SWIFTBAR provided temp folder.

Some guides on the idea: https://www.linuxjournal.com/node/1005818

I'm sure you can adapt figuring out how to make it use the right path for the tar.gz extraction, as provided by the plugin-specific env variable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants