Skip to content

This AutoHotkey script aims to automatically connect a specific Bluetooth device to your Windows computer. It is particularly useful for devices like Bluetooth headphones or speakers, enabling quick and hassle-free connection.

License

Notifications You must be signed in to change notification settings

ChromuSx/BluetoothDeviceConnector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

30 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽง BluetoothDeviceConnector

BluetoothDeviceConnector
AutoHotkey Windows Bluetooth

Platform MIT License Version Stars

GitHub Sponsors Ko-fi Buy Me a Coffee PayPal

๐Ÿ”— BluetoothDeviceConnector is a script created in AutoHotkey that allows you to automatically connect a specific Bluetooth device, such as "AirPods Pro". This script uses the Windows Bluetooth Control Panel to find and connect the specified device.

Features โœจ

  • Automatically searches for the specified Bluetooth device.
  • Connects the device to Handsfree services (for voice communication) and AudioSink services (for music streaming).
  • Provides visual notifications for success or errors.
  • ๐ŸŽฎ Stream Deck Integration: One-click Bluetooth connection directly from your Elgato Stream Deck!

๐ŸŽฎ Stream Deck Plugin

This project includes an official Stream Deck plugin that lets you connect your Bluetooth devices with a single button press!

Quick Start

  1. Navigate to streamdeck-plugin/ directory
  2. Follow the Stream Deck Plugin README for installation
  3. Add the "Connect Bluetooth Device" action to your Stream Deck
  4. Configure your device name and connect instantly!

Features

  • โœ… One-click Bluetooth connection
  • โš™๏ธ Configurable device names
  • ๐ŸŽฏ Visual feedback (success/error indicators)
  • ๐Ÿš€ Fast and lightweight

โ†’ Learn more about the Stream Deck plugin

Requirements ๐Ÿ› ๏ธ

  • Operating System: Windows
  • Libraries: The script uses the Bluetooth control library provided by Windows (Bthprops.cpl).
  • System Icon: The script uses a system icon (requires the path C:\WINDOWS\system32\netshell.dll).
  • AutoHotkey v2: Must be installed to run this script. Download AutoHotkey v2.

How to Use ๐Ÿš€

  1. Install AutoHotkey v2: Make sure AutoHotkey v2 is installed.
  2. Copy the code: Copy the script code into BluetoothDeviceConnector.ahk.
  3. Run the script: Double-click the .ahk file to run the script.

Configuration โš™๏ธ

Modify the deviceName variable at the beginning of the script to match the name of the Bluetooth device you want to connect. By default, it is set to "AirPods Pro":

deviceName := "AirPods Pro"

Change this value to connect other devices.

How It Works ๐Ÿง 

The script uses a system library (Bthprops.cpl) to search for the desired Bluetooth device. If the device is found, it will attempt to activate two services:

  • Handsfree: Connection for voice communications (e.g., calls).
  • AudioSink: Connection for audio streaming (e.g., music).

A confirmation message will be displayed if the device is successfully connected.

Notifications ๐Ÿ””

The script will display notifications in case of:

  • No Bluetooth device found.
  • Device successfully connected.

Limitations โš ๏ธ

  • The script is designed to connect to a specific device. It does not support multiple connections or advanced Bluetooth device management.
  • It works only on Windows, using the Bluetooth libraries provided by the operating system.

Customization ๐Ÿ› ๏ธ

You can customize the script to include more devices or add extra functionality. AutoHotkey is a versatile scripting language that allows you to automate many operations on Windows.

Contributions ๐Ÿค

Contributions and improvements are welcome! Feel free to submit a pull request or report any issues on GitHub.

Support the Project ๐Ÿ’–

This project is completely free and open source. If you find it useful and would like to support its continued development and updates, consider making a donation. Your support helps keep the project alive and motivates me to add new features and improvements!

GitHub Sponsors Ko-fi Buy Me a Coffee PayPal

Every contribution, no matter how small, is greatly appreciated! โค๏ธ

License ๐Ÿ“œ

This project is licensed under the MIT License. Feel free to use, modify, and distribute the script as you like.