swiftbar / SwiftBar

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

swiftbar.environment not available as environment variable #214

Closed JeroenVdb closed 3 years ago

JeroenVdb commented 3 years ago

The swiftbar.environment parameter is not working for me. I tried using it in both node and bash environments. If I understand correctly it was introduced in https://github.com/swiftbar/SwiftBar/issues/160 and released in 1.2.3?

macOS Catalina 10.15.7 Swiftbar 1.3.0

An example script:

#!/bin/bash

# <bitbar.title>Title goes here</bitbar.title>
# <bitbar.version>v1.0</bitbar.version>
# <bitbar.author>Your Name</bitbar.author>
# <bitbar.author.github>your-github-username</bitbar.author.github>
# <bitbar.desc>Short description of what your plugin does.</bitbar.desc>
# <bitbar.image>http://www.hosted-somewhere/pluginimage</bitbar.image>
# <bitbar.dependencies>python,ruby,node</bitbar.dependencies>
# <bitbar.abouturl>http://url-to-about.com/</bitbar.abouturl>
# <bitbar.droptypes>Supported UTI's for dropping things on menu bar</bitbar.droptypes>
# <swiftbar.environment>['databaseId':'THEDATABASEID']</swiftbar.environment>

export otherDatabaseId="someId"

echo "Debug:"
echo "---"
echo "databaseId: $databaseId"
echo "otherDatabaseId: $otherDatabaseId"

I would expect that environmental variable databaseId would have value "THEDATABASEID", but it does not exist.

Screenshot 2021-07-08 at 16 57 28

The plugins screen shows this:

Screenshot 2021-07-08 at 17 06 28
melonamin commented 3 years ago

Thanks you for reporting! 👍

rafiazman commented 2 years ago

Using the example script with version 1.4.4 I am not able to see the Environment Variable section anymore in the plugins screen. Has this been removed?