How to programmatically turn on and off bluetooth, wifi and sound on OSX

前端 未结 1 1030
刺人心
刺人心 2021-01-16 15:07

How can I turn on and off the wifi and bluetooth connections, change the sound and brightness levels on OSX?

相关标签:
1条回答
  • 2021-01-16 15:21

    Simply execute the right commands :-) You could probably even use AppleScript.

    • Wifi: ifconfig en1 off or networksetup -setairportpower off
    • Bluetooth: You'll probably need http://www.frederikseiffert.de/blueutil/
    • Brightness: I found this c utility for you: http://mattdanger.net/2008/12/adjust-mac-os-x-display-brightness-from-the-terminal/

    It's probably all possible without exec() calls, but it's easier this way.

    0 讨论(0)
提交回复
热议问题