From 7568d76d958db06761b6a7cf973fbb023fe4e3b9 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Fri, 16 Oct 2020 20:22:33 +0200 Subject: Add icon replacement script Copies all icon files into `CoreTypes.bundle` and resets the icon cache. The computer will need to be restarted, or the user account re-logged-into in order for the changes to take effect. Leveraged the following scripts for the copy semantics and icon cache clearing instructions: - https://github.com/DocSystem/bigsur-icons-for-catalina/blob/14b8c406db69f6c48639e8dfd91b4c4e1cc9bf84/applyIcons.command - https://github.com/w0lfschild/ClassicFolders/blob/9221de592915aee3eb11dc471db95645e97bc566/classic_folders.command --- icons.sh | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100755 icons.sh diff --git a/icons.sh b/icons.sh new file mode 100755 index 0000000..7f0ccbf --- /dev/null +++ b/icons.sh @@ -0,0 +1,73 @@ +#!/bin/sh + +CORE_TYPES=/System/Library/CoreServices/CoreTypes.bundle +GENERIC_ICONS=/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources + +REPLACEMENT="$(cd "$(dirname "$0")" && pwd)/Icons" + +# Authenticate +sudo -v + +# Backup CoreTypes.bundle +sudo cp -R "$CORE_TYPES" "${CORE_TYPES}.backup" + +# Set icons +sudo cp -f "$REPLACEMENT/ApplicationsFolderIcon.icns" "$GENERIC_ICONS/" +sudo cp -f "$REPLACEMENT/BD-R.icns" "$GENERIC_ICONS/" +sudo cp -f "$REPLACEMENT/BD-RE.icns" "$GENERIC_ICONS/" +sudo cp -f "$REPLACEMENT/BD.icns" "$GENERIC_ICONS/" +sudo cp -f "$REPLACEMENT/BurnableFolderIcon.icns" "$GENERIC_ICONS/" +sudo cp -f "$REPLACEMENT/BurningIcon.icns" "$GENERIC_ICONS/" +sudo cp -f "$REPLACEMENT/CD-R.icns" "$GENERIC_ICONS/" +sudo cp -f "$REPLACEMENT/CD-RW.icns" "$GENERIC_ICONS/" +sudo cp -f "$REPLACEMENT/CD.icns" "$GENERIC_ICONS/" +sudo cp -f "$REPLACEMENT/ConnectToIcon.icns" "$GENERIC_ICONS/" +sudo cp -f "$REPLACEMENT/DVD+R.icns" "$GENERIC_ICONS/" +sudo cp -f "$REPLACEMENT/DVD+RW.icns" "$GENERIC_ICONS/" +sudo cp -f "$REPLACEMENT/DVD-R.icns" "$GENERIC_ICONS/" +sudo cp -f "$REPLACEMENT/DVD-RAM.icns" "$GENERIC_ICONS/" +sudo cp -f "$REPLACEMENT/DVD-RW.icns" "$GENERIC_ICONS/" +sudo cp -f "$REPLACEMENT/DVD.icns" "$GENERIC_ICONS/" +sudo cp -f "$REPLACEMENT/DesktopFolderIcon.icns" "$GENERIC_ICONS/" +sudo cp -f "$REPLACEMENT/DeveloperFolderIcon.icns" "$GENERIC_ICONS/" +sudo cp -f "$REPLACEMENT/DocumentsFolderIcon.icns" "$GENERIC_ICONS/" +sudo cp -f "$REPLACEMENT/DownloadsFolder.icns" "$GENERIC_ICONS/" +sudo cp -f "$REPLACEMENT/DropFolderBadgeIcon.icns" "$GENERIC_ICONS/" +sudo cp -f "$REPLACEMENT/EjectMediaIcon.icns" "$GENERIC_ICONS/" +sudo cp -f "$REPLACEMENT/External.icns" "$GENERIC_ICONS/" +sudo cp -f "$REPLACEMENT/FinderIcon.icns" "$GENERIC_ICONS/" +sudo cp -f "$REPLACEMENT/FireWireHD.icns" "$GENERIC_ICONS/" +sudo cp -f "$REPLACEMENT/FullTrashIcon.icns" "$GENERIC_ICONS/" +sudo cp -f "$REPLACEMENT/GenericAirDiskIcon.icns" "$GENERIC_ICONS/" +sudo cp -f "$REPLACEMENT/GenericApplicationIcon.icns" "$GENERIC_ICONS/" +sudo cp -f "$REPLACEMENT/GenericFileServerIcon.icns" "$GENERIC_ICONS/" +sudo cp -f "$REPLACEMENT/GenericFolderIcon.icns" "$GENERIC_ICONS/" +sudo cp -f "$REPLACEMENT/GenericNetworkIcon.icns" "$GENERIC_ICONS/" +sudo cp -f "$REPLACEMENT/GroupFolder.icns" "$GENERIC_ICONS/" +sudo cp -f "$REPLACEMENT/HomeFolderIcon.icns" "$GENERIC_ICONS/" +sudo cp -f "$REPLACEMENT/Internal.icns" "$GENERIC_ICONS/" +sudo cp -f "$REPLACEMENT/LibraryFolderIcon.icns" "$GENERIC_ICONS/" +sudo cp -f "$REPLACEMENT/MovieFolderIcon.icns" "$GENERIC_ICONS/" +sudo cp -f "$REPLACEMENT/MusicFolderIcon.icns" "$GENERIC_ICONS/" +sudo cp -f "$REPLACEMENT/OpenFolderIcon.icns" "$GENERIC_ICONS/" +sudo cp -f "$REPLACEMENT/PicturesFolderIcon.icns" "$GENERIC_ICONS/" +sudo cp -f "$REPLACEMENT/PrivateFolderBadgeIcon.icns" "$GENERIC_ICONS/" +sudo cp -f "$REPLACEMENT/PublicFolderIcon.icns" "$GENERIC_ICONS/" +sudo cp -f "$REPLACEMENT/Removable.icns" "$GENERIC_ICONS/" +sudo cp -f "$REPLACEMENT/SitesFolderIcon.icns" "$GENERIC_ICONS/" +sudo cp -f "$REPLACEMENT/SmartFolderIcon.icns" "$GENERIC_ICONS/" +sudo cp -f "$REPLACEMENT/SystemFolderIcon.icns" "$GENERIC_ICONS/" +sudo cp -f "$REPLACEMENT/TimeMachine.icns" "$GENERIC_ICONS/" +sudo cp -f "$REPLACEMENT/ToolbarDeleteIcon.icns" "$GENERIC_ICONS/" +sudo cp -f "$REPLACEMENT/ToolbarInfo.icns" "$GENERIC_ICONS/" +sudo cp -f "$REPLACEMENT/TrashIcon.icns" "$GENERIC_ICONS/" +sudo cp -f "$REPLACEMENT/USBHD.icns" "$GENERIC_ICONS/" +sudo cp -f "$REPLACEMENT/UsersFolderIcon.icns" "$GENERIC_ICONS/" +sudo cp -f "$REPLACEMENT/UtilitiesFolder.icns" "$GENERIC_ICONS/" +sudo cp -f "$REPLACEMENT/iDiskGenericIcon.icns" "$GENERIC_ICONS/" +sudo cp -f "$REPLACEMENT/iDiskUserIcon.icns" "$GENERIC_ICONS/" + +# Clear icon cache +sudo find /private/var/folders/ -name 'com.apple.dock.iconcache' -delete +sudo find /private/var/folders/ -name 'com.apple.iconservices' -delete +sudo mv /Library/Caches/com.apple.iconservices.store $HOME/.Trash/ -- cgit v1.2.3