On 2012-04-26, Gerard ROBIN wrote:
> On Thu, Apr 26, 2012 at 08:26:33AM +0200, Jostein Berntsen wrote:

> > I have these entries for docx files in my ~/.mailcap:
> > 
> > application/vnd.msword; mutt_bgrun libreoffice3.5 %s; #test=RunningX
> > application/vnd.openxmlformats-officedocument.wordprocessingml.document; 
> > mutt_bgrun libreoffice3.5 %s; #test=RunningX
>  
> > You might check out the mutt_bgrun script as well to make it work.
>  
> > Jostein
> 
> Thanks for your advice but the result is the same as before. 
> But thanks to you I discovered mutt_bgrun, and the Gary Johnson's Mutt Page :)

I hope you find it helpful.  I was going to suggest that earlier,
but I don't think it solves this particular problem.  mutt_bgrun
copies the attachment to a temporary file, runs the viewer on that
file, then deletes that file when the viewer exits.  If
libreoffice3.5 returns immediately, you still have the same problem
of the file being deleted before the viewer can open it.

One solution would be to modify mutt_bgrun to not delete the
temporary file.  Then you have to solve the problem of accumulated
temporary files.

Another approach would be to put something like 'sleep 60' on the
line before 'rm -f "$tmpfile"' in mutt_bgrun to keep the temporary
file around long enough for the viewer to open it before it is
deleted.

Regards,
Gary

Reply via email to