Skip to content

Instantly share code, notes, and snippets.

@b00t0x
Last active November 4, 2019 11:22
Show Gist options
  • Save b00t0x/b3f6bc4f7c0da3bbe97143e6f6bab848 to your computer and use it in GitHub Desktop.
Save b00t0x/b3f6bc4f7c0da3bbe97143e6f6bab848 to your computer and use it in GitHub Desktop.
change cpu name script for macOS 10.15 Catalina
#!/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