diff --git a/Sources/scripts/.DS_Store b/Sources/scripts/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/Sources/scripts/.DS_Store differ diff --git a/Sources/scripts/connector.sh b/Sources/scripts/connector.sh index 8a6a5a6..08b2449 100644 --- a/Sources/scripts/connector.sh +++ b/Sources/scripts/connector.sh @@ -1,13 +1,19 @@ SYSTEM_PROFILER=$(system_profiler SPBluetoothDataType 2>/dev/null) MAC_ADDRESS=$(grep -B8 "Minor Type: Headphones" <<< "${SYSTEM_PROFILER}" | awk '/Address/{ lastline = $2 } END { print lastline }') -CONNECTED=$(grep -A10 "${MAC_ADDRESS}" <<< "${SYSTEM_PROFILER}" | awk '/Services:/{print 1}') + +if [[ $(arch) == 'arm64' ]]; then + CONNECTED=$(resources/binaries/blueutil_arm64 --is-connected ${MAC_ADDRESS}) +else + CONNECTED=$(resources/binaries/blueutil_i386 --is-connected ${MAC_ADDRESS}) +fi + NAME=$(grep -B9 "Minor Type: Headphones" <<< "${SYSTEM_PROFILER}" | awk '/AirPods/{ print }' | sed -e 's/^ *//' -e 's/://') -if [[ "${CONNECTED}" ]]; then +if [[ "${CONNECTED}" == 1 ]]; then status="disconnect ${NAME}" # disconnect doesn't work on Monterey if we don't force notify LMAO - arg="--disconnect ${MAC_ADDRESS//:/-} --notify" + arg="--disconnect ${MAC_ADDRESS//:/-}" else status="connect ${NAME}" arg="--connect ${MAC_ADDRESS//:/-}" diff --git a/Workflow/.DS_Store b/Workflow/.DS_Store index 5008ddf..2924530 100644 Binary files a/Workflow/.DS_Store and b/Workflow/.DS_Store differ