43

How come Dropbox gets a non-generic icon in Finder's sidebar, when other directories like Google Drive and Sites (native in OS X before Lion) all have the same generic one?

enter image description here

How can I customise the icons used by the folders in the sidebar? OS X used to show individual icons of all folders there — not any longer.

6 Answers 6

36

As you've noticed, recent versions of OS X only display generic folder icons in the sidebar. So why does Dropbox get special treatment?

The short answer is that Dropbox uses undocumented API to accomplish this. In non-technical speak, it's a special hack that's installed by the Dropbox application.


Some curious folks on StackOverflow found the specific mechanism used by Dropbox: good ol' mach_inject. The same bundle provides both the toolbar item and the sidebar icon.

If you're curious, the resource files live here (at least, on my system):

/Library/DropboxHelperTools/Dropbox_u502/DropboxBundle.bundle/Contents/Resources

Clearly, Dropbox goes to great lengths in order to integrate seamlessly into the Finder. Lacking similar treatment, other ordinary folders have only generic icons in the sidebar.


Edit 10/1/2015: As of Yosemite (10.10), there is a new, sanctioned Finder Sync API for integration, as doovers points out in another answer. In El Capitan (10.11), System Integrity Protection will not permit the old mach_inject-style approach.

4
  • 6
    Google should do the same with Drive :)
    – Baumr
    Commented Mar 13, 2013 at 1:56
  • Dropbox Finder integration works with El Capitan. I have the context menus, the badges and the custom icon in the sidebar. Which version of the client are you using?
    – Matteo
    Commented Oct 1, 2015 at 10:27
  • @Matteo: That's interesting, when I went to check the version (v3.10.6), it started working! I assure you, it didn't work before. Interesting ...
    – jmk
    Commented Oct 1, 2015 at 17:35
  • 1
    @Matteo: Aha, reading comprehension fail on my part. Someone has already posted with the updated API below. Thanks for the correction!
    – jmk
    Commented Oct 1, 2015 at 17:37
11

According to the documentation for the Finder Sync Extension:

You can also use the extension point’s API to add a toolbar button to the Finder window or a sidebar icon for the monitored folder.

I would guess this is what Dropbox uses to achieve this and some/all the other functionality facilitated by this extension. For example you can also:

  • Register a set of folders to monitor.
  • Receive notifications when the user starts or stops browsing the content of a monitored folder. For example, the extension receives notification when the user opens a monitored folder in the Finder or in an Open or Save dialog.
  • Add, remove, and update badges and labels on items in a monitored folder.
  • Display a contextual menu when the user Control-clicks an item inside a monitored folder.
  • Add a custom button to the Finder’s toolbar.

Edit:

As Mugen mentions below, El Capitan will not allow code injection making FinderSync the only option going forward. With FinderSync only available from 10.10+ the best option would be to case it like:

if (floor(NSAppKitVersionNumber) < NSAppKitVersionNumber10_10) { ... }
8
  • That seems to conflict with the top-rated answer, any comments?
    – Baumr
    Commented May 31, 2015 at 16:54
  • 5
    @Baumr I'm only speculating here but I would assume that jmk's answer was probably correct at the time (and may still be) but that it is now more likely that dropbox use the 'official' Finder Sync Extension since the release of Yosemite. Plus I would think that for someone trying to achieve the same functionality in their own app, that this would be a more useful solution since it is documented.
    – doovers
    Commented May 31, 2015 at 21:58
  • Sounds like you're right — any way to confirm?
    – Baumr
    Commented Jul 6, 2015 at 14:35
  • 2
    In El-Capitan we won't be able to inject code anymore, and so FinderSync option is the only one
    – Mugen
    Commented Aug 12, 2015 at 8:43
  • 1
    @Baumr since FinderSync extension is only available in 10.10+, I think it would be best to case it: if (floor(NSAppKitVersionNumber) < NSAppKitVersionNumber10_10) { ... }
    – Mugen
    Commented Aug 23, 2015 at 5:56
2

Install the latest Xtra Finder App from - http://www.trankynam.com/xtrafinder/

Turn on "Show Colorful Icons in the SideBar" It is located below a text box of "Max Width"

For Other Icons in Sidebar

Replace the files here : /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/ folder contains the used grey ICNS in addition to [unused] 1024x1024 color ICNS files. Each ICNS files must support the following sizes:

  • 16x16 72 DPI
  • 18x18 72 DPI
  • 32x32 144 and 72 DPI
  • 36x36 144 DPI
  • 64x64 144 DPI

If you have added a custom folder to the sidebar, you can change it's icon too. Let us say that the folder name is called "Softwares" Prepare an ICNS file with the name SidebarSoftwares.icns in the above mentioned directory.

Basically the icns file needs to be named SidebarFoldername.icns where Sidebar Remains constant and you input the relevant foldername.

For DropBox

Apply ICNS file to /Users/admin/Dropbox /Applications/Dropbox.app /Applications/Dropbox.app/Contents/Resources/box.icns (need to replace this file with the one you want)

DropBox Finder SideBar Icons

Navigate to /Library/DropboxHelperTools/Dropbox_u502/DropboxBundle.bundle/Contents/Resources

Here you need to replace the following: toolbar.tiff (32x32 pixels 72 DPI)

sidebar.tiff (64x64 pixels 72 DPI)

contextmenu.tiff (32x32 pixels 72 DPI)

toolbar_large.png (19x19 pixels 72 DPI)

sidebar_blue.png (16x16 pixels 72 DPI)

2
  • Does the bit about adding custom sidebar icon for a folder require the app to be installed, or can it just be done on its own? Also, do you know if this will work with Yosemite when that gets released? Commented Jun 7, 2014 at 22:58
  • 1
    I just tried this to add my own icon and it didn't work. I then installed SideEffect app which makes the icons colorful and my custom icon appeared. Uninstalled the app and my icon was gone.
    – Pahnev
    Commented Jan 25, 2015 at 2:43
2

Dropbox uses Finder code injection technique to customize sidebar icon (and add items to right-click menu, and add button to Finder's top bar). And there is no good way to customize sidebar icon since 10.7.

In Yosemite Apple added some APIs to be able to customize Finder's right click menu and toolbar item, but I'm not sure about the sidebar.

3
  • Speaking of Yosemite, I believe that Dropbox now uses a Finder Sync extension to integrate with the Finder... but I don't see anything obvious in that feature's docs about providing a custom sidebar icon (custom toolbar icons are supported)... So the hack may still be in place.
    – Dan J
    Commented Nov 26, 2014 at 21:27
  • Sure, that is called Finder sync extension. But it doesn't allow sidebar icon. However I read documentation diagonally, so probably missed something. Commented Nov 28, 2014 at 10:30
  • Finder Synce Extensions do customize the sidebar icon: developer.apple.com/library/archive/documentation/General/…
    – pkamb
    Commented Nov 21, 2020 at 22:50
1

I was able to get native Download icon in siderbar for a moved Downloads folder. The process wasn't easy and it's described here: https://github.com/w0lfschild/colorfulSidebar_9/issues/1 It relies on mySIMB and colorfulSidebar. 3 years ago I gave up setting the native Downloads icon. Today I decided to give another chance and eventually it's working.

0

The dropbox installer puts one there and the google drive installer does not.

Just drag a folder into the sidebar and it will stick, no installer necessary.

4
  • 10
    I think the question is specifically about the icon.
    – asmeurer
    Commented Feb 23, 2013 at 23:04
  • Yeah, this doesn't address the question
    – Baumr
    Commented Feb 26, 2013 at 22:11
  • 2
    I'd give this another up-vote if I could. It's just code and the dropbox installer installs this feature when it runs in the background. It's like having a party and you invite two guests. One leaves their business card on your dresser, the other doesn't. It's not the owner that made the choice, it's the guests that behaved differently.
    – bmike
    Commented May 8, 2013 at 12:20
  • 2
    @bmike, the second part of the question was: "How can I customise the icons used by the folders in the sidebar?"
    – Baumr
    Commented May 15, 2013 at 10:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .