Sample Header Ad - 728x90

Query which desktop files can handle a mime type: Open with from the terminal?

1 vote
1 answer
66 views
So if I add a desktop to entry ~/.local/share/applications/something.desktop then it shows up in the "Open with..." menu in KDE straight away. I would quite like to be able to get this same information from the command line. Is there a way of querying this? I had a look an xdg-mime which can show the default application, and set the default application to this newly created desktop entry but seems unable to list them all. Obviously I could just code up something to parse all the desktop entries - but this seems besides the point. There is this stuff about mimeinfo.cache and mimeapp.list but this seems parallel to these files - since open with... lists shows the new desktop entry, but it is missing from both these files. How do I show all desktop files that can handle a mimetype from the command-line?
Asked by Att Righ (1412 rep)
Apr 4, 2025, 06:27 PM
Last activity: Apr 5, 2025, 12:28 PM