Skip to content

Plugin metadata is broken after changing plugin settings #428

Open
@Spaider

Description

Describe the bug
Plugin metadata for environment variables stops working after changing plugin settings via GUI

To Reproduce
Steps to reproduce the behavior:

  1. I have a binary plugin which relies on two environment variables.
  2. Prepared text file with metadata as follows:
    # <swiftbar.environment>[VAR_PROJECT_ID=16****30,VAR_TOKEN=glpat-ECa****Vt]</swiftbar.environment>
    
    First variable is integer (GitLab project ID), the second is GitLab token string
  3. Write metadata with:
    xattr -w "com.ameba.SwiftBar" "$(cat ~/Temp/vars.txt | base64)" gl-mgr.5m
    
    At this point, everything works fine: variables correctly passed to a child process
  4. Go to Plugin settings in Preferences and tick a few checkboxes in Hide menu items
  5. At this point, the plugin stops working, blaming that it can not find required environment variables. File metadata looks like this now:
    >> xattr -p com.ameba.SwiftBar gl-mgr.5m | base64 -D
    <swiftbar.hideRunInTerminal>true</swiftbar.hideRunInTerminal>
    <swiftbar.hideSwiftBar>true</swiftbar.hideSwiftBar>
    <swiftbar.environment>VAR_TOKEN:glpat-ECa****Vt,VAR_PROJECT_ID:16****30</swiftbar.environment>
    
    Note two differences among documented and actual format:
    • absence of a "#" sign at the beginning. Though, it may have no impact on an issue
    • "=" got replaced with ":" for environment variables

Expected behavior
I expect that changing binary plugin setting in GUI must not damage custom metadata written by a user

Environment:

  • macOS version: 15.1.1
  • SwiftBar version: 2.0.0 (50)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions