-
Notifications
You must be signed in to change notification settings - Fork 3
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
Use Avahi to discover lights? #2
Comments
Uh, boy - that's quite a lot of code. Thanks a lot for the input! |
Hi Alex, |
@cschalle, using Avahi is not necessary to publish this project on extension.gnome.org, as GSConnect uses the same approach (mdns-js): https://extensions.gnome.org/extension/1319/gsconnect/ Unfortunately, I am working on a bigger side project, so I don't have much time left. It might be working out of the box - not sure. Edit: I see - Vte is not available for gnome GTK4: https://gitlab.gnome.org/GNOME/vte/-/issues/12 |
Hi Alex, ah I didn't realize that e.g.o allows extensions with external dependencies, that said it is still a bit clunky as you can't just install the extension and go which would be a nicer experience. I guess we could work around this by packaging the extension as a RPM and have the RPM automatically pull in required dependencies, but in general I am not a huge fan of packaging extensions as RPMS and also it is a distro specific fix. I tried running it, but as I expected it will not run under 41 due to the switch to GTK4, so beyond lacking VTE you also get an error from prefs.js due to trying to load GTK3 |
Great! If you need a tester feel free to ping me, got a lamp here in front of me. |
elgato.js.txt
Nice extension! Looking at it, I wondered if the npm requirement and the need to install node modules could be avoided. It seemed to me that tallking to Avahi over D-Bus (should be installed on most Linux systems) would allow doing this natively in GObject code without having to resort to npm and mdns-js. I did some experiments with this.
I'll attach a script here that implements a persistent browser for Elgato lights on the network. (Run as
gjs elgato.js
) I spent quite a bit more time on this than I expected to really try and get the corner cases right:Details in a comment in the code. This could could be re-simplified to just do a single-pass scan, if something more like the current UI was desired, but I think its nice if the extension "just works" without having to go into the preferences and rescan if the light gets a new DHCP address or something.
Feel free to adapt this code to your purposes, and let me know if it doesn't work :-)
The text was updated successfully, but these errors were encountered: