interactive icon indicating copy to clipboard operation
interactive copied to clipboard

Icon association in system explorer for .dib files

Open ikarmus2001 opened this issue 9 months ago • 1 comments

Feature request

I'd like to be able to distinguish .dib file instantly by nice, custom icon (like others in VSC, i.e. .json curly braces, C++ etc.)

Probably VSC Extension Api can handle it gracefully

The solution I'd like

I would like Polyglot Notebooks extension to create and set icon for .dib file extension (preferably asking user at first launch if they want it, in my opinion by default would be nicer but might be considered invasive).

Obvious choice would be the same icon as the main one in Visual Studio Marketplace, it's stored in this repo as png.

Alternatives

Manual assignment in registry works, idk how to handle it on other platforms as I'm not familiar with others. Probably some 3rd party tools could do it the same way, but it would require manual creation of icon.

Background

I have done tiny research (might be helpful if VSC Extension API doesn't allow such things or for future reference):

  • One can change icon for any file via regedit (ofc it's Windows-only solution, I tested it on 11 Pro 22631.5039). Such option is available:
    • directly in HKEY_CLASSES_ROOT\dib_auto_file\DefaultIcon (autogenerated when VSC was set as default program, key DefaultIcon might not be created, it's safe to make it manually), or
    • (preferable solution) in \HKEY_CLASSES_ROOT\.json\OpenWithProgids with empty default key and string value VSCode.json (and any other program ref there). HKEY_CLASSES_ROOT\VSCode.json\DefaultIcon (example on .json, we can set there any extension, .dib in this case by replacing it accordingly).
  • VSC stores icons in "C:\Users\<user>\AppData\Local\Programs\Microsoft VS Code\resources\app\resources\win32", so the conceise solution would be to follow the same with .ico (also .png)

Above solution is not perfect, as it won't make VSC show this icon in it (duh), but it's the minimal viable implementation for my request.

I used LLM for finding those paths, tested them myself, I can add some docs from MSLearn - probably not helpful for the sake of this issue, however repo is one of the most popular, so it's worth making elegant ticket.

ikarmus2001 avatar Apr 09 '25 11:04 ikarmus2001

How about .ipynb icon? I'd pick the same approach, IIRC if any other app uses it, it will override icon on its own?

ikarmus2001 avatar Apr 09 '25 13:04 ikarmus2001