Last active
November 4, 2019 11:22
-
-
Save b00t0x/b3f6bc4f7c0da3bbe97143e6f6bab848 to your computer and use it in GitHub Desktop.
change cpu name script for macOS 10.15 Catalina
This file contains 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
#!/bin/bash | |
locale=`defaults read -g AppleLocale | cut -c 1-2` | |
cpu_name=`sysctl -n machdep.cpu.brand_string | sed -e 's/ *$//'` | |
target="/System/Library/PrivateFrameworks/AppleSystemInfo.framework/Versions/A/Resources/${locale}.lproj/AppleSystemInfo.strings" | |
if [ $# -ge 1 ]; then | |
cpu_name=$1 | |
fi | |
echo "Locale: $locale" | |
echo "New Name: $cpu_name" | |
read -p "ok? (y/n): " yn | |
case $yn in | |
[yY]) | |
sudo mount -uw / && | |
sudo cp $target $target.`date +%Y%m%d%H%M` && | |
sudo plutil -replace IntelSpeedAndTypeFormat -string "%1\$@ $cpu_name" $target | |
echo "Finished." | |
;; | |
*) echo "Aborted." | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment