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

Re: mailcap next step



On Thu, May 15, 2003 at 12:11:03PM +0200, mcINEK wrote:
> W li?cie z czw, 15-05-2003, godz. 11:54, Wouter Verhelst pisze: 
> > If you already parsed mailcap into mc's configuration, you should've
> > seen this (picking out a random one):
> > 
> > application/vnd.sun.xml.draw; openoffice '%s'; edit=openoffice '%s'; test=test "$DISPLAY" != "" ; description="OpenOffice.org 1.0 Drawing"; nametemplate=%.sxd
> > 
> > Take extra care to the 'test' parameter.
> > 
> > > Could be posible run ie. links in mc and galeon in nautilus by the same
> > > run-mailcap command?
> > 
> > If you can create a test to accomplish that, sure.
> 
> Yes, I've seen it. BUT...
> 
> This is galeon entry in /etc/mailcap:
> 
> text/html; /usr/bin/galeon '%s'; description=HTML Text; test=test -n
> "$DISPLAY"; nametemplate=%s.html
> 
> Even if I change it, to run links if not $DISPLAY it would be bad
> solution. User can't choose which browser use. In addition, it's another
> record from the same file.
> 
> text/html; /usr/bin/mozilla '%s'; description=HTML Text; test=test -n
> "$DISPLAY";  nametemplate=%s.html
> 
> We see a conflict. It doesn't matter how many browser user installed,
> always will be run galeon (it's above so it's first - am I right?).

Yes.

> The best solution, I think, is that galeon (mozilla, etc) shouldn't
> provide a /etc/mailcap record, but just alternatives. And then in
> /etc/mailcap should be (just ONE) record, like (sorry, I don't know
> syntax)
> 
> text/html; if DISPLAY run x-www-browser else run www-browser
> 
> that's all. When user want to change one of browsers just use
> update-alternatives --config.

Here's your error: if you do that, it's not the user who can change his
browser, but the system administrator. Those two are not always the
same.

However, there's a better way. From mailcap(5):

FILES
       $HOME/.mailcap:/etc/mailcap:/usr/share/etc/mailcap:/usr/local/etc/mail-
              cap -- default path for mailcap files.

In other words: you can create a ~/.mailcap, with the same syntax as
/etc/mailcap, and copy your preferred entries from /etc/mailcap there --
or create new ones.

-- 
Debian GNU/Linux -- http://www.debian.org
Nederlandstalige Linux-documentatie -- http://nl.linux.org

"An expert can usually spot the difference between a fake charge and a
full one, but there are plenty of dead experts." 
  -- National Geographic Channel, in a documentary about large African beasts.

Attachment: pgpr72q7ekxWf.pgp
Description: PGP signature


Reply to: