Wednesday 29 April 2020

Get Rid of Generic White Icons in macOS Catalina and Restore Default Blue Folder Icons

Get Rid of Generic White Icons in macOS Catalina and Restore Default Blue Folder Icons is on Bill"s Bible Basics Blog at https://www.billkochman.com/Blog/get-rid-of-generic-white-icons-in-macos-catalina-and-restore-default-blue-folder-icons/


https://www.billkochman.com/Blog/get-rid-of-generic-white-icons-in-macos-catalina-and-restore-default-blue-folder-icons/


Have you recently upgraded to macOS Catalina — a.k.a. macOS 10.15.0 — and discovered that you suddenly have dozens, hundreds or possibly even thousands of folders with a white generic document icon? I encountered the same problem; and even though I tried every Terminal command that I could find on the Internet in my endeavors to fix all of those broken icons in one fell swoop, it was all to no avail. No matter what I tried, nothing seemed to work. Those generic icons resisted every attempt to eradicate them. As a last desperate act, I even went so far as to re-install Catalina on top of my Catalina installation. In other words, this was not a clean install in which one starts from scratch. I was so hopeful that the re-install would work. But, alas, after taking about five hours to complete the installation, those pesky white generic document icons were still there. Oh gosh! What to do?! I was not a happy camper.


Seeking help in the Apple Support Communities — https://discussions.apple.com/community/mac_os/catalina — I became involved in a thread where other Mac users were experiencing the same exact problem. Some solutions were offered — and a few of them do work — but they are impractical if you happen to have hundreds, or even thousands, of those generic icons populating your hard drive, because the process can be long and very tedious, as I found out. These include, for example, the following:


1. Create a new folder with the same name as the affected folder, and then drag all of the files and folders from the affected folder into the new folder.


2. Use command-i — a.k.a. “Get Info” — on a good folder which has the blue folder icon, and copy its icon from the top left corner of the “Get Info” window. Then, do a “Get Info” on an affected folder, and paste the blue folder icon onto the affected folder icon in the top left corner of the “Get Info” window.


As I said, methods such as these do work; but if you have hundreds or thousands of folders which need to be repaired, you are really in for the long haul. Surely there must be a better, faster, easier solution to this white generic document icon issue in Catalina. Thankfully, there is.


For the sake of any inexperienced macOS users who may be reading this, I am going to provide you with a simple, clear example of how to restore your pretty blue folder icons using the Terminal app, which you will find in /Applications/Utilities. Yes, we are going to use the Terminal app; but please don’t let that scare you if you are new to using it, or for some reason have an aversion to it. If you follow my instructions precisely, you shouldn’t encounter any problems.


The first step is to obviously launch the Terminal app which, as I said, can be found in /Applications/Utilities. In fact, you may already have it in your Dock.


So, are you ready? Have you launched the Terminal app? Then let’s begin.


Suppose that your user name on your machine is “Tom”. On your hard drive, in /Users/tom — that is, your Home folder — like all Mac users, you have a folder called “Documents”. Now suppose that in the “Documents” folder you have another folder called “My Work Reports”, and within that folder you have a subfolder called “Languages”. Now, inside of the “Languages” folder, you have discovered some folders which have the white generic document icon. So the first thing that you need to do is to navigate to the “Languages” folder like this by using the “cd” — or “change directory” — command:


cd /users/tom/documents/my\ work\ reports/languages/


After typing that in the Terminal, you obviously have to hit your “return” key.


1. Please notice that you don’t need to specify uppercase or lowercase letters in the path to the “Languages” folder, because macOS recognizes both, and lowercase will work just fine, even if the actual folder names on your hard drive use uppercase letters.


2. Please also notice that if you have folder names with spaces in them, you need to escape them with a backslash before each space in the folder name. Please take a closer look at the path I typed out above in case you missed this point.


After using the previous command, you will be in your “Languages” folder where you have discovered the white generic document icons.


The next step is to list everything that is found in the “Languages” folder, so we use this command:


ls -l


Please note that both of those are the letter “l” and not the number 1, and that there is a space before the dash.


Again, hit your “return” key after typing it. That command will produce something like this. Of course, what you will actually see in your chosen folder will be different. After all, this is just an example for you to follow:


drwxr-xr-x 3 tom staff 96 Apr 25 06:20 Afrikaans

drwxr-xr-x@ 5 tom staff 160 Apr 25 06:23 English

drwxr-xr-x 3 tom staff 96 Apr 25 06:32 French

drwxr-xr-x@ 4 tom staff 128 Apr 25 06:30 German

drwxr-xr-x@ 6 tom staff 192 Apr 25 06:35 Korean

drwxr-xr-x@ 4 tom staff 128 Apr 25 06:23 Portuguese

drwxr-xr-x 3 tom staff 96 Apr 25 04:38 Slovak

drwxr-xr-x@ 6 tom staff 192 Apr 25 07:02 Spanish


As you can see, five of the folders are marked with the “@” symbol at the end of the permissions, or “drwxr-xr-x”. This symbol means that those particular folders have “extended attributes” — or Finder metadata — included with them.


So, let’s say we want to find out what extended attributes that “English” folder has. Thus, in the Terminal again, we would type the following to find out what extended attributes are connected to the “English” folder:


xattr english


Again, hit your “return” key after typing that.


The above command will produce the following results, and will then immediately return you to your command prompt, like this. Incidentally, “HD” represents the supposed name of our hard drive in this example. Your hard drive name will obviously be different, as will your user name before the “$”. As you can see, we are still in the “Languages” folder:


