Created
September 19, 2022 06:55
-
-
Save Sy3Omda/0d1c33e520071f0e37c4435f6a80326f to your computer and use it in GitHub Desktop.
Fix bluetooth auto connect device and auto set speaker output
This file contains hidden or 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
#!/usr/bin/env bash | |
# This to fix some issue realted to bluetooth auto connect avialable devices and auto set speaker to that device | |
# bluetoothctl devices # To get MAC of bluetooth devices. | |
echo "connect 00:00:00:00:00:00" | bluetoothctl >/dev/null # then Auto connect bluetooth | |
# you can put this in bash script and make cron job OR simply add it in bashrc || zshrc file to execute every start of terminal | |
# Then set default speaker to bluetooth simply run as sudo | |
sudo tee /etc/pulse/default.pa << EOF > /dev/null | |
.ifexists module-bluetooth-discover.so | |
load-module module-bluetooth-discover | |
load-module module-switch-on-connect # Add this | |
.endif | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment