From 23f825ff648b5b149c8c145829031cff2d59ca89 Mon Sep 17 00:00:00 2001 From: Paul Frederiksen Date: Tue, 7 Oct 2025 16:33:28 -0700 Subject: [PATCH] Simplify btrestart to use pkill bluetoothd approach - Replace complex launchctl approach with simple pkill bluetoothd - macOS automatically restarts bluetoothd when killed - Much more maintainable and future-proof - Reduces from 6 commands to 1 command - Less prone to OS changes and service discovery issues - Cleaner, more readable implementation Resolves #10934 --- plugins/macos/macos.plugin.zsh | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/plugins/macos/macos.plugin.zsh b/plugins/macos/macos.plugin.zsh index df2e0cde7..e0bfd045a 100644 --- a/plugins/macos/macos.plugin.zsh +++ b/plugins/macos/macos.plugin.zsh @@ -19,17 +19,9 @@ alias hidefiles="defaults write com.apple.finder AppleShowAllFiles -bool false & # Bluetooth restart function btrestart() { - # Kill audio and bluetooth processes - pgrep audio | xargs sudo kill 2>/dev/null || true - pgrep bluetooth | xargs sudo kill 2>/dev/null || true - - # Restart bluetooth services using launchctl - sudo launchctl list | grep -i blue | awk '{ print $3 }' | xargs sudo launchctl stop 2>/dev/null || true - sudo launchctl list | grep -i blue | awk '{ print $3 }' | xargs sudo launchctl start 2>/dev/null || true - - # Restart audio services using launchctl - sudo launchctl list | grep -i audio | awk '{ print $3 }' | xargs sudo launchctl stop 2>/dev/null || true - sudo launchctl list | grep -i audio | awk '{ print $3 }' | xargs sudo launchctl start 2>/dev/null || true + echo "Restarting Bluetooth daemon..." + sudo pkill bluetoothd + echo "Bluetooth daemon restarted." } function _omz_macos_get_frontmost_app() {