Midnight Commander


Forum: DSL Tips and Tricks
Topic: Midnight Commander
started by: mikshaw

Posted by mikshaw on July 31 2005,14:54
This first post is just a copy of what I have already uploaded to the vectori mirror, but I'll keep adding to it as time goes on.  Please feel free to add any of your own tips for running mc....

DSL mc does not include a menu or extensions file, but I've found that using them makes a HUGE difference in mc's power.  The menu file (/home/dsl/.mc/menu) brings up a menu of actions which can be performed on the selected file(s) with the F2 key.  The extensions file (/home/dsl/.mc/ext or /home/dsl/.mc/bindings?) lets you set the action performed on each filetype, depending on whether you choose to open (double-click or Enter/Return), view (F3), or edit (F4).

Here's a [relatively] short menu file which should help in dealing with a few common tasks:
EDIT: dead link, and the file has been lost =o(
This current file is slightly in need of repair as of July 31,2005, but it mostly works.  The filetool part is broken, though, since it was changed to ".filetool.lst" in the latest DSL version (i'll fix it soon...just been busy with other stuff lately).

A future addition to the menu file will be the option to set a selected image file as background:

= f \.jpg$ | f \.png$
w       Set as wallpaper
       [ -n "$DISPLAY" ] && bsetbg -f %f

The mc man page (google.com/linux) explains in detail the format of the menu file, but basically it's something like this:

= f \.jpg$ | f \.png$
selected item is a file ending in either .jpg or .png

w       Set as wallpaper
this is the displayed label. "w" is a hotkey.

[ -n "$DISPLAY" ] && bsetbg -f %f
this is the command performed on %f (the selected item).


= t d
u       Create UCI package from current subdirectory
       Pwd=`basename %d`
       cd ../ && mkisofs -R -hide-rr-moved -cache-inodes -pad "$Pwd" | \
       create_compressed_fs - 65536 > "$Pwd.uci" && \
       md5sum "$Pwd.uci" >"$Pwd.uci.md5.txt"

Posted by mikshaw on Aug. 16 2005,01:43
Get access to a subshell in aterm with Ctrl+o by setting your TERM variable to "xterm".
EDIT: sorry, this one doesn't work in DSL's mc.  You can get a look at stdout this way, but you do not get a subshell for input.

Posted by mikshaw on Oct. 14 2005,18:54
Transparent background....
I couldn't figure out why using "mc.bin -b" would just give me a black and white mc even in a transparent terminal.  It works fine in other distros.  Then after changing aterm's foreground color it suddenly started working.  Don't ask me why, but transparency in mc does not work with certain font colors.

I changed /home/dsl/.Xdefaults to use "gray90" for aterm's foreground color instead of the default "white", and when i use the command "aterm -e mc.bin -b" i now have a transparent mc in DSL.

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.