Turn Bluetooth On and Off from Command Line on macOS

Publikováno: 6.11.2018

Bluetooth has been a revelation in wireless technology: wireless mice, headphones, streaming devices, and a variety of home and office environments.  It goes without saying that wireless peripherals are so much easier to manage than wired counterparts, especially mice, that I usually have my MacBook’s bluetooth turned on. There are times, however, that I move […]

The post Turn Bluetooth On and Off from Command Line on macOS appeared first on David Walsh Blog.

Celý článek

bluetooth

Bluetooth has been a revelation in wireless technology: wireless mice, headphones, streaming devices, and a variety of home and office environments.  It goes without saying that wireless peripherals are so much easier to manage than wired counterparts, especially mice, that I usually have my MacBook’s bluetooth turned on.

There are times, however, that I move my laptop away from the mouse (OK, I admit:  the kitchen) where the bluetooth connection is still in range but with the mouse still connected, I can’t use my laptop’s touchpad, leaving me to only use my keyboard which is an annoyance.  That led me to finding blueutil, a command line utility for macOS that lets me turn Bluetooth on and off with one command!

Start by installing blueutil with HomeBrew:

brew install blueutil

The -p flag is a switch for turning bluetooth on and off:

# Turn bluetooth off
blueutil -p 0

# Turn bluetooth on
blueutil -p 1

This utility will be so helpful as I move around my house.  Since I can’t use my touchpad during these situations, I can’t turn Bluetooth off from the command bar, so a simple command like this is exactly what I need!

The post Turn Bluetooth On and Off from Command Line on macOS appeared first on David Walsh Blog.

Nahoru
Tento web používá k poskytování služeb a analýze návštěvnosti soubory cookie. Používáním tohoto webu s tímto souhlasíte. Další informace