diff options
author | Nick Schermer <nick@xfce.org> | 2011-09-21 18:30:48 +0200 |
---|---|---|
committer | Nick Schermer <nick@xfce.org> | 2011-09-21 18:30:48 +0200 |
commit | 8a909006056efa380ead1f2746f81f9f56d97eff (patch) | |
tree | efef5dbd7d954ddbae5ad297aff34ba709664aba | |
parent | 26070f28f3ad7d4f9c9b44e0e319235f5259bd2e (diff) | |
download | xfce4-docs-8a909006056efa380ead1f2746f81f9f56d97eff.tar.gz |
Add xfhelp scripts.
-rw-r--r-- | Makefile.am | 25 | ||||
-rw-r--r-- | xfhelp4.desktop.in | 11 | ||||
-rw-r--r-- | xfhelp4.in | 55 |
3 files changed, 89 insertions, 2 deletions
diff --git a/Makefile.am b/Makefile.am index e44b43d..fbe5b94 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,6 +2,9 @@ SUBDIRS = \ xfce-user-guide +bin_SCRIPTS= \ + xfhelp4 + distclean-local: rm -rf *.spec *.cache *~ @@ -18,18 +21,36 @@ ChangeLog: Makefile dist-hook: ChangeLog +desktopdir = $(datadir)/applications +desktop_in_files = xfhelp4.desktop.in +desktop_DATA = $(desktop_in_files:.desktop.in=.desktop) +@INTLTOOL_DESKTOP_RULE@ + +edit = sed \ + -e "s,@_datadir_\@,$(datadir),g" \ + -e "s,@_libdir_\@,$(libdir),g" \ + -e "s,@_docdir_\@,$$(dirname $(docdir)),g" \ + -e "s,@_sysconfdir_\@,$(sysconfdir),g" + +xfhelp4: Makefile $(srcdir)/xfhelp4.in + rm -f xfhelp4 xfhelp4.tmp + $(edit) $(srcdir)/xfhelp4.in >xfhelp4.tmp + mv xfhelp4.tmp xfhelp4 + EXTRA_DIST = \ $(desktop_in_files) \ intltool-extract.in \ intltool-merge.in \ - intltool-update.in + intltool-update.in \ + xfhelp4.in DISTCLEANFILES = \ $(desktop_DATA) \ intltool-extract \ intltool-merge \ intltool-update \ - intltool-update-tmp + intltool-update-tmp \ + xfhelp4 DISTCHECK_CONFIGURE_FLAGS = \ --enable-gen-doc diff --git a/xfhelp4.desktop.in b/xfhelp4.desktop.in new file mode 100644 index 0000000..784caac --- /dev/null +++ b/xfhelp4.desktop.in @@ -0,0 +1,11 @@ +[Desktop Entry] +Version=1.0 +Type=Application +Exec=xfhelp4 +Icon=help-contents +StartupNotify=false +Terminal=false +Categories=Utility;X-XFCE;X-Xfce-Toplevel; +OnlyShowIn=XFCE; +_Name=Help +_Comment=Help using Xfce diff --git a/xfhelp4.in b/xfhelp4.in new file mode 100644 index 0000000..8f0e7fc --- /dev/null +++ b/xfhelp4.in @@ -0,0 +1,55 @@ +#!/bin/sh +# +# xfce +# +# Copyright (C) 1999 Olivier Fourdan (fourdan@xfce.org) +# Copyright (C) 2003 Jasper Huijsmans (jasper@xfce.org) +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# + +HELP_DIR="@_docdir_@" + +if [ ! x"$1" = x"" ]; then + MODULE="${1%.html}" +else + MODULE="xfce-utils" +fi + +# Check for translated documentation +if [ -n "$LC_ALL" ] ; then + LC=$LC_ALL +elif [ -n "$LANG" ] ; then + LC=$LANG +else + LC="C" +fi + +LC_CLEAN="`echo $LC | sed 's/\(..\)_.*/\1/'`" + +if [ -r "$HELP_DIR/$MODULE/html/$LC/index.html" ] +then + URL="$HELP_DIR/$MODULE/html/$LC/index.html" +elif [ -r "$HELP_DIR/$MODULE/html/$LC_CLEAN/index.html" ] +then + URL="$HELP_DIR/$MODULE/html/$LC_CLEAN/index.html" +elif [ -r "$HELP_DIR/$MODULE/html/C/index.html" ] +then + URL="$HELP_DIR/$MODULE/html/C/index.html" +else + URL="$HELP_DIR/xfce-utils/html/C/index.html" +fi + +exo-open --launch WebBrowser $URL |