Subject: fvwm-menu-directory + --use-mailcap

From: calmar <[email-masked]>
Date: Sun, 7 Mar 2004 15:39:31 +0100

hi to all, and Mikhail,

if written a quick hack what splits the mailcap file, then it
looks-up the extension -> mime-type in a function, and when found, compares
that mime-type with the mime-type in the mailcap file, and
uses finally (when found again) that mailcap program in fvwm-menu-directory.

I would have to make the code more proper, but then again I don't
know much about perl.

I don't know if this is a good solution, that's why I ask here.

The next problem would be to decide what icons to use for what
programs/mime-types.

Maybe using an additional config file ?
mime-type -> icon,

or more probably using a command line option like this:
--mime-pic="text/html html.png, text/plain text.png" ...

thanks and  greetings
marco candrian

-- 
  calmar 
           (o_         GNU/Linux is GREAT      
           //\                 
           V_/_        http://www.calmar.ws

---

From: calmar <[email-masked]>
Date: Sun, 7 Mar 2004 16:17:09 +0100

On Sun, 7 Mar 2004 15:39:31 +0100

> hi to all, and Mikhail,

well this patch would work better maybe.
(while putting things together (using new cvs) I made a fault)
then again it's all only temporarly so far anyway. 

greetings
marco candrian

---

From: Mikhael Goikhman <[email-masked]>
Date: Tue, 9 Mar 2004 03:12:57 +0000

> I don't know if this is a good solution, that's why I ask here.

Please give me some time (I am very busy now), I will add the option you
want. I am not very happy with the patch. It should parse ~/.mime.types
or /etc/mime.types files. And if, instead, we use your hardcoded approach
to include file extentions in the script itself (disallowing users to
affect them), then Perl has hashes for this, something like:

	my $extension_mime_types = {
		zip  => 'application/zip',
		cpio => 'application/x-cpio',
		...
	};

> --mime-pic="text/html html.png, text/plain text.png" ...

Getopt::Long(3) gives a possibility for this elegant syntax:

	--mime-icon text/html=html.png --mime-icon text/plain=text.png

I will add --mime-icon and --mime-exec (working similarly) later,
together with --use-mailcap.

Regards,
Mikhael.

--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: calmar <[email-masked]>
Date: Tue, 9 Mar 2004 07:13:36 +0100

On Tue, 09 Mar 2004, Mikhael Goikhman wrote:

Hi Mikhael,

> 
> Please give me some time (I am very busy now), I will add the
> option you want. 

This does probably mean, that there is no need for me to try again
I think?

> I am not very happy with the patch. It should parse
> ~/.mime.types or /etc/mime.types files. And if, instead, we use
> your hardcoded approach to include file extentions in the script
> itself (disallowing users to affect them), then Perl has hashes
> for this, something like:
> 
> 	my $extension_mime_types = { zip  => 'application/zip', cpio =>
> 	'application/x-cpio', ...  };
>

of course it was silly to compare all those 'chunks of text' --
how I did it, compared to this solution.

I see so... :)	

> 	--mime-icon text/html=html.png --mime-icon text/plain=text.png
I see ..

> I will add --mime-icon and --mime-exec (working similarly)
> later, together with --use-mailcap.
> 

ok, thanks a lot .. !

please let me know when I can help anywhere anyway ....

marco candrian

-- calmar (o_         GNU/Linux is GREAT      
			  //\                 
			  V_/_        http://www.calmar.ws