Hi, I wanted to look into controlling the touchbar from a web extension (in firefox / chrome), by using a websockets bridge that the extensions connects to, which then calls the Btt API (either with the url scheme or by sending requests to the webserver) - however after reading through the docs and also taking a look at the btt.js wrapper I still have some basic questions regarding how to use the API, hopefully someone can help:
So I understand how to create a touchbar button / widget using the api by calling add_new_trigger, however that trigger gets added to 'All Apps', which is almost never what I would want (adding a global button), I would like to create an activation group using the api and then add triggers to it, or at least add triggers to an existing activation group, is there a way to do this using the API?
I'm also having some general trouble understanding how one would properly manage these touchbar triggers programmatically, so e.g. if I want to display all browser tabs on the touchbar as buttons to allow switching, I would have to create a trigger for each tab and then keep track of all the trigger uuids in my program in in order to update the button state or remove a button if it's no longer relevant? But then if my program doesn't properly clean up and remove all the buttons for some reason wouldn't they just stay around and have to be manually removed? Is there some way to assign all buttons to a 'parent' or something like that and then delete that parent in order to ensure a clean reset?
Any help would be appreciated