SwiftBar runs apps from the user's home folder, BitBar and xBar default to the scripts folder.
sirgatez opened this issue · 1 comments
Describe the bug
SwiftBar runs apps from the user's home folder, BitBar and xBar default to the scripts folder.
This causes a problem for any app which accesses any file which may co-exist alongside the executable script. I have a few scripts which keep configuration in a file which accompanies the script itself.
To Reproduce
Steps to reproduce the behavior:
From SwiftBar select "Run in terminal" and it will drop you into your home folder. Scripts looking for files will not find them.
Expected behavior
The script should be executed from the script's folder to be backwards compatible with BitBar/xBar.
Screenshots
N/A
Environment:
- macOS version: 13.3.1
- SwiftBar version: 1.4.4 (461)
Plugin Example:
Applies to all plugins.
Additional Context:
- I don't run Bartender/Dozer/etc. or tested the issue without it running
I run Bartender, this issue is unrelated.
I actually didn't know that xbar runs the plugin within the context of a plugin folder. Do you know what happens if you have subfolders?
In SwiftBar there are a couple env var that maybe useful to you:
- SWIFTBAR_PLUGINS_PATH - The path to the Plugin Folder
- SWIFTBAR_PLUGIN_PATH - The path to the running plugin
- SWIFTBAR_PLUGIN_DATA_PATH - The path to data folder, individual per plugin
Overall I think using these variables(and equivalent in xbar) is more appropriate than assume the running path.