diff options
Diffstat (limited to 'Master/texmf/scripts/texdoc/config.tlu')
-rw-r--r-- | Master/texmf/scripts/texdoc/config.tlu | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Master/texmf/scripts/texdoc/config.tlu b/Master/texmf/scripts/texdoc/config.tlu index 7681425e9bb..3fde04d69b7 100644 --- a/Master/texmf/scripts/texdoc/config.tlu +++ b/Master/texmf/scripts/texdoc/config.tlu @@ -329,13 +329,18 @@ function is_in_path(name) end end --- guess a viewer from a list: +-- guess a viewer from a list: +-- - xdg-open from freedesktop if available -- - try detecting desktop environments -- - or return the first element of "list" whose name is found in path -- - or nil -- caches results of desktop environment detection do local de_viewer function guess_viewer(cmds) + -- try the freedesktop method + if is_in_path('xdg-open') then + return '(xdg-open %s) &' + end -- try desktop environment if not de_viewer then de_viewer = desktop_environment_viewer() end if de_viewer then return de_viewer end @@ -357,7 +362,8 @@ function desktop_environment_viewer() return '(kfmclient exec %s) &' -- kde < 4 end if os.getenv('GNOME_DESKTOP_SESSION_ID') then -- gnome - return '(gnome-open %s) &' + if is_in_path('gvfs-open') then return '(gvfs-open %s) &' end + if is_in_path('gnome-open') then return '(gnome-open %s) &' end end if not is_in_path('xprop') then return end local xprop_fh = io.popen('xprop -root _DT_SAVE_MODE 2>/dev/null') |