tilmanginzel / alfred-bluetooth-workflow

Yet another Alfred workflow to connect / disconnect Bluetooth devices
MIT License
189 stars 8 forks source link

Is this based on trietsch/alfred-bluetooth-connector #2

Closed trietsch closed 5 years ago

trietsch commented 5 years ago

Hi, is this repo based on https://github.com/trietsch/alfred-bluetooth-connector ? If so, I'd appreciate if you link to it in your readme.

tilmanginzel commented 5 years ago

Hey @trietsch, I would not exactly say based on as I use a different approach, but I certainly can't deny that I took some inspiration from your implementation, especially regarding the system_profiler SPBluetoothDataType -xml command and blt naming. Forgive me that I forgot to link to your repository when I published this repository.

I will happily link to your project later or tomorrow! :)

tilmanginzel commented 5 years ago

Let me know if 1642991f9 is fine for you.

trietsch commented 5 years ago

No problem at all, the change looks good :) Though maybe we can combine our efforts. Your approach using xpath and the XML is pretty nice, I think better than the regex I'm using. The main difference I think is size of the workflow, and another one is that my version is able to update itself.

What do you say, do you think we can work together in one repo?

tilmanginzel commented 5 years ago

Yes I am open for collaboration. :)

I wanted to take a look at #1 later today or tomorrow and utilize blueutil for this. Small tool which does a great job, even if it's 9 years old. I also stumbled upon toy/blueutil, which added capabilites to also connect to devices. This would make the current BluetoothConnector obsolete (main reason for the huge workflow size, besides the lxml source, maybe this can also be reduced).

I have not looked into workflow updates yet, as this was my first workflow and did not want to dig too deep already, but that's a nice feature indeed.

What do you propose on how we could work together on this, and decide on a repository? Maybe having a short chat outside of GitHub could help, feel free to ping me at github@tilmanginzel.de

tilmanginzel commented 5 years ago

Hey @trietsch, just to keep you in the loop: I have removed the BluetoothConnector and added toy/blueutil instead. This allowed to add further commands to power Bluetooth on or off (blt-on, blt-off, blt-toggle).

The workflow size was reduced by roughly 3 megabytes to around 8.5. I think reducing it much more will be difficult due to the lxml size. I tested a few other XML python libraries, but most have worse support for XPath expressions, which are required to parse the system profiler output.

So IMO the only features missing at the moment are:

trietsch commented 5 years ago

Thanks for the update (and sorry for the late reply)! Nice work on using blueutil instead. I think we can merge your work with my work on the workflow updates. I can clone your repo and implement the workflow update functionality there. Shall I setup a new repo with access for the both of us?

We can link to the new repo from our original repos that way.

tilmanginzel commented 5 years ago

Whatever you prefer! :) Alternatively I could just grant you collaborator rights in this repository, but if you feel that a new one / fork is necessary we can do that of course.

trietsch commented 5 years ago

Cool :) I've just setup a new repo for testing (I'll remove that one later), with the auto update functionality implemented. Care to check it out? Just download the first release, and then try to update it (either by selecting the Update is available item, or by typing blt workflow:update).

Let me know what you think!

trietsch commented 5 years ago

Oh, it can definitely use some more improvements, but we can do that in the future.

tilmanginzel commented 5 years ago

Nice, looks good. But for some reason the "Update available for Bluetooth Connector!" only appears if I typed blt workflow:update previously. Is this the expected behavior? Besides that the update works just fine. :)

trietsch commented 5 years ago

Cool, good to hear! I've created a pull request :)

tilmanginzel commented 5 years ago

@trietsch I think we can close this issue now. If you'd like we can just continue collaborating as we do at the moment:

What do you think? :)

trietsch commented 5 years ago

Sounds good to me! Wondering what kind of improvements are still to come though :)

tilmanginzel commented 5 years ago

Yeah, the most important features are already there I guess. Here are two more off the top of my head for some future releases:

  1. If bluetooth is off and you try to connect to a device, power it on automatically and connect afterwards
  2. Add possibility to pair with new devices. Probably not important though as new pairings happing infrequently.