Skip to content

Commit

Permalink
Merge pull request #3 from davosian/master
Browse files Browse the repository at this point in the history
Minor improvements and fixes
  • Loading branch information
godbout authored Mar 25, 2022
2 parents cf0f6d2 + 417515a commit 34ca30a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/connector.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
SYSTEM_PROFILER=$(system_profiler SPBluetoothDataType 2>/dev/null)

MAC_ADDRESS=$(grep -B8 "Minor Type: Headphones" <<< "${SYSTEM_PROFILER}" | awk '/Address/{print $2}')
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}')
NAME=$(grep -B9 "Minor Type: Headphones" <<< "${SYSTEM_PROFILER}" | awk '/AirPods/{ print }' | sed -e 's/^ *//' -e 's/://')

Expand Down

0 comments on commit 34ca30a

Please sign in to comment.