JerMartin wrote:I must be doing something wrong or absolutely braindead and missing something - I pasted those plist contents into the proper directory and rebooted - no change.

Please, no laughing - but help? :lol:

Hi,

The plist is meant to go along with the SIMBL plugin linked in the youtube video a couple posts up.

It doesn't do anything on its own to change the icons, it just auto kills and restarts the finder on login to make the plugin work.

If you've installed SIMBL and the colorfullsidebar bundle and its still not working, then check console for any error message, you can search 'color' or 'colorsidebar' probably to find them.

Hope that helps!

Cheers, :)
This isn't for those that want colours back, but the latest Dropbox build includes a custom Sidebar icon: http://forums.dropbox.com/topic.php?id=43550

Image

At /Library/DropboxHelperTools/Dropbox_u501/DropboxBundle.bundle/Contents/Resources

There's the following files: sidebar_16.png, sidebar_18.png & sidebar_32.png

Anyone know how they did it?
The one here, you mean ?
Woopsies.
Well, I guess this thread is dead for a while, but I just found it. Anyway, I used the workaround it it worked, but unlike most people I do like the monochrome sidebar, I just want to add custom icons to it. Anyway to return the icons the way they are but leave the custom ones?
This thread seemed promising but then it seems everyone gave up and used SIMBL instead.

I just want to change one of my folders, and I don't care if it's MONOchromatic.

how does one do that?
mjmallon wrote:I posted this the other day in the general Lion discussion thread, but I kind of think it would be better to have its own thread. Hopefully the moderators will agree, but if not, feel free to move or delete this thread.

So I'm among the users going crazy thanks to apple's new "no custom sidebar icons in finder" decision. I can live without color icons, so long as I can at least assign custom icons again to differentiate between all the folders I add to my sidebar. So I've been digging through OSX trying to find a way to at least hack in support for custom icons again, but I've hit a wall, and would love some help and feedback from anyone else working on custom icons too.

Anyway, onwards!

So its easy enough to find the current icons in /system/library/coreservices/coretypes.bundle/contents/resources since they're all prefaced with Sidebar, and each has 32px and 16px monochrome resources for the new cocoa sidebar processing.

Now, go up a level and look in info.plist, and you can see that every default sidebar icon has a registered Document Type.

For example, "Sidebar All My Files Icon" has the Document OS Types set to: "sbAF"

So, next step, I made a blank text document, and using setFile from the command line, ran:

setFile -type 'sbAF' somefile.rtf

Now, after this, dragging somefile.rtf into the sidebar gave it the "All My Files" icon instead of the generic document icon. Since apple stopped using creator/type codes in snow leopard, this is an easy enough solution if you add specific documents to your sidebar.

However, I can't find a way to set a type for folders, well, because they're folders after all and don't have a type. So then I tried using an alias to a folder, and while you can set the 'type' for an alias, when you try to drag it into the sidebar, it drags the original location, and not the alias, and thus no custom icon :(

Any thoughts?

My best guess is that there's a hard coded list somewhere of what directories get custom icons, and if so, then its just a matter of time of finding it before we can add/delete/modify custom icons. And then it should be easy enough to add new icons to coretypes.bundle, I know that's a scary thought, but there's not much else I can think of unless apple decides to build custom icon support into a future update.

Cheers everyone, :)

What about .savedSearches? I've tried but haven't had any luck.

I found this article: http://cocoadev.com/wiki/SideBarContent

where they talk about generating the right key for the icon:

The Finder's sidebar is controlled by a plist in the users directory, namely ~/Library/Preferences/com.apple.sidebarlists.plist. Inside this file are two keys: "systemitems" and "useritems". "systemitems" controls what is displayed in the upper portion of the sidebar (things like HD's, etc), and seems to be tightly controlled by the system (I am not investigating further).

"useritems" is where most of the attention probably should be focused. Inside "useritems" is a Array under the key "CustomListItems". Under this are plist dictionaries with three keys: "Alias", "Icon", and "Name":

Name: (type String) This is simply the text string that is displayed to the user. This is user-modifiable through the finder.
Alias: (type Data) This is just as base64 encoded version of the data from an alias. To get this information on the command line you can use this comand:
cat <file path>/..namedfork/rsrc | uuencode -m /dev/null Don't include the line "begin-base64 644 /dev/null", as that is just for the file.

You can also create the alias programatically, but that is for another article.

Icon: (type Data) This is once again encoded in base64, and is the type/creator/icontype describing the icon. For example the one for finder folders is "ImgR SYSL fldr"

