vegardinho / alfred_bluetooth_controller

Alfred workflow for managing bluetooth settings and -connections
MIT License
95 stars 7 forks source link

Error: Can't Toggle Device or Set Favorite #32

Closed drdannysands closed 1 year ago

drdannysands commented 1 year ago

Hi. I just installed this workflow, which looks useful. I fixed my security settings to allow it to run. I verified that I can turn and off BT status.

But I'd like to use this to connect a previously paired device. I tried this two ways:

  1. btsetfavorite and specify the device name
  2. btd (toggle connection with bluetooth device) and then specify the device name

However, with either method the program does not work. No error dialog, but log file shows error:

ERROR: Bluetooth Controller[Script Filter] Code 1: xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

I am running Mac OS Ventura 13.0 (22A380), Alfred 5.0.5

What am I doing wrong and what can I do to make this run?

Thanks.

Danny

drdannysands commented 1 year ago

Problem solved. Needed to install Command Line Tools, which I found on Apple Developer site. But the Readme file for this workflow did not tell me I had to do that.

Now the only thing that doesn't work is when I toggle my favorite BT connection I can toggle off to on but not on to off. But that's not a need I have right now.

Thanks.

vegardinho commented 1 year ago

Hi, thanks for letting me know.

I was not aware that Command Line Tools was a dependency. After a few searches and looks at the code, I'm still unsure where it comes from. It might be blueutil or notificator. (I assume python packages can't have Command Line Tools dependency?) I am not using xcrun anywhere in my code, so this must be run farther down the stack somewhere. I would preferably get rid of the dependency on this package, so any help is appreciated.

As for the toggle problem, can you give me some debug info? This is not an issue with me. Also confirm you're on version 3.0.5; historically there's been some problems with the toggle command.

drdannysands commented 1 year ago

Hi @vegardinho.

Ah that was the problem. I had been using 3.0.1 and didn't realize there was an update. I just updated to 3.0.5 and it works like a charm!

Thanks for a great workflow!

vegardinho commented 1 year ago

Glad it worked out!

The workflow should check for updates every 4 days on use of command btd, so let me know if that doesn't work for you.

drdannysands commented 1 year ago

I see that now. I just added a link from the btf workflow to the updater routine, as well (which I realize will go away with next update).

vegardinho commented 1 year ago

Yeah, I'll consider adding it to a couple more commands in the next update. The only reason I've not done so in the last versions is it makes the interface very cluttered.