tilmanginzel/alfred-bluetooth-workflow

Is this based on trietsch/alfred-bluetooth-connector

Closed this issue · 14 comments

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.

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! :)

Let me know if 1642991 is fine for you.

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?

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

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:

  • workflow updates
  • minor usability improvement described in #1 (comment)

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.

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.

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!

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

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. :)

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

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

  • work via merge requests
  • let the other one review
  • merge and publish a new version

What do you think? :)

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

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.