Once you have made the changes to the plist that you want you have to announce them with a posting to NSNotificationCenter. Namely one with the name: "com.apple.sidebarlists.<user_id>.useritems", where <user_id> is the numeric user id for the person in question, and a nill object.

I hope this might shed some light?

I don't like this simbl work around and just want one or two custom grey icons for smart searches and folders (I don't mind the lack of color and don't want to have to change all of my icons to color). I think you guys were on the right path but then gave up. :/

As stated before, there are no OSTypes for folders (even the folders with special sidebar icons). So even if you are successful in setting the osType on a folder, it isn't how it populates the sidebar icon for it.
Last edited by hash and burn on June 24th, 2012, 12:09 am, edited 1 time in total.
The wiki you linked is outdated. The sidebar doesn't function like that anymore and it doesn't send any distributed notifications.

You can either contact the Dropbox developers and ask them for how they did it, or use files with OSTypes and AppleScript apps.
Last edited by inket on June 24th, 2012, 2:21 pm, edited 1 time in total.
inket wrote:So I've been all over this for the past 2 days and couldn't find any way to put custom icons for folders using either the sidebarlists.plist or the Info.plist.


But instead I came up with a really dirty way which involves putting a file on the sidebar, setting its OSType (thus, changing the icon) and having that file open an app that redirects Finder to the correct location.

Basically, it acts as a file (animation, no selection, etc.) but it gets you were you want to go and has the icon you choose. Here's a video to show you how it works: http://cl.ly/9GHJ

Now, I don't know if anyone is interested in this half-assed solution, but it could be ready by tomorrow if someone wants it.

Until someone comes up with a real solution.

After reading this threat I got really interested in assigning custom icons in my sidebar again. Since there was no fix to be found early Lion I gave up on the sidebar, but your methot seems useable.

Could you please elaborate how you did that?
I think we'd do better by trying to reverse engineer Dropbox's method.

Besides, either I forgot my method or it simply doesn't work anymore.

Here's something to get started on:
- When you kill the Finder, the sidebar Dropbox folder will get a regular icon for some seconds before switching to the custom one.
- Any folder named "Dropbox" in the sidebar will have the Dropbox icon.
Last edited by inket on June 24th, 2012, 4:49 pm, edited 1 time in total.
inket wrote:I think we'd do better by trying to reverse engineer Dropbox's method.

Besides, either I forgot my method or it simply doesn't work anymore.

Here's something to get started on:
- When you kill the Finder, the sidebar Dropbox folder will get a regular icon for some seconds before switching to the custom one.
- Any folder named "Dropbox" in the sidebar will have the Dropbox icon.

To bad.

I can confirm the Dropbox thing, if i create a random folder called "Dropbox" and put it in the side bar I get the dropbox icon. So I figured the same thing would apply to other folders like Downloads etc. this wasn't the case.

As far as I can estimate what's going on, the default folders have some wierd-ass mombojombo connected to them like mentioned in the previous posts, BUT, somewhere there is a system telling Finder to change the icon of generic folders based on there name, not there type.

To my understandings that would imply we've got to contact/figure out how dropbox calls on this function, and see if theres a list somewhere that keeps track of the folder-names whose icon should change.

I'll try and puzzle for a while in the dropbox app and stuff, but I'm not a specialist or what so ever. I'm just a curious, intelligent (If I may say so), random dude, messing with thing just to see what happens and then trying to figure out what it does and how it works.

Not havin' some specific folders in there is buggin' the hell outta' me, so I hope we can "overcome" this lil' challenge and theme the heck out of those simple icons (;
I spent 4~ hours last night trying all kinds of different things to no avail. Here's what I discovered:

- Dropbox injects a bundle (/Library/DropboxHelperTools/Dropbox_u501/DropboxBundle.bundle) into Finder, which can be seen in Console just after killing Finder.

- Couldn't find out what Finder method the bundle replaces exactly to be able to write a similar one for SIMBL. Hex viewing the executable had some interesting revelations but it didn't help.

- Class-dumping revealed Finder's poorly named methods and I still wasn't able to find the method responsible for getting the icons.

Will try some more tonight.
Inket,

Yes! Don't give up!

I've only recently caught up to the work you guys have been doing.

It's a shame that even saved searches don't work.

why is it important for a SIMBL script?
Please Devs keep working on this! I would love to see my google drive folder having a dropbox like folder in the sidebar! There has to be someway to mod this stuff