swiftbar / SwiftBar

Powerful macOS menu bar customization tool
https://swiftbar.app
MIT License
2.95k stars 92 forks source link

Add custom plugin repository support #351

Closed melonamin closed 1 year ago

melonamin commented 2 years ago

As discussed in #342

Set custom plugin repository url with: defaults write com.ameba.SwiftBar PluginRepositoryURL http://localhost:8000/

Use this archive as an example:

unzip "sb plugin repo.zip"
cd "sb plugin repo.zip"
python3 -m http.server
melonamin commented 2 years ago

@futurist see above and try this beta build

melonamin commented 1 year ago

@futurist do you have any feedback yet?

futurist commented 1 year ago

@melonamin cool job! Just a little thing, I saw in the sb plugin repo.zip folder, AWS/elb.30s.sh and AWS/plugins.json both have the same script content, is it a bit redundant? I think that will be confused when try to add/update plugins.

melonamin commented 1 year ago

Script content in AWS/plugins.json is not used and can be omitted. This is just an as-is state, that I got from xbar.

futurist commented 1 year ago

@melonamin I've tested and it's worked! thanks for the job!

futurist commented 1 year ago

@melonamin After tried again, found some issues:

  1. If domain not localhost, seems cannot reached, no http request to the pluginHost.
  2. In the plugin tab, click on "Source<>" button, will jump to https://github.com/matryer/xbar-plugins website.

The GetPlugin window always loading if using customized domains(non-localhost, both http/https tried).

Update:

After several tries, I found the pluginHost url cannot have subPaths, like "http://xxx.com/repo/", that's why for the first issue. I think this restriction can be added to the document maybe, or can it be supported if possible?

The second issue, maybe related below code:

        var gitHubURL: URL? {
            URL(string: "https://github.com/matryer/xbar-plugins/blob/master/\(path)")
        }

It's like hard-coded, can it be a preference also? Thank you!