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

Shortcuts Plugins #344

Closed
6 tasks done
melonamin opened this issue Nov 6, 2022 · 14 comments · Fixed by #345
Closed
6 tasks done

Shortcuts Plugins #344

melonamin opened this issue Nov 6, 2022 · 14 comments · Fixed by #345
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@melonamin
Copy link
Contributor

melonamin commented Nov 6, 2022

Shortcuts Plugins

Currently to create a plugin the user must have basic scripting\coding skills.
Implementing a new type of plugin - “Shortcut Plugin” - would allow users to create the plugins inside Shortcuts app, potentially expanding the user base.

TODO:

  • Basic UI to add and delete plugins
  • New plugin type "Shortcut", runs provided shortcut instead of a file based plugin
  • Store Shortcut plugins in UserDefaults
  • Make Shortcut plugin UI reactive
  • Enable\disable plugins
  • Plugin repository for Shortcuts Plugins (maybe another day)
  • Localization

BETA

Shortcut Examples

Adding Shortcuts Plugin Settings View:
CleanShot 2022-11-08 at 16 01 34@2x

CleanShot 2022-11-08 at 16 01 51@2x

@melonamin melonamin added the enhancement New feature or request label Nov 6, 2022
@melonamin melonamin added this to the 1.5.0 milestone Nov 6, 2022
@melonamin melonamin self-assigned this Nov 6, 2022
melonamin added a commit that referenced this issue Nov 6, 2022
@melonamin melonamin linked a pull request Nov 6, 2022 that will close this issue
5 tasks
@melonamin melonamin reopened this Nov 8, 2022
@melonamin melonamin changed the title First class Shortcuts support Shortcuts Pluggins Nov 8, 2022
@melonamin melonamin changed the title Shortcuts Pluggins Shortcuts Plugins Nov 16, 2022
melonamin added a commit that referenced this issue Nov 18, 2022
@dchevell
Copy link

dchevell commented Jan 10, 2023

When I click "Add" under macOS Ventura (SwiftBar: 1.5.0 (478), macOS: 13.1 (22C65)) nothing appears and SwiftBar beachballs until I have to force quit.

Just curious - is that expected, or can I provide any useful diagnostic data? Not bothered, but happy to test/troubleshoot if it's helpful.

Edit: I saw there's a build 479 - retested just in case & saw the same issue. For whatever reason checking "Include pre-release…" and clicking "Check for updates" got me from 1.4.4 to 1.5.0 b478, but it doesn't seem to see b479, so I downloaded manually to test.

@melonamin melonamin pinned this issue Jan 11, 2023
@melonamin melonamin modified the milestones: 1.5.0, 2.0 Apr 14, 2023
@melonamin
Copy link
Contributor Author

Hi @dchevell,

sorry, for some reason I missed the notification about your comment from GitHub... :(

Can you please try this build? If you see the beach ball, can you get the logs from Console.app (Search = "process == SwiftBar")

SwiftBar.app.zip

@dchevell
Copy link

@melonamin no need to apologise, I'm grateful for your work on this app :)

Still beachballed for me on this build. I reproduced before installing (b479), and after (confirmed b494).

Console logs - I clicked "Add" at 09:17:00.567184+1000.

default	09:16:46.884279+1000	SwiftBar	order window front conditionally: cc1 related: 0
default	09:17:00.000746+1000	SwiftBar	Requesting manual refresh for plugin id: batterystatus.sh type: Executable name: batterystatus path: /Users/dchevell/Library/Mobile Documents/com~apple~CloudDocs/SwiftBar/batterystatus.sh
default	09:17:00.000973+1000	SwiftBar	Refreshing plugin metadata /Users/dchevell/Library/Mobile Documents/com~apple~CloudDocs/SwiftBar/batterystatus.sh
default	09:17:00.179980+1000	SwiftBar	Successfully executed script /Users/dchevell/Library/Mobile Documents/com~apple~CloudDocs/SwiftBar/batterystatus.sh
default	09:17:00.567184+1000	SwiftBar	It's not legal to call -layoutSubtreeIfNeeded on a view which is already being laid out.  If you are implementing the view's -layout method, you can call -[super layout] instead. Break on void _NSDetectedLayoutRecursion(void) to debug.  This will be logged only once.  This may break in the future.
default	09:17:00.573292+1000	SwiftBar	order window front conditionally: cc1 related: 0
default	09:17:00.574995+1000	SwiftBar	order window: cc6 op: 1 relative: cc1 related: 0
default	09:17:00.838943+1000	SwiftBar	order window: cc6 op: 1 relative: cc1 related: 0
default	09:18:00.000260+1000	SwiftBar	Requesting manual refresh for plugin id: batterystatus.sh type: Executable name: batterystatus path: /Users/dchevell/Library/Mobile Documents/com~apple~CloudDocs/SwiftBar/batterystatus.sh
default	09:18:00.000361+1000	SwiftBar	Refreshing plugin metadata /Users/dchevell/Library/Mobile Documents/com~apple~CloudDocs/SwiftBar/batterystatus.sh
default	09:18:00.194951+1000	SwiftBar	Successfully executed script /Users/dchevell/Library/Mobile Documents/com~apple~CloudDocs/SwiftBar/batterystatus.sh

@melonamin
Copy link
Contributor Author

Hmm… interesting, I need to look into it. 🤔

@melonamin
Copy link
Contributor Author

Manged to reproduce it on my machine, which is very good, I'm getting closer

@melonamin
Copy link
Contributor Author

@dchevell how about this one? SwiftBar.app.zip

@dchevell
Copy link

Same thing I'm afraid @melonamin . Confirmed b495 in the about screen, then captured these logs:

default	06:56:46.238645+1000	SwiftBar	It's not legal to call -layoutSubtreeIfNeeded on a view which is already being laid out.  If you are implementing the view's -layout method, you can call -[super layout] instead. Break on void _NSDetectedLayoutRecursion(void) to debug.  This will be logged only once.  This may break in the future.
default	06:56:46.244944+1000	SwiftBar	order window front conditionally: fea8 related: 0
default	06:56:46.246529+1000	SwiftBar	order window: feb5 op: 1 relative: fea8 related: 0
default	06:56:46.509324+1000	SwiftBar	order window: feb5 op: 1 relative: fea8 related: 0

(One other odd side effect: On prior builds, the sfcolor parameter would only apply to inline symbols, e.g. :circle: | sfcolor=green sfimage=square would make the inline :circle: green, but not affect the sfimage icon placed to the left. On this build, the colour gets applied to both, which made one of my scripts that uses a lot of colour based info kinda weird)

@melonamin
Copy link
Contributor Author

@dchevell I have a good feeling about this build, can you please try?
SwiftBar.app.zip

@space-esquire
Copy link

Hi there, same exact thing is happening on Ventura. Do you recommend I go back to the release? Thanks :)

@melonamin
Copy link
Contributor Author

@space-esquire you've tried the latest one I linked, correct?

@space-esquire
Copy link

Yes 😃

@melonamin
Copy link
Contributor Author

FML then! 🥲

@dchevell
Copy link

dchevell commented Jun 27, 2023

@melonamin I can't speak for anyone else, but this build finally works for me! Was able to add a shortcut plugin with no errors and run it as expected.

A little weirdness where, after adding one, I can't click on it to highlight or delete - but if I switch to another tab (e.g. Code Plugins) then back to Shortcut Plugins, it resolves that issue.

Apologies for being so long with my feedback!

@melonamin
Copy link
Contributor Author

That’s awesome to hear, thanks! I’ll check the selection\highlight issue

@melonamin melonamin unpinned this issue Jan 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants