On 2017-01-13, Paul A. Rubin wrote:
> On 01/13/2017 03:27 AM, Guenter Milde wrote:
>> A more general question to all developers:
>> When checking for default viewer/editor applications during (re)configure,
>> should LyX
>> a) prefer feature rich applications, or
>> b) prefer small and fast-starting applications.
> [...] what I would prefer is that my system default choices be used
> (which circles back to the xdg-open problem). Can a Python script
> "easily" obtain MIME settings from the environment?
The hard part is to get it in a way everyone is satisfied with.
> Assuming that the xdg-utils package is installed, the shell command
> 'xdg-mime query default application/pdf' will return the default
> application (if one is set) for PDF files. On my system, the return
> value is 'xreader.desktop'. Unfortunately, for 'text/plain' the result
> is the somewhat less easily interpreted 'userapp-xed-07V7SY.desktop'
> (where xed is the correct answer -- no idea why it's so unclear).
Here, I get "wine-extension-txt.desktop" (although better alternatives like
leafpad are installed), which is not what I want.
> For 'image/jpeg' and 'image/png' the default is 'xviewer.desktop'. When
> no default is set (as is the case for 'image/svg' on my system), the
> xdg-mime query returns nothing.
IMV, using xdg-mime query seems the right way but not easy.
Maybe you can open an enhancement ticket.