Change Folder Icon for Shared Dropbox Folder
I have several shared Dropbox folders. I would like to change the folder icon for each, to be a picture of the people with whom that folder is shared.
I know that I can change the icons for regular folders, so I tried to do that for the dropbox folders... which seemed to work at first. However, I notice that after a reboot, the folder icons reset to the default dropbox shared folder icon.
Is there a way that I can change the folder icons on a more permanent basis?
Dropbox likes to reset the images. You can prevent this by locking the new folder icon. After setting the folder icon to your desired icon, run the following command:
chflags uchg /path/to/folder/Icon$'\r'
To unlock, replace uchg
with nouchg
.
It is an old question. But since the behaviour of dropbox gets increasingly annoying as it now even replaces the folder icon of the base Dropbox folder, I tried to resolve this. The following works for me on macOS Catalina 10.15.4. Unfortunately, one has to do this after every update of Dropbox. It only partially solves the original question, as I can only replace the default folder icon for shared folders. It is not possible to prevent Dropbox from overwriting individual folder icons for shared folders.
The Dropbox app stores its icons in Dropbox.app/Contents/Resources
. There, you will find two files for each folder icon, a foldericon.icns file and a foldericon.icns.rsrc file. The latter prevents the simple solution, which worked for years, to simply replace the foldericon.icns files.
Caveat: If you install Dropbox on a machine with several user accounts, the app which actually runs is a copy of this one stored in ~/Library/Application\ Support/Dropbox
. You have to do the changes there.
There are currently the following folder icons:
- DropboxAppFolderIconYosemite.icns
- DropboxCameraUploadsFolderIconYosemite.icns
- DropboxFolderIconYosemite.icns
- DropboxReadOnlySharedFolderIconYosemite.icns
- DropboxReadOnlyTeamFolderIconYosemite.icns
- DropboxSharedFolderIconYosemite.icns
- DropboxTeamFolderIconYosemite.icns
- DropboxTeamMemberFolderIconYosemite.icns
- DropboxViewNameOnlySharedFolderIconYosemite.icns
and their respective resource files.
Suppose, you have replacement images and have made them into .icns files. Then do the following for each of them:
sips -i name.icns
which creates a resource fork for this file and stores the image there. Then we have to get that resource fork copied into a file. The difficulty is that it must be copied in binary format. We can do this with a combination of xattr and xxd:
xattr -p com.apple.ResourceFork name.icns | xxd -r -p > name.icns.rsrc
The command xattr reads out the content of the resource fork, but dumps it in hexadecimal form. We revert this with xxd and thus create the content of the resource fork as data of a file.
Stop dropbox. Now copy name.icns and name.icns.rsrc to the above mentioned directory overwriting the folder icons you which to change. It might be wise to make a backup of the originals. Start dropbox again, and the folder icons should have changed to the ones you wanted.
You may put the copy commands all in a small shell script which you can run after you notice that dropbox has updated itself. Don't forget to stop dropbox before running it.