This is the mail archive of the cygwin-xfree mailing list for the Cygwin XFree86 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

A corrected /usr/bin/xfhelp4 script for xfce-utils package


This message is concerned with the current version of
the xfce-utils package from Cygwin Ports so I suppose
it is of primary interest to Yaakov Selkowitz.

The xfce-utils package contains the original
xfhelp4 shell script from the XFCE distribution.
On Cygwin that one is broken as any user of
XFCE on Cygwin/X would notice after clicking
on the `Manual' icon on the Desktop.

The script needs several modifications in order
to run under Cygwin/X. I looked into the matter
and found that these are quite simple to make.

Here is the same script after I made appropriate
changes. I will apreciate if the maintainer of
XFCE on Cygwin Ports (presumably Yaakov) takes
a look at it and incorporates it in the current
version of the xfce-utils package.

I tested my version of xfhelp4 on my
Cygwin/X + XFCE (CygwinPorts) system
(everything current).

Mariusz Wodzicki

/usr/bin/xfhelp4:
----------------

#!/bin/sh

#  gxfce
#
#  Copyright (C) 1999 Olivier Fourdan (fourdan@xfce.org)
#  Copyright (C) 2003 Jasper Huijsmans (huysmans@users.sourceforge.net)
#
#  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.

# adapted to Cygwin by Mariusz Wodzicki, December 17, 2005


HELP_DIR="/usr/share/xfce4/doc"

if [ ! x"$1" = x"" ]; then
    HELP_FILE="$1"
else
    HELP_FILE="index.html"
fi

# Check for translated documentation
if [ -n "$LC_ALL" ] ; then 
  LC=$LC_ALL
elif [ -n "$LANG" ] ; then
  LC=$LANG
else
  LC="C"
fi

if [ -r "$HELP_DIR/$LC/$HELP_FILE" ]
then
  URL="$HELP_DIR/$LC/$HELP_FILE"
elif [ -r "$HELP_DIR/`echo $LC | sed 's/\(..\)_.*/\1/'`/$HELP_FILE" ]
then
  URL="$HELP_DIR/`echo $LC | sed 's/\(..\)_.*/\1/'`/$HELP_FILE"
elif [ -r "$HELP_DIR/C/$HELP_FILE" ]
then
  URL="$HELP_DIR/C/$HELP_FILE"
else 
  URL="$HELP_DIR/C/index.html"
fi

# Let the Windows handle the corresponding HTML file
cygstart "$URL"

# [Another solution would be to allow
# the user to decide which browser to use]

if [ $? -ne 0 ]; then
	xmessage -center -file - -title Error <<EOF
Unable to execute browser. 
Online help is not available.
EOF
	exit 1
fi

exit 0


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://x.cygwin.com/docs/
FAQ:                   http://x.cygwin.com/docs/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]