You are not logged in.

#1 2007-12-21 14:15:49

leo2501
Member
From: Buenos Aires, Argentina
Registered: 2007-07-07
Posts: 658

midnight commander questions. menu file & associations file

hi! i use tuxcmd all time, but find myself interested in try mc, first because it can be transparent and integrates with my transparent desktop:

desktopatermmccs2.th.jpg

but i read this manual  http://www.chm.tu-dresden.de/edv/mc/mc4.5/manual1.html  and dont know how to make a couple of things in first place...

1. when i start mc it sorts files in a confusing (for me) way tuxcmd shows me first the "dot" directories, next the "not dot" directories , next the "dot" files and finally the files, all in alphabetic order. how to achieve that sorting in mc?

2. in tuxcmd i have the options to sort (maintaining the number 1 item sort fashion) by date (newest files first) by name, by extension. how to do this in mc?

3. in tuxcmd i add to it a lot of file associations to my common use files, like when i right click a media file, i have my programs like open with mplayer, xine, vlc, ffmpeg -i (shows me info about the file), etc. what file or what i need to do to have file associations like that in mc? so i can just double click the file and it opens with his associated program?

THANKS!!!

my desktop:
Arch tongue
Fluxbox
gkrellm (cronos skin)
aterm (command: aterm -tr -bl +sb)
mc (transparent mc: Copy this line to ~/.mc/ini
[Colors]
base_color=normal=white,default:directory=white,default:marked=yellow,default:selected=gray,white:executable=brightgreen,default:link=lightgray,default:stalelink=brightred,default:special=brightblue,default:device=magenta,default:editnormal=white,default)

Last edited by leo2501 (2008-04-12 13:12:47)


Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.
-- Antoine de Saint-Exupery

Offline

#2 2007-12-22 06:20:58

gradgrind
Member
From: Germany
Registered: 2005-10-06
Posts: 921

Re: midnight commander questions. menu file & associations file

1) Don't know if this is possible.

2) Try Left/Right - Sort order ...

3) You could have a look at Command - Edit extension file. But it's not very pretty!

Offline

#3 2008-01-07 20:39:01

leo2501
Member
From: Buenos Aires, Argentina
Registered: 2007-07-07
Posts: 658

Re: midnight commander questions. menu file & associations file

well i have mc the way i like but i have the problem with the menu and extensions file... i really don know and read every man page and tutorial on the net and really dont understand the sintaxis of those files... if i like to asociate an extension with a program, the extensions file:

### Archives ###

# .tgz, .tpz, .tar.gz, .tar.z, .tar.Z
regex/\.t([gp]?z|ar\.g?[zZ])$
    Open=%cd %p#utar
    View=%view{ascii} gzip -dc %f 2>/dev/null | tar tvvf -

for example, i want to open them with xarchiver

### Sound files ###

regex/\.([wW][aA][vV]|[sS][nN][dD]|[vV][oO][cC]|[aA][uU]|[sS][mM][pP]|[aA][iI][fF][fF]|[sS][nN][dD])$
       Open=if [ "$DISPLAY" = "" ]; then play %f; else (xmms -e %f 1>/dev/null 2>&1 &); fi

and i want to open the wav, mp3, with terminal mplayer, same for video files...


### Plain compressed files ###

# zip
type/^([Zz][Ii][Pp])\ archive
    Open=%cd %p#uzip
    View=%view{ascii} unzip -v %f

i want this to open with xarchiver too :S


Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.
-- Antoine de Saint-Exupery

Offline

#4 2008-01-08 07:06:12

gradgrind
Member
From: Germany
Registered: 2005-10-06
Posts: 921

Re: midnight commander questions. menu file & associations file

I think the 'Open=' lines determine what happens when you press return or double-click on a file, 'View=' for F3.

It might be best to follow the sound files example and use 'if [ "$DISPLAY" = "" ]; then ...' so that mc still works in console mode. You just need to substitute your command for the existing one. I don't know what options your programs need, but something along the lines of:

# .tgz, .tpz, .tar.gz, .tar.z, .tar.Z
regex/\.t([gp]?z|ar\.g?[zZ])$
    Open=if [ "$DISPLAY" = "" ]; then %cd %p#utar; else (xarchiver %f &); fi
    View=if [ "$DISPLAY" = "" ]; then %view{ascii} gzip -dc %f 2>/dev/null | tar tvvf -; else (xarchiver %f &); fi

The meanings of the macros (%cd, %f and so on) are explained in the mc docs ('help'/F1) under 'macro substitution'.

Offline

#5 2008-01-09 14:31:56

byte
Member
From: Düsseldorf (DE)
Registered: 2006-05-01
Posts: 2,046

Re: midnight commander questions. menu file & associations file

1) I have exactly that sort order in mc. 'F9' -> 's' -> Sort by Name, both checkboxes disabled.


1000

Offline

#6 2008-01-30 23:21:07

leo2501
Member
From: Buenos Aires, Argentina
Registered: 2007-07-07
Posts: 658

Re: midnight commander questions. menu file & associations file

it seems to me or nobody edit the File Associations of Midnight commander? tongue i have everything functional now, sort and views like i want... but the file associations file and menu files are another story, i really dont understand them, seems that im not the only one tongue big_smile


Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.
-- Antoine de Saint-Exupery

Offline

#7 2008-04-12 13:12:05

leo2501
Member
From: Buenos Aires, Argentina
Registered: 2007-07-07
Posts: 658

Re: midnight commander questions. menu file & associations file

Well, right now i edited my ~/.mc/menu file so when i press F2 i get a menu with my additions, but the thing is, that i need that depending on the selected file when i press F2, the menu displays the corresponding options depending on the file type, but i barely understand the conditions and subconditions thing


#####################
####                     ####
####    Added by me    ####
####                     ####
#####################

#### Video File Menu ####

+ f \.avi$ | f \.mpg$ | f \.mpeg$ | f \.mkv$ | f \.ts$ | f \.rm$ | f \.vob$ | f \.rmvb$ | f \.flv$ | f \.wmv | f \.ram | f \.mp4 | f \.asf | f \.ogm | f \.m2v | f \.evo$ $ & t n
1       ffmpeg -i (show audio/video info)
        ffmpeg -i %f
 
2       vlc
        vlc %f

3       Encode to h264 hq 96 700
        enc2h264 hq 96 700 %f

#### Audio File Menu ####

+ f \.wav$ | f \.mp3$ | f \.au$ | f \.aiff$ | f \.snd$ | f \.mp2$ | f \.flac$ | f \.wma$ | f \.snd$ | f \.mpc$ | f \.ac3$ | f \.mid$ | f \.ogg$ $ & t n
1       mplayer
        mplayer %f
 
2       aplay
        aplay %f

3       ffmpeg -i (show audio/video info)
        ffmpeg -i %f
       
4       audacity
        audacity %f

5       Encode to *.mp3
        enc2mp3 %f

#### Disk Image File Menu ####

+ f \.iso$ | f \.ccd$ | f \.img$ | f \.nrg$ | f \.mdf$ | f \.cue$ | f \.bin$ | f \.daa$ | f \.b6t$ | f \.b6i$ & t r & ! t t
1       mountiso
        mountiso %f &
 
2       isomaster
        isomaster %f

3       Convert BIN to ISO
        bin2iso %f

4       Poweriso convert image to ISO
        all2iso %f

5       Convert CCD to ISO
        myccd2iso %f

#### Image File Menu ####

+ f \.jpg$ | f \.jpeg$ | f \.bmp$ | f \.png$ | f \.gif$ | f \.svg$ & t r & ! t t
1       feh
        feh %f

2       gimp
        gimp %f

3       gqview
        gqview %f

4       mirage
        mirage %f

#### PDF File Menu ####

+ f \.pdf$ & t r & ! t t
1       epdfview
        epdfview %f 

2       xpdf
        xpdf %f

#### Text File Menu ####

+ f \.txt$ | f \.nfo$ | f \.cfg$ | f \.log$ | f \.srt$ | f \.sub$ | f \.ssa$ & t r & ! t t
1       leafpad
        leafpad %f

#### Archive File Menu ####

+ f \.zip$ | f \.gz$ | f \.rar$ | f \.bz2$ | f \.tgz$ | f \.7z$ | f \.ace$ & t r & ! t t
1       xarchiver
        xarchiver %f

2       Extract *.tar.gz
        tar -xzvf %f

3       Extract *.tar.bz2
        tar -xjvf %f

4       Extract *.rar Full Path
        unrar x %f

5       Extract *.rar Current Dir
        unrar e %f

6       Extract *.zip
        unzip %f

7       Extract *.7z Full Path
        7z x %f

8       Extract *.7z Current Dir
        7z e %f

9       Extract *.ace Full Path
        unace x %f

a       Extract *.ace Current Dir
        unace e %f

b       Extract *.rar in *.rar_dir directory
        unrar2dir %f

c       Extract *.zip in *.zip_dir directory
        unzip2dir %f

d       Pacman Install Package
        sudo pacman -A %f

e       Pacman Upgrade Package
        sudo pacman -U %f

#### Windows Executable File Menu ####

+ f \.exe$ | f \.bat$ | f \.msi$ & t r & ! t t
1       wine
        wine %f

#### Internet File Menu ####

+ f \.htm$ | f \.html$ | f \.php$ | f \.asp$ & t r & ! t t
1       kazehakase
        kazehakase %f

2       swiftfox
        swiftfox %f

#### Document File Menu ####

+ f \.doc$ | f \.rtf$ | f \.php$ | f \.asp$ & t r & ! t t
1       abiword
        abiword %f

2       OpenOffice Writer
        soffice -writer %f

#### Spread Sheet File Menu ####

+ f \.xls$ | f \.csv$ & t r & ! t t
1       gnumeric
        gnumeric %f

#### Presentation File Menu ####

+ f \.ppt$ | f \.pps$ & t r & ! t t
1       OpenOffice Impress
        soffice -impress %f

#### Java File Menu ####

+ f \.jar$ & t r & ! t t
1       Execute
        java -jar %f

#### Help/Manual File Menu ####

+ f \.chm$ | f \.pps$ & t r & ! t t
1       xchm
        xchm %f

Last edited by leo2501 (2008-04-12 13:14:16)


Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.
-- Antoine de Saint-Exupery

Offline

#8 2008-04-13 09:59:26

lzs
Member
Registered: 2008-01-23
Posts: 39

Re: midnight commander questions. menu file & associations file

What did you not understand? I think you need to specify the conditions for each entry.

Offline

#9 2008-04-14 00:51:56

leo2501
Member
From: Buenos Aires, Argentina
Registered: 2007-07-07
Posts: 658

Re: midnight commander questions. menu file & associations file

the thing that i dont understand, is that the only way i get it to work, is adding this at the end of the original menu file, but i dont think this is the right way to do this hmm

#####################
####             ####
#### Added by me ####
####             ####
#####################

#### Video File Menu ####

+ f \.avi$ | f \.mpg$ | f \.mpeg$ | f \.mkv$ | f \.ts$ | f \.rm$ | f \.vob$ | f \.rmvb$ | f \.flv$ | f \.wmv | f \.ram | f \.mp4 | f \.asf | f \.ogm | f \.m2v | f \.evo$ & t r & ! t t
p       mplayer
        mplayer %f

+ f \.avi$ | f \.mpg$ | f \.mpeg$ | f \.mkv$ | f \.ts$ | f \.rm$ | f \.vob$ | f \.rmvb$ | f \.flv$ | f \.wmv | f \.ram | f \.mp4 | f \.asf | f \.ogm | f \.m2v | f \.evo$ & t r & ! t t
i       ffmpeg -i (show audio/video info)
        ffmpeg -i %f

+ f \.avi$ | f \.mpg$ | f \.mpeg$ | f \.mkv$ | f \.ts$ | f \.rm$ | f \.vob$ | f \.rmvb$ | f \.flv$ | f \.wmv | f \.ram | f \.mp4 | f \.asf | f \.ogm | f \.m2v | f \.evo$ & t r & ! t t
v       vlc
        vlc %f

+ f \.avi$ | f \.mpg$ | f \.mpeg$ | f \.mkv$ | f \.ts$ | f \.rm$ | f \.vob$ | f \.rmvb$ | f \.flv$ | f \.wmv | f \.ram | f \.mp4 | f \.asf | f \.ogm | f \.m2v | f \.evo$ & t r & ! t t
e       Encode to h264 hq 96 700
        enc2h264 hq 96 700 %f

+ f \.avi$ | f \.mpg$ | f \.mpeg$ | f \.mkv$ | f \.ts$ | f \.rm$ | f \.vob$ | f \.rmvb$ | f \.flv$ | f \.wmv | f \.ram | f \.mp4 | f \.asf | f \.ogm | f \.m2v | f \.evo$ & t r & ! t t
@       Encode to -ovc copy -oac mp3_abr_96
        enc2h264 audio 96 %f

+ f \.avi$ | f \.mpg$ | f \.mpeg$ | f \.mkv$ | f \.ts$ | f \.rm$ | f \.vob$ | f \.rmvb$ | f \.flv$ | f \.wmv | f \.ram | f \.mp4 | f \.asf | f \.ogm | f \.m2v | f \.evo$ & t r & ! t t
@       Encode to vhq 140 1000 (scale to 624x352)
        enc2h264 series %f

Last edited by leo2501 (2008-04-14 00:52:25)


Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.
-- Antoine de Saint-Exupery

Offline

#10 2008-04-14 11:07:43

lzs
Member
Registered: 2008-01-23
Posts: 39

Re: midnight commander questions. menu file & associations file

What is wrong with that? Are you trying to use custom menus in specific directories, e.g. for video watching/editing? The file needs to be called /specificdirectory/.mc.menu then. Or create one through mc's command menu (local).

Offline

#11 2008-04-14 11:33:27

leo2501
Member
From: Buenos Aires, Argentina
Registered: 2007-07-07
Posts: 658

Re: midnight commander questions. menu file & associations file

nothing wrong, only that i think is not the correct way to do what i want, maybe im wrong and it's the only way... what i want to do (that i already did tongue) is that when i press F2 in an avi file, to get options for AVI files and so on with all common file types. Well, that menu file is working for now, and is the only way i get it to work, so, until anyone recommends another way to do it... i think is what i'll use for a while smile


Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.
-- Antoine de Saint-Exupery

Offline

Board footer

Powered by FluxBB