Switch On/Off Bluetooth

A post was split to a new topic: Does KM support multiple icons for a macro on a palette?

Hi @ccstone

Is there anyway of finding out which version of blueutil is currently on my system?

Cheers,
Damian

Hey Damian,

Run the following script in the Terminal:

blueutil --version

-Chris

1 Like

Thanks Chris. Oddly, that just gives me this:
Usage: blueutil [status|on|off]

I'm really unfamiliar with terminal. I just do what I'm told in it! If I install a new version of blueutil, will that overwrite the old one, or is there an uninstall. I do have homebrew installed, if that makes a difference. I should really go and do some basic terminal 101 research I suppose.

Hm... Sounds like your version is pretty old then.

Try this:

blueutil -h

it depends upon how you install it.

Not per-se, however HomeBrew has an uninstall feature for items installed with it.

It does.

Try running this in the Terminal to update HomeBrew itself and any installed recipes.

brew -v update && brew -v upgrade

-Chris

1 Like

Thank you for AppleScript-only. Blueutil doesn't work with Catalina (although maybe the recompiled version does...glad just to have text to handle this rather than a file :slight_smile: )

1 Like

My computer and phone fight for my AirPods when I take a call so that got me looking for something to turn off Bluetooth. I followed your instructions and everything worked perfectly in Mac OS 12.0.1.

I tried to get some other solutions to work, but yours worked flawlessly.

I'm referring to the Chris Stone post. I used the links to download and install HomeBrew and blueutil.

No problems - everything works fine on a 2019 MBP running OS 12.0.1, Monterey.

Thanks,
Patrick

1 Like

Perhaps nobody need another solution to turn Bluetooth on and off, but here's another solution. This solution may need minor changes depending on your screen resolution. It may also need you to move the Bluetooth icon in the system bar as far right as possible (so that its submenu moves to the left rather than the right.)

This solution isn't better than the other solutions, it's simply here to show another technique for educational purposes.

BT Toggle.kmmacros (17 KB)