On 2017-01-14, Paul A. Rubin wrote: ...
> Is there any evidence that xdg-mime/xdg-open will ever be safe? Not bullet-proof but maybe safe enaugh to be used as default. +1 in a properly configured system, the system-wide user preference will be honoured, no need to configure preferences for both, xdg and lyx. -1 the "xdg-preference" may be worse than what LyX currently uses (at least for the moment this is a real problem). > Right now I see two problems with it, one of which can be avoided. The > original show-stopper was that it defaulted to opening files in the web > browser if no default application was set. We can work around that by > using xdg-mime to test whether a default is set in the MIME database. > If yes, we can make xdg-open the file handler; if not, we can do what > we currently do. Or we can use the default returned by xdg-mime as first choice and keep our list of fallbacks. > The bigger problem, in my mind, is that xdg-mime sometimes finds a > default application, but not the one actually used by the system. I > mentioned this in an earlier message, after stumbling on it > accidentally. I found xdg-open using a "stale" default from > ~/.local/share/applications/mimeapps.list when the correct default was > set in ~/.config/mimeapps.list. ... > In any case, unless my laptop is an outlier, there may be users out > there for whom xdg-utils would select not the browser but some other > incorrect (and, in one case on my laptop, not even installed) > application. This is one of the things that hopefully will settle over time. Users/distros removing the stale files, maybe xdg-* excluding or downgrading the stale files if the correct ones are present, applications no longer using obsolete paths and properly cleaning up when de-installed, ... > Rather than waiting on xdg-utils to be fixed (if in fact Freedesktop > even sees this as a bug -- I have no idea about that), should we look at > gvfs-mime/gvfs-open (again with the stipulation that we first check > whether a default application is set, and if not revert to our current > practice)? It works on both my systems, but they're both running recent > (albeit different) versions of Linux Mint. If we move in this direction, > I think we should first ask devs with other Linux distributions to test > it (which can be done with a simple shell script). I had the impression that gvfs-mime is (or should be) superseded by xdg-mime, so I would not propose to invest in this direction. The MINT problem is now fixed with simpler changes. > Incidentally, for people ill served by the configuration script, one way > to reduce the pain would be to add something in the Tools > > Preferences... dialogs that would allow the user, in one step, to set a > new default viewer or editor for all file formats of a certain ilk (all > PDF formats, all text formats, all image formats). Having to change the > viewer for PDF (pdflatex) every time I reconfigure is mildly annoying; > having to change it for multiple PDF formats after each reconfiguration > is serious annoying. Indeed, GUI support to change the viewer/editor "file-type wise" would be a real advantage. The different sub-formats (pdf1...5 etc) are just an internal way to specify the different export routes. Thanks for the suggestions, Günter