Skip to content

Instantly share code, notes, and snippets.

@leaysgur
Created February 1, 2017 02:48
Show Gist options
  • Save leaysgur/4f3c4977790f3f8d67467ea33ce6018f to your computer and use it in GitHub Desktop.
Save leaysgur/4f3c4977790f3f8d67467ea33ce6018f to your computer and use it in GitHub Desktop.
Toggle Bluetooth power status.
#!/bin/sh
#
# BluetoothのON/OFFをtoggle実行するスクリプト
#
# http://brewformulas.org/Blueutil に依存してます。
#
cur=($(blueutil power))
if [ "$cur" -eq "1" ]
then
# echo "Bluetooth: on -> off"
blueutil power 0
else
# echo "Bluetooth: off -> on"
blueutil power 1
fi
@leaysgur
Copy link
Author

leaysgur commented Feb 1, 2017

Automatorでアプリ化するなら、

export PATH=/usr/local/bin:$PATH

とかしないとblueutilが見つからなくて動かない。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment