[email protected]
[Top] [All Lists]

Re: ENTER key behavior

Subject: Re: ENTER key behavior
From: Frank Dietrich
Date: Sun, 19 Dec 2004 22:30:03 +0100
Hi Andras,

"Andras Varga" wrote:
> Almost, but not really. I expect MC to launch the program which is
> registered for that file in the KDE (or GNOME) mime database. Why
> should I have to duplicate that information manually in MC...?

No. You don't have realy to duplicate it.

In the /etc/mc/mc.ext file are some entries for common file types.

e.g. PDF
-----------------------------------------------
# PDF
type/^PDF
    Open=run-mailcap application/pdf:%f &
-----------------------------------------------

This entry start your default application for this mime type.

> In Windows, the feature works like this: it uses the "start" command
> (of cmd.exe) which "opens" the file (or folder) as if I'd
> double-clicked it in the Explorer. 

'start' does the same thing under Windows as run-mailcap will do under
Linux.

> OFF: Also a good thing in Windows is that "start ." (or "start
> any-directory") opens the folder in Explorer. I also miss that on
> KDE, where I have to type "konqueror ." (or is there a "start"
> equivalent)?

Do you wan't to have only one command to do all the above magically
for you? Write your own. ;-)

Create an script named 'start', place it in a dir in your binary
search path and make it executeable.

--- start ------------------------------------
#!/bin/sh

if test -d "$1"
then
  nautilus "$1"
else if test -e "$1"
  then
    run-mailcap "$1"
  else
    echo "Can't find directory or file: '$1'"
  fi
fi
-----------------------------------------------

Nautlius is a Gnome filemanager. I don't know what you should use
under KDE. May be konqueror will do the same.

start .              - opens nautilus in the current dir
start /var/log       - opens nautilus in the /var/log dir
start /docs/test.pdf - opens the test.pdf in the dir /doc
                       with the default mime application
                       for PDF documents

regards
Frank
_______________________________________________
Mc mailing list
http://mail.gnome.org/mailman/listinfo/mc

<Prev in Thread] Current Thread [Next in Thread>