All Projects → lapfelix → Bluetoothconnector

lapfelix / Bluetoothconnector

Licence: mit
Simple macOS CLI to connect/disconnect a Bluetooth device. Useful for AirPods or other Bluetooth headphones.

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Bluetoothconnector

Multipeer
📱📲 A wrapper for the MultipeerConnectivity framework for automatic offline data transmission between devices
Stars: ✭ 170 (-56.19%)
Mutual labels:  bluetooth, swift-package-manager
Electron Localshortcut
Add keyboard shortcuts locally to a BrowserWindow instance, without using a Menu
Stars: ✭ 366 (-5.67%)
Mutual labels:  shortcut
Lightning
A Swift Multiplatform Single-threaded Non-blocking Web and Networking Framework
Stars: ✭ 312 (-19.59%)
Mutual labels:  swift-package-manager
Blegattcoroutines
Functional Bluetooth GATT for Android (all the meanings)
Stars: ✭ 343 (-11.6%)
Mutual labels:  bluetooth
React Native System Setting
A library to access system setting, and change it easily. eg: volume, brightness, wifi
Stars: ✭ 319 (-17.78%)
Mutual labels:  bluetooth
Ios Pods Dfu Library
OTA DFU Library for Mac and iOS, compatible with nRF5x SoCs
Stars: ✭ 349 (-10.05%)
Mutual labels:  bluetooth
Esp32 Ble2mqtt
A BLE to MQTT bridge running on an ESP32
Stars: ✭ 301 (-22.42%)
Mutual labels:  bluetooth
Xcbeautify
A little beautifier tool for xcodebuild
Stars: ✭ 372 (-4.12%)
Mutual labels:  swift-package-manager
Python Keyboard
A hand-wired USB & Bluetooth keyboard powered by Python and more
Stars: ✭ 360 (-7.22%)
Mutual labels:  bluetooth
Sweetblue
BLE on Android, the easy way. THIS IS NOW DEPRECATED. Please visit website for info on new versions.
Stars: ✭ 339 (-12.63%)
Mutual labels:  bluetooth
Androidshortcuts
Example app for shortcuts
Stars: ✭ 335 (-13.66%)
Mutual labels:  shortcut
Magnet
Customize global hotkeys in macOS.
Stars: ✭ 324 (-16.49%)
Mutual labels:  shortcut
Coderyi.github.io
Don't fork! coderyi's blog,about iOS ,CS and my code life.
Stars: ✭ 349 (-10.05%)
Mutual labels:  bluetooth
Pixel Picker
A tiny menu bar application that helps you pick colours from your screen! 🔍✨
Stars: ✭ 318 (-18.04%)
Mutual labels:  shortcut
Internalblue
Bluetooth experimentation framework for Broadcom and Cypress chips.
Stars: ✭ 373 (-3.87%)
Mutual labels:  bluetooth
Swiftweekly.github.io
A community-driven weekly newsletter about Swift.org
Stars: ✭ 305 (-21.39%)
Mutual labels:  swift-package-manager
Swift5 Module Template
An opinionated starting point for awesome, reusable Swift 5 modules
Stars: ✭ 331 (-14.69%)
Mutual labels:  swift-package-manager
Ice
❄️ A developer friendly package manager for Swift; 100% compatible with Swift Package Manager
Stars: ✭ 344 (-11.34%)
Mutual labels:  swift-package-manager
Mac Precision Touchpad
Windows Precision Touchpad Driver Implementation for Apple MacBook / Magic Trackpad
Stars: ✭ 5,107 (+1216.24%)
Mutual labels:  bluetooth
Stats
macOS system monitor in your menu bar
Stars: ✭ 7,134 (+1738.66%)
Mutual labels:  bluetooth
screen shot 2019-02-16 at 11 30 23 am

BluetoothConnector

Simple macOS CLI to connect/disconnect a Bluetooth device. I made it to easily connect my BeatsX earbuds (I thought the W1 chip would make the switch from my iPhone to my Mac seamless, but we're not there yet, apparently). There's probably a program that already does this but I didn't find it.

You can download a compiled version here: https://github.com/lapfelix/BluetoothConnector/releases

If you have issues running the compiled binary (permission denied error), try running this command in Terminal: chmod +x /path/to/BluetoothConnector

Installation

Homebrew

brew install bluetoothconnector

Mint

mint install lapfelix/BluetoothConnector

Manually

swift package update
swift build -c release
mv .build/release/BluetoothConnector /usr/local/bin/BluetoothConnector

Usage

Running

Replace 00-00-00-00-00-00 with your device's MAC address. You can get it by alt-clicking the Bluetooth menu icon or by running BluetoothConnector without any arguments

To toggle the connection (connect/disconnect) and be notified about it
BluetoothConnector 00-00-00-00-00-00 --notify
To connect and be notified about it
BluetoothConnector --connect 00-00-00-00-00-00 --notify
BluetoothConnector -c 00-00-00-00-00-00 --notify
To disconnect
BluetoothConnector --disconnect 00-00-00-00-00-00
BluetoothConnector -d 00-00-00-00-00-00
Notification Center
screen shot 2019-01-27 at 4 51 16 pm

You can have BluetoothConnector send a notification to say what it did (connect or disconnect), if the action succeeded or get an error description if something goes wrong

BluetoothConnector 00-00-00-00-00-00 --notify

To reduce Notification Center pollution, I'd recommend turning off "Show in Notification Center" for the Script Editor app in the Notifications system preferences:

screen shot 2019-01-27 at 4 51 16 pm

With Automator to bind a shortcut to it (this is how I'm using it)

I included an Automator workflow service that calls BluetoothConnector from /usr/local/bin to make it easier to run BluetoothConnector with a keyboard workflow (this is how I'm using it).

Then open the Automator workflow and you should get a prompt to install it (don't forget to change the MAC address). To bind a shortcut to the Automator service, launch System Preferences and Go to Keyboard > Shortcuts > Services, find your service and add a shortcut to it.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].