Sven Hoexter wrote: > On Sat, Jan 05, 2008 at 06:36:50PM +0100, Pavel Sanda wrote: > >>> If it's really too much pain to fix xdg-open then I've to agree that it >>> would make more sense to revert the change. >> have you some experience how much are xdg devs communicative about the >> run-mailcap >> thing ? > > Nope but I've mailed Per, who is the Debian package maintainer for LyX and > xdg-utils, to read this thread. Maybe he can give some more information > about the communication with the xdg people about this issue.
Also, I'm not sure if run-mailcap even exists in other distributions. Debian is a bit special, because it has a policy and a system for keeping /etc/mailcap up to date (using the update-mime program). I'm not sure other distributions have that. The best disto-neutral solution would probably be to write a program which works out which application to run based on the freedesktop.org databases (/usr/share/mime and /usr/share/applications). But that's not trivial. The best solution for LyX would probably be to first check whether it is running under Gnome, KDE, or Xfce, and only then try xdg-open. The method used by xdg-open is quite simple: detectDE() { if [ x"$KDE_FULL_SESSION" = x"true" ]; then DE=kde; elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome; elif xprop -root _DT_SAVE_MODE | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce; fi } -- Pelle