Remove custom icons

hawkeye_a

macrumors 65816
Original poster
Jun 27, 2016
1,410
3,665
In the early days of MacOsX, I used to apply custom icons to files and folders, which involved invoking 'get info', and pasting an image onto the icon. On recent versions of macOS(10.14), there seems to be a process called "iconserviceagent" which boggs down the system when i mount a backup of those old files (activity monitor revealed it was using upwards of 20GB on a Mac with 4GB), and becomes unresponsive.

I suspect it's the custom icons.

Is there a way(script), to remove all custom icons in a folder and sub-folders, without having to manually do it for each file?

Cheers
 
Last edited:

chown33

Moderator
Staff member
Aug 9, 2009
8,592
4,679
inter-prandial
I think I have a way to do this, but if something goes wrong, do you have a backup?

Also, are you willing to lose color-tags and window-location info for all the files and folders involved?


The solution involves a command used in the Terminal window. I can give you the exact command, but are you comfortable enough in Terminal to try it?

If so, then the first thing is to confirm that your Mac has the necessary command. To do that, paste this line into a Terminal window, followed by pressing the RETURN key:
Code:
xattr -?
Then copy and paste the complete output in a reply here.

The output should be summary instructions (i.e. builtin help) for the 'xattr' command. I'm asking you to paste those instructions here, so I know what your 'xattr' is capable of, since it's likely that my 'xattr' command differs from yours.

If you get an error message that the command wasn't found, then you don't have the necessary command. You could probably get it, but I'll have to think about the best way to do that.
 

hawkeye_a

macrumors 65816
Original poster
Jun 27, 2016
1,410
3,665
I think I have a way to do this, but if something goes wrong, do you have a backup?

Also, are you willing to lose color-tags and window-location info for all the files and folders involved?


The solution involves a command used in the Terminal window. I can give you the exact command, but are you comfortable enough in Terminal to try it?

If so, then the first thing is to confirm that your Mac has the necessary command. To do that, paste this line into a Terminal window, followed by pressing the RETURN key:
Code:
xattr -?
Then copy and paste the complete output in a reply here.

The output should be summary instructions (i.e. builtin help) for the 'xattr' command. I'm asking you to paste those instructions here, so I know what your 'xattr' is capable of, since it's likely that my 'xattr' command differs from yours.

If you get an error message that the command wasn't found, then you don't have the necessary command. You could probably get it, but I'll have to think about the best way to do that.
I'm comfortable working in the terminal, and I do have a backup. I'll look into 'xattr', but i'm a "bit" wary of flipping bits recursively in a script.

Thanks for your reply, i'll post the output of xattr later today.

Cheers
 

rcprador

macrumors newbie
Jun 12, 2019
9
3
process called "iconserviceagent" which boggs down the system

iconserviceagent process is responsible to "show" any icon on newer MacOS.
If you disable it, there will be no icons on Finder nor many other places.

This process is essential to show any icon, also on quicklook. It caches the icons, and this is how it is, there is not much to change about it.

But, it does not have anything related to custom icons. Be the icon either a original icon, or a custom icon, it will not change the way iconserviceagent works.

The cause for it to use huge amounts of memory can be a cache problem.
Did you try to fully reset and rebuild the icon cache?
 
  • Like
Reactions: adrianlondon

revmacian

macrumors 68000
Oct 20, 2018
1,658
1,351
USA
I think I have a way to do this, but if something goes wrong, do you have a backup?

Also, are you willing to lose color-tags and window-location info for all the files and folders involved?


The solution involves a command used in the Terminal window. I can give you the exact command, but are you comfortable enough in Terminal to try it?

If so, then the first thing is to confirm that your Mac has the necessary command. To do that, paste this line into a Terminal window, followed by pressing the RETURN key:
Code:
xattr -?
Then copy and paste the complete output in a reply here.

The output should be summary instructions (i.e. builtin help) for the 'xattr' command. I'm asking you to paste those instructions here, so I know what your 'xattr' is capable of, since it's likely that my 'xattr' command differs from yours.

If you get an error message that the command wasn't found, then you don't have the necessary command. You could probably get it, but I'll have to think about the best way to do that.
I wonder if the same result could be obtained by using the which command:
Code:
which xattr
Which is a command to locate a program file in the user's path.
 

chown33

Moderator
Staff member
Aug 9, 2009
8,592
4,679
inter-prandial
I wonder if the same result could be obtained by using the which command:
Code:
which xattr
Which is a command to locate a program file in the user's path.
The 'which' command would only tell me where it's located. I don't care where it's located, as long as it's present in the PATH somewhere.

I wanted to tell the 'xattr' command to print its builtin help. Since the '-?' option is often invalid for most commands, xattr's usual response is to print its builtin help. I wanted to see the help info to ensure that the options and syntax for the version on someone else's Mac are the same (or similar) to the options on my Mac.
 
  • Like
Reactions: revmacian

revmacian

macrumors 68000
Oct 20, 2018
1,658
1,351
USA
The 'which' command would only tell me where it's located. I don't care where it's located, as long as it's present in the PATH somewhere.

I wanted to tell the 'xattr' command to print its builtin help. Since the '-?' option is often invalid for most commands, xattr's usual response is to print its builtin help. I wanted to see the help info to ensure that the options and syntax for the version on someone else's Mac are the same (or similar) to the options on my Mac.
Ah, so you weren't just looking for the existence of the command.. you were looking for the help info to be printed out - something the which command doesn't do. Nice, thank you for that info!