Re: Mc digest, Vol 1 #372 - 3 msgs

Date: Wed, 26 Mar 2003 16:47:28 -0500 (EST)
From: Pavel Roskin <proski gnu org>
To: hugo vanwoerkom <hugovanwoerkom care2 com>
Cc: mc gnome org
Subject: Re: mc 4.6.0 config check for mozilla

On Wed, 26 Mar 2003, hugo vanwoerkom wrote:

mc 4.6.0 source ./configure checks for mozilla.
What is mozilla used for and how do you tell
where mozilla is? It is in its usual place
(/usr/local/mozilla) but he did not find it.

The idea is to associate HTML file with the best browser available at the
compile time.  The check is incorrect.  mc needs a wrapper script for
choosing the best browser at the run time.  It shouldn't be hard to write.

Red Hat's htmlview can be a good starting point, but it doesn't check if
KDE is running and it doesn't convert filenames to the "file:" URLs for
the browsers that need it.

Why not simply using the $BROWSER environment variable?
Normally a system correctly configured should use it (as $EDITOR

I realise that it's surely not enough, as it may be undefined, but
it's IMHO a good starting point, a good way to "choose the best

Also, I think that determining whether "file:" is needed or not is the 
browser job, isn't it?

Konqueror, mozilla, (surely galeon too), dillo, lynx, links do it

Something like 

if [ ! "$BROWSER" ]; then
        if [ "`ps ux | grep kdeinit`" ] ; then 
        elif [ "`ps ux | grep gnome-session`" ] ; then 
                BROWSER_LIST="mozilla konqueror galeon"
                for item in $BROWSER_LIST; do
                        bin_item=`which $item 2>&1`
                        if [ -x "$bin_item" ]; then
$BROWSER $file

It would be easy if every environment correctly set the $BROWSER value, 
instead of only relying upon their very specific configuration
tool. Unless you cannot read their configuration, you cannot be sure
to pick the "the best browser".

Maybe you can mix htmlview with additionnal test for KDE.


Mathieu Roy
 << Profile  << <<
Homepage >>           >>
 << GPG Key  <<        <<

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