瑙e喅鍗氶€氱綉鍗″敜閱掕摑鐗欏け鏁堛€佽摑鐗欓紶閿棤娉曞敜閱掔郴缁熴€佸敜閱抌luetoothd杩涚▼寮傚父闂
鏈満浣跨敤鐧芥灉鎷嗘満鍗″姞杞帴鍗★紝绯荤粺鐗堟湰monterey 12.4锛屾棩甯镐娇鐢ㄧ殑钃濈墮璁惧涓鸿嫻鏋滀簩浠e鎺ч紶閿€傚湪catalina鍙婁互涓嬬郴缁熸椂钃濈墮涓€鍒囨甯革紝鍗囩骇big sur鍚庤摑鐗欏紑濮嬪嚭鐜板紓甯革紝鍖呮嫭鐜板湪monterey闂渚濇棫銆傚叿浣撹〃鐜颁负锛
1.鐫$湢鏃犳硶浣跨敤钃濈墮榧犳爣閿洏鍞ら啋绯荤粺锛
2.浣跨敤鏈夌嚎榧犻敭鍙甯稿敜閱掞紝浣嗗敜閱掑悗鎵€鏈夎摑鐗欒澶囨棤娉曡繛鎺ワ紱
3.鏃犺浠€涔堟儏鍐电郴缁熶粠鐫$湢鐘舵€佸敜閱掑悗bluetoothd杩涚▼鎸佺画鍗犵敤澶ч噺cpu璧勬簮銆
褰撶劧涔嬪墠鐨勮В鍐冲姙娉曚篃寰堢畝鍗曪紝鎺ヤ竴濂楁湁绾挎垨鑰2.4G鏃犵嚎榧犳爣閿洏锛屽敜閱掓甯歌繘鍏ユ闈㈠悗锛屽叧闂摑鐗欏苟閲嶆柊鎵撳紑鎴栬€呬娇鐢ㄧ粓绔墽琛"sudo killall bluetooth"閲嶅惎bluetoothd杩涚▼鍗冲彲銆備絾鏄病鏈鏈夌嚎鎴栬€2.4G鏃犵嚎榧犳爣閿洏鏃跺氨鎶撶瀻銆
涔嬪墠鏈夌湅杩囧浗澶栦竴涓笘瀛愯鍙互浣跨敤[backcolor=var(--color-canvas-subtle)]sleepwatcher杩欎釜绋嬪簭鍦ㄥ敜閱掓椂鎵ц鑷姩閲嶅惎钃濈墮杩涚▼鏉ヨВ鍐宠繖涓棶棰橈紝鎴戜篃缈昏瘧鎼繍杩囩浉鍏冲唴瀹癸紝浣嗘槸鎯崇潃鑻规灉鍦ㄥ悗缁崌绾ф椂搴旇浼氳В鍐宠繖涓棶棰橈紝姣曠珶鐧芥灉涓婁篃鏈夊緢澶氱敤鎴峰弽搴旀湁杩欎釜闂锛屾墍浠ヨ嚜宸卞苟娌℃湁璇曡繃銆備絾鏄繃浜嗛偅涔堝鐗堟湰浜嗛棶棰樹緷鏃ц閫兼棤濂堢户缁煡璧勬枡鎵捐В鍐冲姙娉曘€備互涓嬪唴瀹逛负github涓婃壘鍒扮殑瑙e喅鍔炴硶锛屽師鐞嗕负閫氳繃[backcolor=var(--color-canvas-subtle)]sleepwatcher鍜[backcolor=var(--color-canvas-subtle)]blueutil閰嶅悎鍦ㄧ郴缁熷湪鍞ら啋鏃惰嚜鍔ㄦ墽琛岃摑鐗欒繘绋嬬殑閲嶅惎鍔ㄤ綔锛[backcolor=var(--color-canvas-subtle)]浜叉祴鏈夋晥銆傚弬鑰冨師甯栧湴鍧€锛
- https://gist.github.com/ralph089/a65840c4f5e439b90170d735a89a863f
复制代码[backcolor=var(--color-canvas-subtle)]
[backcolor=var(--color-canvas-subtle)] 瀹炴柦姝ラ锛
[backcolor=var(--color-canvas-subtle)]
[backcolor=var(--color-canvas-subtle)] 涓€锛氬畨瑁卙omebrew锛堜笉鐭ラ亾homebrew鏄粈涔堣嚜宸卞幓鍋氬姛璇撅級
鎵撳紑缁堢杈撳叆浠ヤ笅鍐呭骞舵墽琛岀洿鍒板畨瑁呭畬姣 锛
- /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
复制代码
娉細homebrew瀹樼綉鏈夎缁嗗畨瑁呮楠https://brew.sh/index_zh-cn
浜岋細瀹夎sleepwatcher鍜宐lueutil
閫氳繃姝ラ涓€瀹夎鐨刪omebrew鏉ュ畨瑁卻leepwatcher鍜宐lueutil绋嬪簭锛氬鍒朵笅鏂逛唬鐮佸埌缁堢鎵ц
- brew install sleepwatcherbrew install blueutil
复制代码
浜岋細閰嶇疆鍞ら啋鍚庤嚜鍔ㄦ墽琛岀殑鑴氭湰.wakeup鍐呭
1.鍦ㄧ粓绔墽琛屼互涓嬪唴瀹逛娇鐢╪ano缂栬緫鍣ㄥ.wakeup鑴氭湰鍐呭杩涜淇敼锛
2.鍦ㄧ獥鍙d腑鏈€涓婄杈撳叆浠ヤ笅鍐呭锛
- #!/bin/bash## Restart Bluetooth Module on Mac OS X## Requires Blueutil to be installed: http://brewformulas.org/blueutilBT="/usr/local/bin/blueutil"log() { echo "$@" logger -p notice -t bt_restarter "$@"}err() { echo "$@" >&2 logger -p error -t bt_restarter "$@"}if [ -f "$BT" ]; then if [[ $("$BT" -p) == *1 ]]; then echo "Bluetooth on, restarting ..." ($("$BT" -p 0) &> /dev/null && echo "Bluetooth Module stopped") || (err "Couldn't stop Bluetooth Module" && exit 1) ($("$BT" -p 1) &> /dev/null && echo "Bluetooth Module started") || (err "Couldn't start Bluetooth Module" && exit 1) log "Successfully restarted Bluetooth" && exit 0 else echo "Bluetooth is off, nothing to do ..." fielse err "Couldn't find blueutil, please install http://brewformulas.org/blueutil" && exit 1fi
复制代码 鎸塩trl+x 锛坢ac閿洏鎸塩ontrol+x锛夐€€鍑虹紪杈戯紝缁堢浼氳闂槸鍚︿繚瀛橈紝鎸塝閫夋嫨淇濆瓨
3.鏇存敼.wakeup鑴氭湰鏉冮檺锛
鍦ㄧ粓绔墽琛屼互涓嬪懡浠ゆ洿鏀硅剼鏈潈闄
涓夛細浣跨敤brew services鏉ヨ缃畇leepwacher寮€鏈鸿嚜鍚
[backcolor=var(--color-canvas-subtle)] 鍦ㄧ粓绔墽琛屼互涓嬪懡浠わ細
- brew services start sleepwatcher
复制代码 绯荤粺浼氳烦鍑哄畨鍏ㄤ笌闅愮璁剧疆锛屽湪杈撳叆鐩戝惉椤圭洰涓嬪皢鐩稿簲椤圭洰鍕鹃€変笂鍗冲彲銆
蹇幓璇曡瘯鍚э紒锛 |