Skip to content
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

Document icons depending on which application opens a document #159

Open
probonopd opened this issue Nov 22, 2022 · 3 comments
Open

Document icons depending on which application opens a document #159

probonopd opened this issue Nov 22, 2022 · 3 comments

Comments

@probonopd
Copy link
Member

probonopd commented Nov 22, 2022

This is an absolutely dysfunctional atrocity.

ksnip_20221122-210354

Why is the document not showing clearly which application it will be opened with?

In my opinion, I am not interested in which data a file contains. I am interested in which application it is opened with. Different documents with the same data format may need to be opened with different applications (or even versions).

This has never worked in a "proper desktop" fashion on "Linux desktops". Possibly because the XDG standards don't even account for this.

Can it be that XDG doesn't even have the concept of document icons?

This is how it should be:

image

Yet where would the document icons be coming from?

The desktop file doesn't specify which documents it can open, nor what icon they should have:

[Desktop Entry]
Encoding=UTF-8
Version=1.0
Name=Oracle VM VirtualBox
GenericName=Virtual Machine
Type=Application
Exec=VirtualBox
TryExec=VirtualBox
Icon=VBox
Categories=Emulator;System;
Comment=Run several virtual systems on a single host computer

Icon=VBox also gives no clue about where that icon might be hiding... or which version of it should be used.

Apparently XDG is not even allowing for the absolute bare essentials of a desktop to work properly, like having proper document icons.

Do we even have the document icon?

Users-Laptop% pkg list virtualbox-ose | grep png
/usr/local/share/pixmaps/VBox.png

Nope! Only the application icon!

As a last resort, we can generate document icons from application icons on the fly by combining a generic document icon like this

image

with a small version of the application icon.

Extra credits for giving the document a color similar to the dominant color in the application icon.

@probonopd
Copy link
Member Author

In this case, the .vbox file wrongly has application/xml as the MIME type. We should also have an EASY way for apps to say that they can-open certain filename extensions.

@probonopd probonopd changed the title Set document icons depending on open-with/can-open Document icons depending on which application opens a document Nov 22, 2022
@probonopd
Copy link
Member Author

As pointed out rightfully by @ammdias@masto.pt:

the same document may be opened by different applications, depending on what you want to do with it. I may want to open an image with the image viewer, if I want to display it, or with an image editor like Gimp or MyPaint. The same for a music file, should it have a Audacious or Audacity icon? A text config file may be used by an application at launch but I may want to edit it with Vim in a terminal or Gedit in GNOME. In those cases, which application icon should the documents have?

The one of the application that gets to open it when the file is double-clicked. For that exact reason!

@probonopd
Copy link
Member Author

probonopd commented Nov 23, 2022

The example above may be not the best one, as this may simply be the effect of the VirtualBox FreeBSD package lacking the icons (FreeBSD bug report), which, e.g., Fedora's RPMFusion virtualbox package and http://archive.ubuntu.com/ubuntu/pool/multiverse/v/virtualbox/virtualbox-qt_6.1.6-dfsg-1_amd64.deb make available in /usr/share/icons/hicolor/48x48/mimetypes.

image

Thanks @konradmb@mastodon.social for pointing this out.

This is the upstream location of these icons:
https://github.com/Virtualbox-OSE/Virtualbox/tree/main/src/VBox/Artwork/other

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

No branches or pull requests

1 participant