Created
December 21, 2023 20:14
-
-
Save aymenkrifa/7e76c63a41501659b863bb1d74485153 to your computer and use it in GitHub Desktop.
Shell script for AirPods connect in Ubuntu system
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
MAC_ADDRESS="XX:XX:XX:XX:XX:XX" # Replace with your AirPods' MAC address | |
# Check if AirPods are already connected | |
if bluetoothctl info $MAC_ADDRESS | grep -q "Connected: yes"; then | |
notify-send "AirPods are already connected." | |
else | |
# Connect to AirPods | |
bluetoothctl connect $MAC_ADDRESS | |
notify-send "Connecting to AirPods..." | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment