Plugin metadata is broken after changing plugin settings #428
Open
Description
opened on Nov 30, 2024
Describe the bug
Plugin metadata for environment variables stops working after changing plugin settings via GUI
To Reproduce
Steps to reproduce the behavior:
- I have a binary plugin which relies on two environment variables.
- Prepared text file with metadata as follows:
First variable is integer (GitLab project ID), the second is GitLab token string
# <swiftbar.environment>[VAR_PROJECT_ID=16****30,VAR_TOKEN=glpat-ECa****Vt]</swiftbar.environment>
- Write metadata with:
At this point, everything works fine: variables correctly passed to a child process
xattr -w "com.ameba.SwiftBar" "$(cat ~/Temp/vars.txt | base64)" gl-mgr.5m
- Go to Plugin settings in
Preferences
and tick a few checkboxes in Hide menu items - At this point, the plugin stops working, blaming that it can not find required environment variables. File metadata looks like this now:
Note two differences among documented and actual format:
>> 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>
- 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