Skip to content

Icon association in system explorer for .dib files #3908

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ikarmus2001 opened this issue Apr 9, 2025 · 1 comment
Open

Icon association in system explorer for .dib files #3908

ikarmus2001 opened this issue Apr 9, 2025 · 1 comment
Labels
enhancement New feature or request

Comments

@ikarmus2001
Copy link

ikarmus2001 commented Apr 9, 2025

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 ikarmus2001 added the enhancement New feature or request label Apr 9, 2025
@ikarmus2001
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant