[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gEDA-dev: [PATCH] gschemdoc: Use xdg-open if available



xdg-open is a tool from freedesktop.org which tries to use the user's
preferred application to open a file or URL.  This is a big
improvement over using a hardcoded list of applications to try.
---
 gschem/scripts/gschemdoc.sh |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/gschem/scripts/gschemdoc.sh b/gschem/scripts/gschemdoc.sh
index acae51c..c4f9b62 100644
--- a/gschem/scripts/gschemdoc.sh
+++ b/gschem/scripts/gschemdoc.sh
@@ -30,6 +30,13 @@ CANDIDATE_BROWSER="galeon mozilla phoenix netscape netscape-navigator opera fire
 CANDIDATE_PDFREADER="xpdf acroread ggv gv"
 CANDIDATE_LOCATE="slocate locate"
 
+# If xdg-open is available, use it
+XDG_OPEN=`which xdg-open`
+if test "$?" -ne "-1"; then
+    CANDIDATE_BROWSER=$XDG_OPEN
+    CANDIDATE_PDFREADER=$XDG_OPEN
+fi
+
 # For OS X, since Linux has 'open' with different semantics
 if [ "`uname -s`" = "Darwin" ]; then
 	CANDIDATE_BROWSER="open $CANDIDATE_BROWSER"
-- 
1.5.3.3



_______________________________________________
geda-dev mailing list
geda-dev@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-dev