SbarLua icon indicating copy to clipboard operation
SbarLua copied to clipboard

Accessing environment variables

Open vitorf7 opened this issue 1 year ago • 0 comments

Hi thank you so much for everything. I am unsure weather I am doing something wrong or not. I am trying to create a weather widget and in it I am trying to use an environment variable and I am not able to get anything back from it.

I even tried to do something like os.getenv("WEATHER_API_KEY") in a label and it does not work whereas something like os.getenv("PATH") does work.

I then created a test.lua file with a single line print(os.getenv("WEATHER_API_KEY")) and ran lua test.lua and it worked.

Probably just me being to much of a numpty or not knowing where to look in case sketchybar only has access to certain env vars and not others.

vitorf7 avatar Jan 08 '25 17:01 vitorf7