EarbudSwitch icon indicating copy to clipboard operation
EarbudSwitch copied to clipboard

Great idea! However since the repo is inactive, here's my (limited) workaround at the moment.

Open aur3l14no opened this issue 3 years ago • 1 comments

My method only works between a PC and an Android. It does not support multiple mobile devices.

Essentially it is a script run on a PC that can kick off the earbuds from phone and connect them to PC and vice versa.

I use Tasker and Join on Android and BluetoothConnector on my MacBook.

Here's what my script looks like...

#!/bin/bash

mac () {
    echo 'Kicking off phone'
    http -q --proxy https:socks5://127.0.0.1:1080 'https://joinjoaomgcd.appspot.com/_ah/api/messaging/v1/sendPush?apikey=?????????????????&deviceNames=???????&text=disconnect%20wi-1000xm2'
    # echo 'Conneting to mac'
    BluetoothConnector --connect FF-FF-FF-FF-FF-FF --notify
} 

phone () {
    # echo 'Kicking off mac'
    BluetoothConnector --disconnect FF-FF-FF-FF-FF-FF --notify
    echo 'Connecting to phone'
    http -q --proxy https:socks5://127.0.0.1:1080 'https://joinjoaomgcd.appspot.com/_ah/api/messaging/v1/sendPush?apikey=?????????????&deviceNames=???????&text=connect%20wi-1000xm2'
}

[ $1 == '--mac' ] && mac
[ $1 == '--phone' ] && phone

And I set up my Tasker like so.

screencapture

A bit hacky but at least it works.

aur3l14no avatar Jul 30 '21 08:07 aur3l14no

Hey, great contribution!!! I want a utility where I can toggle my Bluetooth earbuds connection. Let's say, when I am watching YouTube it should be using a PC<--> earbuds connection, and when I get a call on my phone, I should be able to toggle the connection to Phone <--> earbuds. does your script help in doing that? How can I set up your script so that whenever I run it, It performs the switch effortlessly?

Thanks

ansh997 avatar Aug 24 '23 04:08 ansh997