Last active
January 21, 2023 09:59
-
-
Save niccolomineo/475ab56cf51288f8456998824251ca73 to your computer and use it in GitHub Desktop.
Toggles Bluetooth on Mac Os. Requires blueutil utility.
This file contains 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
on run {input, parameters} | |
tell application "System Events" | |
set current_status to (do shell script "eval $(/usr/libexec/path_helper -s); blueutil | grep 'Power:' | cut -c8-") | |
if current_status = "0" then | |
do shell script "eval $(/usr/libexec/path_helper -s); blueutil -p 1" | |
beep | |
delay 0.25 | |
beep | |
else | |
do shell script "eval $(/usr/libexec/path_helper -s); blueutil -p 0" | |
end if | |
end tell | |
return input | |
end run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment