Created
March 30, 2017 04:34
-
-
Save m4yfield/21b9d9e2472bcba8821b7808d7904fa4 to your computer and use it in GitHub Desktop.
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
this will force the connection to your bluetooth headphones: | |
sudo nano /bin/connect-bluetooth.sh | |
In that file add | |
#!/bin/bash | |
sudo bluetoothctl << EOF | |
power on | |
connect [MAC Address] | |
exit | |
EOF | |
Save that file. | |
Make it executable | |
sudo chmod +x /bin/connect-bluetooth.sh | |
Then create a new file | |
sudo nano /etc/systemd/system/connect-bluetooth.service | |
Add this text: | |
[Unit] | |
Description=Connect Bluetooth | |
[Service] | |
Type=oneshot | |
ExecStart=/bin/connect-bluetooth.sh | |
[Install] | |
WantedBy=multi-user.target | |
Save that file. | |
Then run this command to enable that process | |
sudo systemctl enable /etc/systemd/system/connect-bluetooth.service |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment