Re: galeon without gnome to view troff file

Tommi Komulainen <[email protected]>
Newsgroups gmane.comp.web.galeon.user
Message-ID <[email protected]>
On Thu, 2005-03-31 at 10:48 -0500, Haines Brown wrote:
> 
> I'd like to have galeon call upon a helper to view its content
> online. However, when under galeon I click on this READ.ME file, it
> only offers to Save, and no helper application with which I could
> view it. This Save dialog tells me: application/x-troff-me. When I run
> # file --mime on this file after I've downloaded it, I get:
> text/plain; charset=us-ascii

Unfortunately 'file' uses completely different database in figuring out
file mimetypes.  You should use gnomevfs-info or nautilus to determine
the same mimetype Galeon will for local files.


> I assume the helper application then should be groff.
> 
> So I create /usr/share/local/applications/groff.desktop, and put into
> it the lines:

Assuming you meant /usr/local/share/applications/groff.desktop...

>   [Desktop Entry]
>   Name=groff
>   Exec=groff
>   Terminal=false
>   Type=Application
>   MimeType=application/x-troff-me
> 
> and update-desktop-database.

...this looks fine to me.


> Now when I click on the READ.ME, I get instead of the Save dialog, a
> "Open this file with "groff" dialog, and it offers groff as the
> helper. However, when I select groff and proceed to Open the file, the
> window (I suppose it to be) opens and closes instantly. I tried
> Terminal=true without luck.   

That you see 'Open' in the dialog means that your .desktop file is
working, more or less.  If you run 'groff READ.ME' manually, does it
wait for a keypress before returning to command prompt?  If not, then
what you see is to be expected, as soon as the command (groff) finishes
the terminal window is also closed.

What you need to do, probably, is to write a small shell script, and use
it instead of groff:
#!/bin/sh
exec groff "$1" | less


> In principle, the MIME type is MimeType=text/plain;charset=us-ascii,
> but I get a parse error when I try to rebuild the database. If instead
> I use just MimeType=text/plain, the galeon Save dialog does not offer
> a helper application. 

That doesn't work quite the way you're expecting.  MimeType takes a list
of values (one application can handle multiple mimetypes) -- the values
are separated with ';'


-- 
Tommi Komulainen                                 [email protected]
GPG 1024D/68388EE6    6FD6 DD79 EB38 BF6F 3533  09C0 04A8 9871 6838 8EE6
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQBCTEUsBKiYcWg4juYRAvf0AJ9+EyXf4K2hz3+HIyqrBSIEWtQC0QCgl9AK
05x3UUNMhFQA9SpkJt4tKwU=
=kMvW
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.