philonous
howtos
 

Midnight Commander einfärben

Stand: 19.04.2007

Dass der midnight commander ein äußerst praktischer Dateimanager ist, das muss man eigentlich keinem mehr weiter erklären. Nur ist er - jedenfalls für meinen Geschmack - nicht unbedingt sonderlich hübsch. Klar, er soll ja auch funktional und nicht hübsch sein. Aber mit einer kleinen Ergänzung in der ~/.mc/ini hat man einen funktionellen und schönen mc. Noch besser ;)

Vorher:
vorher (aterm)

Um das zu ändern müssen wir in eben besagter Datei nach der Section [Misc] selbst noch Folgendes hinzufügen:

[Colors]

base_color=normal=,default:
selected=brightblue,gray:
marked=black,default:
markselect=blue,white:
gauge=blue,blue:
menu=white,black:
menuhot=white,black:
menusel=blue,black:
menuhotsel=white,black:
dnormal=white,black:
dfocus=brightblue,black:
dhotnormal=blue,black:
dhotfocus=brightblue,black:
input=white,black:
reverse=white,black:
executable=white,default:
directory=lightgray,default:
link=white,default:
device=white,default:
graphics=brightblue,default:
special=,:core=white,black:
helpnormal=white,black:
helplink=brightblue,black:
helpslink=brightblue,black:
hidden=gray,default:
archive=blue,default:
core=blue,default:
media=blue,default:
temp=grey,default:
doc=white,default:
database=blue,default:
source=,default:
graph=brightblue,default

Wichtig dabei ist, dass der ganze Text in eine Zeile (!) geschrieben wird (- ich hab das hier nur aus Gründen der Übersichtlichkeit nicht gemacht). Natürlich kann man das auch noch alles seinen eigenen Wünschen anpassen. Hilfreich dazu ist ein Abschnitt der sehr umfangreichen manpage von mc, den ich hier mal gepostet hab:

In the Colors section, the default color map is loaded from the base_color variable. You can specify an alternate color map for a terminal by using the terminal name as the key in this section. Example:
[Colors]
base_color=
xterm=menu=magenta:marked=,magenta:markselect=,red

The format for the color definition is:

 <keyword>=<foregroundcolor>,<backgroundcolor>:<keyword>= ...

The colors are optional, and the keywords are: normal, selected, marked, markselect, errors, input, reverse, gauge; Menu colors are: menu, menusel, menuhot, menuhotsel; Dialog colors are: dnormal, dfocus, dhotnormal, dhotfocus; Help colors are: helpnormal, helpitalic, helpbold, helplink, helpslink; Viewer color is: viewunderline; Special highlighting colors are: executable, directory, link, device, special, core; Editor colors are: editnormal, editbold, editmarked.

input determines the color of input lines used in query dialogs.

gauge determines the color of the filled part of the progress bar (gauge), which shows how many percent of files were copied etc. in a graphical way.

The dialog boxes use the following colors: dnormal is used for the normal text, dfocus is the color used for the currently selected component, dhotnormal is the color used to differentiate the hotkey color in normal components, whereas the dhotfocus color is used for the highlighted color in the currently selected component.

Menus use the same scheme but uses the menu, menusel, menuhot and menuhotsel tags instead.

Help uses the following colors: helpnormal is used for normal text, helpitalic is used for text which is emphasized in italic in the manual page, helpbold is used for text which is emphasized in bold in the manual page, helplink is used for not selected hyperlinks and helpslink is used for selected hyperlink.

Special highlight colors determine how files are displayed when file highlighting is enabled (see the section on Layout). directory is used for directories or symbolic links to directories; executable for executable files; link is used for symbolic links which are neither stalled nor linked to a directory; stalledlink is used for stalled symbolic links; device - character and block devices; special is used for special files, such as FIFOs and IPC sockets; core is for core files.

The possible colors are: black, gray, red, brightred, green, brightgreen, brown, yellow, blue, brightblue, magenta, brightmagenta, cyan, brightcyan, lightgray and white. And there is a special keyword for transparent background. It is 'default'. The 'default' can only be used for background color. Example:

[Colors]
base_color=normal=white,default:marked=magenta,default

Das mit dem transparenten Hintergrund ist natürlich vorallem dann interessant, wenn man einen Terminal-Emulator benutzt, der Transparenz unterstützt. In meinem Fall ist das aterm mit folgenden Parametern:

aterm -fg white -bg black -tr -sh 60

Hat man die oben genannte Erweiterung in der ~/.mc/ini eingetragen, dann schaut der midnight commander danach gleich viel hübscher aus, wie z.b. auf folgendem Bild erkennbar:

Nachher:
nachher (aterm)

Kommentare...

Lioba
25.02.2007 - 18:46
Daß die Ergänzung auch wirklich in EINER Zeile untergebracht wird, ist wohl entscheidend. Beim copy-paste ist mir doch was dazwischen gerutscht. Da mußte ich nacheditieren und nun klappt´ s einwandfrei. Syntaxfehler werden sofort bestraft!

Ich danke Dir für Deine Mühe und daß Du mich da noch mal drauf hingewiesen hast!
Komme wohl öfter mal hier vorbei.

Liebe Grüße


valid XHTML 1.0 strict   valid CSS 2.0