FRIGN said:
> > I did not investigate issue in detail, but apparently xdg-open treats
> > all http links as "text/html".  "xdg-open http:" starts Firefox.
> 
> Yes, that's the problem. That's why I wrote soap in the first place.

But this is easy to work around with a shell script.  Having something
like "http-helper.sh" below, you may make a simple .desktop file and:

        $ xdg-mime default http-helper.desktop text/html

It is more consistent with a model, doesn't break package manager (you
have xdg-utils in dependecies for software, don't you?) and is easier to
fine-tune.


> Well, if you edit your .mailcap frequently, why not just alias a
> command like
> 
> editsoap = vim /path/to/soap/config.h && make clean && make install
> 
> to provide the same functionality?

Obviously, this is the way to work around the issue.  Still, moving
configuration of program X to configuration file of program Y feels like
bad taste to me.


-- 
Dmitrij D. Czarkoff


------------------------------------------------------------------------
  http-helper.sh:
------------------------------------------------------------------------
#!/bin/sh

MIME=`curl -I --max-redirs -1 -s "$@" | sed -Ee '/Content-Type/!d' -e 's/.+: 
([^;]+)(;.*)?/\1/'`

if [ "$MIME" == "text/html" -o "x$MIME" == "x" ]
then
        $BROWSER "$@"
else
        file=`mktemp -p "${TMP:-/tmp}" xdgXXXXXX`
        curl -s "$@" > $file
        xdg-open $file
        rm $file
fi

Reply via email to