Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to install dependencies for xbar plugins? #1

Open
daltonch opened this issue Jan 9, 2023 · 6 comments
Open

How to install dependencies for xbar plugins? #1

daltonch opened this issue Jan 9, 2023 · 6 comments

Comments

@daltonch
Copy link

daltonch commented Jan 9, 2023

Using Terminal I installed your 2 dependencies and they say they installed successfully, however when launching xbar I get an error on the plugin,

ModuleNotFoundError: No module named 'aiohttp'

Any idea where xbar is looking for python modules so I can make sure they are installed in the right location?

M1 Max 13.0.1

@DouweM
Copy link
Owner

DouweM commented Jan 15, 2023

Any idea where xbar is looking for python modules

@daltonch XBar directly runs the executable without setting up a shell (which means PATH updates in .zshrc etc are ignored), which means the hashbang of /usr/bin/env python3 resolves to the system Python: /usr/bin/python3.

I think /usr/bin/pip3 install pyunifi aiohttp should do the trick. If you can confirm it does, I'll update the README!

If you'd rather use a different Python or a virtualenv, you can update the hashbang in the executable.

@DouweM
Copy link
Owner

DouweM commented Jan 24, 2023

@daltonch Hey Chad, did you have a chance to try this out?

@daltonch
Copy link
Author

daltonch commented Jan 24, 2023

Sorry, just getting back to this. Yes! That did work. I use fish shell so I ran zsh first then ran your command and now the plugin loads! Thank you! However, I get a 401 when trying to connect to my CloudKey, here's the config when I 'run in terminal'

VAR_MENU_BAR_EVENTS="false" VAR_NOTIFY_DISCONNECT="true" VAR_CLOUDIMAGE_TOKEN="" VAR_CONTROLLER_HOST="192.168.1.39" VAR_CONTROLLER_USERNAME="ubnt" VAR_CONTROLLER_PORT="443" VAR_NOTIFY_CONNECT="true" VAR_NOTIFY_ROAM="false" VAR_TERMINAL_NOTIFIER_PATH="" VAR_AVATARS="" VAR_CONTROLLER_PASSWORD="mypassword" VAR_CONTROLLER_VERSION="unifiOS" VAR_CONTROLLER_SSL_VERIFY="false" VAR_SHOW_TEST_DEVICES="false" VAR_ACCESS_POINT_ALIASES="" '/Users/daltonch/Library/Application Support/xbar/plugins/whos-home-unifi.1m.py'
daltonch@MacBook-Max ~ % VAR_MENU_BAR_EVENTS="false" VAR_NOTIFY_DISCONNECT="true" VAR_CLOUDIMAGE_TOKEN="" VAR_CONTROLLER_HOST="192.168.1.39" VAR_CONTROLLER_USERNAME="ubnt" VAR_CONTROLLER_PORT="443" VAR_NOTIFY_CONNECT="true" VAR_NOTIFY_ROAM="false" VAR_TERMINAL_NOTIFIER_PATH="" VAR_AVATARS="" VAR_CONTROLLER_PASSWORD="" VAR_CONTROLLER_VERSION="unifiOS" VAR_CONTROLLER_SSL_VERIFY="false" VAR_SHOW_TEST_DEVICES="false" VAR_ACCESS_POINT_ALIASES="" '/Users/daltonch/Library/Application Support/xbar/plugins/whos-home-unifi.1m.py'

I know the passwords right as I can login to the Cloud Key G2 with the username and password. UnifiOS:
UCK G2 Plus v3.0.13

Any other logs I can check?
Thanks

@DouweM
Copy link
Owner

DouweM commented Jan 25, 2023

@daltonch Can you try setting VAR_CONTROLLER_VERSION to UDMP-unifiOS? I had to use that on my non-Pro UDM to make it work, even though that suggests it's just for the UDMP.

@daltonch
Copy link
Author

BOOM! That worked. Thanks!

@DouweM
Copy link
Owner

DouweM commented Jan 27, 2023

Reopening since I want to document this

@DouweM DouweM reopened this Jan 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants