If you want to automate connecting and disconnecting your Airpods to your laptop clicking a couple of buttons then you are in the right place.
Here you'll find the easy way to do it.
Just follow the steps.
- Change the content of the variable
airpods_address
in fileconfig.py
to your device's address.
How to check the address of your device?
Just connect your device routine way and run this command bluetoothctl info
in the console. The first string will be the address of your device.
Write out this code in the config.py
airpods_address = 'ID of your device'
- Open the directory where is the repo
- Use the command to know the path to the file
readlink -f scr/main.py
- Open file
airpodsPro.sh
and change the path to yours Here
python3 /home/connect_airpods_python/scr/main.py
Execute this command to make the script runnable for you : chmod u+x airpodsPro.sh
You can do use UI:
Settings -> Keyboard -> Keyboard Shortcuts -> scroll down -> Custom Shortcuts