#!/bin/bashĮcho 'Removing Icon files from Documents. Should you need to remove it for any reason.
However, if you turn off System Integrity Protection, youll gain the ability to edit the icon files. If youre running Mac OS X El Capitan (10.11) or later, due to System Integrity Protection, you wont be able to modify these files. 1 username staff 0B May 13 22:23 Icon? The folder icon in which youre interested is named GenericFolderIcon.icns.Drag an image to the top left folder icon.# Terminal Location: /Applications/Utilities/Terminal.appĮcho 'Searching Documents for Icon files.'įind ~/Documents -type f -name 'Icon?' -print # Terminal: Version: 2.8.2 64-Bit (Intel): Yes Should you be paranoid about if finding a false positive then use: ctrl+ v ctrl+ m instead of ? #!/bin/bash I don't have these on my system by default. It is the file that stores the Image for your Folder Icon, I was only able to get this to be created if I manually loaded an image to the folder. Alternatively you can open it with XnView If you open it in a hex editor and remove the first 260 bytes (so the file begins with the icns magic byte-string), you can open it in Preview.app. Its format is icns, encoded as an icon resource with derez. The easiest way to get the image is to copy the icon from the Get Info dialog of the folder it's contained in into the clipboard, and then create a new image from clipboard in Preview ( Cmd-N). in a hex editor) like this: $ cp Icon^M/.namedfork/rsrc Icondata You can copy the resource fork to a file (to view e.g. a file size of 0 bytes in Terminal), the actual icon data is stored in the file's resource fork. $ ls -lO 1 danielbeck staff hidden 0 24 Apr 23:29 Icon?Ĭhange with chflags nohidden Icon^M. If you manually add folders, such as the Developer folder, to your sidebar favorites, they will show up with a generic sidebar icon, even if the folder has a custom Finder icon. It's invisible in Finder, because its hidden attribute is set. Only items you can activate from Finder > Preferences > Sidebar have custom sidebar icons. in its Get Info dialog by pasting an image into the icon in the upper left corner, the Icon^M file is created.Ĭhanging a volume's icon creates a hidden. Icon^M is a file existing in all directories that have a custom icon in Finder. If letting the shell autocomplete the path in Terminal, it yields Icon^M, ^M being \r. It's name is actually Icon\r, with \r being the carriage return 0x0D.