Created
September 18, 2025 18:44
-
-
Save Aeron/5dcfb7ff2b6c29c5d2c39dd726e40689 to your computer and use it in GitHub Desktop.
A simple shell script to switch back and forth between older Launchpad and newer Spotlight on macOS 26+.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| IFS=$'\n\t' | |
| # Checking whether the platform is right | |
| [ "$(uname -s)" = "Darwin" ] || { echo "Not macOS (Darwin)" >&2; exit 1; } | |
| # Checking whether the version is right | |
| version=$(sw_vers -productVersion) | |
| [ "${version%%.*}" -ge 26 ] || { echo "Require macOS 26+" >&2; exit 1; } | |
| # Setting the desired target/domain, key, and dictionary subkey | |
| target='/Library/Preferences/FeatureFlags/Domain/SpotlightUI.plist' | |
| key='SpotlightPlus' | |
| sub='Enabled' | |
| # Creating the target directory if it does not exist | |
| sudo mkdir -p -- "$(dirname -- "$target")" | |
| # Switching the current value if there is one | |
| default='true' | |
| current=$(plutil -extract "$key.$sub" raw -- "$target" 2>/dev/null || echo "$default") | |
| if [ "$current" = "$default" ]; then | |
| default='false' | |
| echo 'Switching back to older Launchpad' | |
| else | |
| echo 'Switching back to newer Spotlight' | |
| fi | |
| sudo defaults write "$target" "$key" -dict "$sub" -bool "$default" | |
| echo 'Please, restart your Mac now' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment