From 9592349083fa6f961c37d23ea8a6d23cc7029bfd Mon Sep 17 00:00:00 2001 From: zumbiepig <121742281+zumbiepig@users.noreply.github.com> Date: Thu, 2 Jan 2025 13:14:46 -0800 Subject: [PATCH 1/2] 'resetlaunchpad' alias to reset Launchpad layout --- plugins/macos/macos.plugin.zsh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/macos/macos.plugin.zsh b/plugins/macos/macos.plugin.zsh index b951a289f..84bed2658 100644 --- a/plugins/macos/macos.plugin.zsh +++ b/plugins/macos/macos.plugin.zsh @@ -17,6 +17,9 @@ function ofd { alias showfiles="defaults write com.apple.finder AppleShowAllFiles -bool true && killall Finder" alias hidefiles="defaults write com.apple.finder AppleShowAllFiles -bool false && killall Finder" +# Reset Launchpad layout (defaults method does not work in MacOS 15.2+) +alias resetlaunchpad='defaults write com.apple.dock ResetLaunchPad -bool true && rm -rf /private/$(getconf DARWIN_USER_DIR)/com.apple.dock.launchpad && killall Dock' + # Bluetooth restart function btrestart() { sudo kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport From c86610aa4103a5c350161c9c5c1fad3be290153d Mon Sep 17 00:00:00 2001 From: zumbiepig <121742281+zumbiepig@users.noreply.github.com> Date: Thu, 2 Jan 2025 14:12:58 -0800 Subject: [PATCH 2/2] check macos version before setting alias --- plugins/macos/macos.plugin.zsh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/macos/macos.plugin.zsh b/plugins/macos/macos.plugin.zsh index 84bed2658..ceb158dec 100644 --- a/plugins/macos/macos.plugin.zsh +++ b/plugins/macos/macos.plugin.zsh @@ -17,8 +17,12 @@ function ofd { alias showfiles="defaults write com.apple.finder AppleShowAllFiles -bool true && killall Finder" alias hidefiles="defaults write com.apple.finder AppleShowAllFiles -bool false && killall Finder" -# Reset Launchpad layout (defaults method does not work in MacOS 15.2+) -alias resetlaunchpad='defaults write com.apple.dock ResetLaunchPad -bool true && rm -rf /private/$(getconf DARWIN_USER_DIR)/com.apple.dock.launchpad && killall Dock' +# Reset Launchpad layout (defaults method does not work in MacOS Sequoia and onward) +if [[ "$(sw_vers --productVersion)" -ge 15.0 ]]; then + alias resetlaunchpad='rm -rf /private/$(getconf DARWIN_USER_DIR)/com.apple.dock.launchpad && killall Dock' +else + alias resetlaunchpad='defaults write com.apple.dock ResetLaunchPad -bool true && killall Dock' +fi # Bluetooth restart function btrestart() {