com.apple.FinderInfo

com.apple.macl

HD:languages tom$


So, what we want to do is to remove the “com.apple.FinderInfo” attribute from the folder named “English”. The “com.apple.FinderInfo” attribute stores legacy “Finder Info” — such as the color-tag and the hide extension flag — and additional non-documented information for the Finder from the “Get Info” window. So, in order to remove this attribute from the “English” folder, we would type the following, and hit the “return” key:


xattr -d com.apple.FinderInfo english


As you can see, we have entered the command, followed by the attribute we wish to delete, followed by the name of the folder we wish to delete it from.


The minute that you run that command in the Terminal, you will notice that your blue icon on the “English” folder has been successfully restored, if you visually examine it on your hard drive.


Now, you can follow the same procedure individually with the other four folders — German, Korean, Portuguese and Spanish — and hit the “return” key after each command like this:


xattr -d com.apple.FinderInfo german


Hit your “return” key.


xattr -d com.apple.FinderInfo korean


Hit your “return” key.


xattr -d com.apple.FinderInfo portuguese


Hit your “return” key.


xattr -d com.apple.FinderInfo spanish


Hit your “return” key.


As you do each one, and as occurred with the “English” folder, you will immediately see each folder on your hard drive revert back to the normal blue folder. Yay for us!


Of course, if you have hundreds or thousands of folders that need to be repaired, this one-by-one approach is for the birds. So, you will be happy to know that you can save some time by using the wildcard symbol “*” — that is an asterisk — instead, to do all four of them at once. In other words, instead of running four separate commands and hitting your “return” key each time, you can run just one command on the entire “Languages” folder using the “*” symbol like this:


xattr -d com.apple.FinderInfo *


Again, hit your “return” key after typing the above command.


Please notice that there is a space on both sides of the “-d”, as well as a space between “FinderInfo” and the asterisk.


That command will remove the “com.apple.FinderInfo” attribute from every folder within the “Languages” folder which has it, and thus restore them to the default blue folder icon.


Let me reiterate that this will only affect folders within the “Languages” folder, since that is where you are currently at. To change folder icons in other folders, you obviously need to navigate there first using the “cd” command, as I explained earlier.


In short, the above command will work on every folder that is located below the level in your folder hierarchy where you are currently at. Thus, if you enter your “Documents” folder and use this command, it will work on every folder which is contained in the “Documents” folder.


In fact, if you start at the top level of your hard drive, it will drill down through every folder that is located at the top level of your hard drive. The only place where it was forbidden, was on my Desktop, in which case I had to give it permission to do so first.


Another way to do it is to simply type “cd” in the Terminal, leave a space, and then drop a folder into the Terminal window. After that, use the “xattr -d com.apple.FinderInfo *” command to fix the folder icons of all folders inside of that folder.


If you are concerned that the above terminal command may also delete important info from some of your files, and not just from your folders which have the white generic document icon, you can use the following more selective command instead. This specifically only looks for folders — and not files — which have the “com.apple.FinderInfo” attribute:


find . -type d -exec xattr -d com.apple.FinderInfo \; 2> /dev/null


In this case, the “find . -type d” part of the command outputs only the path of all folders and subfolders — not files — which are found in the directory/folder you are currently in. It then passes that information to the “-exec xattr” command (the )” part of the command. The “2> /dev/null” part of the command inhibits a long list of errors for folders which don’t have any FinderInfo.


Please note that in the case of subfolders — such as your Home folder, for example — when you first begin this process, you need to begin your path at the top level of your hard drive like this:


cd /users/tom/


That is, assuming that the folders you wish to repair are found somewhere inside of your personal user folder, or Home folder. Once you are inside your Home folder, you no longer need to use full paths. You can use relational paths, or even the “-” symbol to move up or down one level in your folder structure. Try it out and see for yourself. In other words, if I am in my user folder — or Home folder — like this …


/users/tom/


… and I want to go to the “Documents” folder inside of my “tom” folder — or Home folder — I can simply type:


cd documents


I don’t need to type:


cd /users/tom/documents


Similarly, if I am in “/users/tom/documents”, and I want to go up one level back to my main user folder — or “tom” — I can type this:


cd –


Upon typing that and hitting my “return” key, my Terminal will show me this:


HD:tom tom$


If I type that same command again — that is, “cd -” — it will do the exact opposite, and take me down one level back to the “Documents” folder. In other words, the Terminal will now show me this:


HD:documents tom$


Let me remind you again that in all of the previous instructions, the “HD” represents the name of our example hard drive. When you actually do this yourself, the Terminal will display the name of YOUR hard drive. Likewise, it will NOT show you the name “tom”. It will display the actual user name that you use on YOUR system.


I hope the above instructions will help some of you to get rid of those pesky white generic folder icons, and restore your pretty blue folder icons. As I said, this method is best used when you have hundreds or thousands of the generic icons, and many of them reside in the same folder. This method will save you so much time, effort and frustration.


Caveat: Let me add a final word of caution. Using the “xattr” command and the “-d” command may possibly and inadvertently remove other attributes from the affected folders that you work on. This may possibly include things such as custom labels, which you will then have to manually restore yourself. I just want you to be aware of this possibility. I offer you the above instructions, but it is entirely up to you whether or not you wish to follow them. All I can tell you is that this method does work.

No comments :

Post a Comment