|Home||Switchboard||Unix Administration||Red Hat||TCP/IP Networks||Neoliberalism||Toxic Managers|
May the source be with you, but remember the KISS principle ;-)
Bigger doesn't imply better. Bigger often is a sign of obesity, of lost control, of overcomplexity, of cancerous cells
|News||Orthodox File Managers||Recommended Links||Recommended Papers||OFM Book||mcedit- Midnight Commander editor||Viewer|
|Macro Substitution||Command line and command window||User Menu||Extension menu||Colorizing||External panelize||History of commands|
|Cheetsheet||OFM Standards||OFM Standard 1999||Tips||MC History||Humor||Etc|
September 6, 2009 | Plug-and-Pray IT blog
Editing Midnight Commander's color scheme In a previous post I was sort of laying out a "formula" on how to transform your Midnight Commander default color scheme into a transparent skin, without talking too much about how you can change the other colors.
To my great shame, I didn't pay too much attention to this blog or to the comments asking for further advice. I found Mateus' comment rather late (just now!) and decided to dig further, in order to find out how exactly to deal with more refined color changes, while still keeping the transparent background (in both in Midnight Commander and its editor).
So the first thing to know is which are the colors that Midnight Commander supports; the available colors are:
black gray lightgray white red brightred green brightgreen blue brightblue magenta brightmagenta cyan brightcyan brown yellow default
The "default" color is the one giving out the nice transparency.
Now, there are certain "components" in Midnight Commander's display that can have their colors altered. Here they are:
base_color, normal, selected, marked, markselect, errors, menu, reverse, dnormal, dfocus, dhotnormal, dhotfocus, viewunderline, menuhot, menusel, menuhotsel, helpnormal, helpitalic, helpbold, helplink, helpslink, gauge, input, directory, executable, link, stalelink, device, core, special, editnormal, editbold, editmarked, errdhotnormal, errdhotfocus
Each and every one of these "components" can have its own colors set accordingly to the user's wish. Each component is assigned a color pair and must be followed by a colon (':') in order to separate it from the color pair of the next component. Here's how this basic syntax must look like:
When you start modifying the color scheme in your Midnight Commander configuration file (located at ~/.mc/ini), you just have to add a section called "[Colors]" and proceed with enumerating the color pairs. So you'd have something like this:
# the rest of your ~/.mc/ini file
[Colors] component1=foreground_color1,background_color1:...:componentN= foreground_colorN,background_colorN
For increased readability, I will "truncate" that long line, adding a backslash ('\') to indicate that in fact what follows on the next line should be adjacent to the text on the previous line. This being said, the [Colors] section could look like this:
# the rest of your ~/.mc/ini file
[Colors] component1=foreground_color1,background_color1:\ component2=foreground_color2,background_color2:\ ... componentN=foreground_colorN,background_colorN
Now that you've gotten the hang of this, let's see how the [Colors] section looks like in the default Midnight Commander color scheme (you know, the "ugly" one, with blue and dull cyan):
IMPORTANT NOTE: For visual impact's sake and due to Blogspot breaking long lines, I wrote each color pair on a single row, followed by a backslash ('\'). Please note that this does NOT work in the ~/.mc/ini file, so the final [Colors] section in your Midnight Commander configuration file MUST be a SINGLE line with no spaces and with each color pair separated from the next one by a colon (':').
# the rest of your ~/.mc/ini file
[Colors] base_color=lightgray,blue:\ normal=lightgray,blue:\ selected=black,cyan:\ marked=yellow,blue:\ markselect=yellow,cyan:\ errors=white,red:\ menu=white,cyan:\ reverse=black,lightgray:\ dnormal=black,lightgray:\ dfocus=black,cyan:\ dhotnormal=blue,lightgray:\ dhotfocus=blue,cyan:\ viewunderline=brightred,blue:\ menuhot=yellow,cyan:\ menusel=white,black:\ menuhotsel=yellow,black:\ helpnormal=black,lightgray:\ helpitalic=red,lightgray:\ helpbold=blue,lightgray:\ helplink=black,cyan:\ helpslink=yellow,blue:\ gauge=white,black:\ input=black,cyan:\ directory=white,blue:\ executable=brightgreen,blue:\ link=lightgray,blue:\ stalelink=brightred,blue:\ device=brightmagenta,blue:\ core=red,blue:\ special=black,blue:\ editnormal=lightgray,blue:\ editbold=yellow,blue:\ editmarked=black,cyan:\ errdhotnormal=yellow,red:\ errdhotfocus=yellow,lightgray
Now let's see. What you want to change first of all is most of the background of these "components", such that the display will be one with a neat looking transparent background. So first of all you might want to make a few changes to these color pairs by replacing the background color "blue" with "default". After doing these changes, your [Colors] section will look a bit like this:
# the rest of your ~/.mc/ini file
[Colors] base_color=lightgray,default:\ normal=lightgray,default:\ selected=black,cyan:\ marked=yellow,default:\ markselect=yellow,cyan:\ errors=white,red:\ menu=white,cyan:\ reverse=black,lightgray:\ dnormal=black,lightgray:\ dfocus=black,cyan:\ dhotnormal=blue,lightgray:\ dhotfocus=blue,cyan:\ viewunderline=brightred,default:\ menuhot=yellow,cyan:\ menusel=white,black:\ menuhotsel=yellow,black:\ helpnormal=black,lightgray:\ helpitalic=red,lightgray:\ helpbold=blue,lightgray:\ helplink=black,cyan:\ helpslink=yellow,default:\ gauge=white,black:\ input=black,cyan:\ directory=white,default:\ executable=brightgreen,default:\ link=lightgray,default:\ stalelink=brightred,default:\ device=brightmagenta,default:\ core=red,default:\ special=black,default:\ editnormal=lightgray,default:\ editbold=yellow,default:\ editmarked=black,cyan:\ errdhotnormal=yellow,red:\ errdhotfocus=yellow,lightgray
Now you've got the basic "Midnight Commander transparent scheme" that was the result of this post.
Proceeding to Mateus' question, regarding how to change the rest of the colors now, it's about the same as before. What he didn't like there (and as a matter of fact I don't quite like it, either) is the dull cyan that's still seen in the following places:
the bottom line (the one displaying the F1...F10 function keys); the line that signifies the current selection, the "prompt" which shows you on which file/directory you're "on" at a given moment; the uppermost line (the "menu" line); the menus themselves, once you open them. To "fix" issues 1, 2, and 3 it is sufficient to alter the value of the "selected" parameter. Notice how it is initially
My personal choice is to replace the background cyan, which I don't really like, with green. To do this, I'll change this color pair to
You can, of course, change the foreground color as well. For me, it's alright to keep the foreground (the text) "black". You can change it to whatever suits your taste.
To "fix" issue number 4 in the list above, you need to change the "menu" parameter. To get it transparent, just change the "cyan" background to "default". Make other adjustments as you see fit. In other words, change
into, for instance,
However, there are a few "leftovers" from the default color scheme.
One of them is the parameter regarding the hotkeys in the menus (the "underlined" character on most of the menu options, showing you what key you can press in order to access that option faster than by moving to it with the arrow keys). This color pair is called "menuhot". I changed it from
Another thing which might bother you is the color of the line in the panel you're in when you've "selected all" files (when you've pressed the "*" key). This parameter is called "markselect". I changed it from
The color pair of the selected buttons in dialogs is called "dfocus". I changed mine from
In the "focused" buttons or options, the underlined character is called "dhotfocus". I changed mine from
since the background color was already green, after I modified the "dfocus" color pair.
The other buttons or options in the dialogs which have hotkeys assigned to them, but which are not "focused" (the buttons/options that you're not located on at a given moment) are still displayed in blue on a light gray background. This color pair is referred to as "dhotnormal". Since the blue looks a bit odd there, I changeddhotnormal=blue,lightgray:\
Well, this is nice, in window titles and on normal (unfocused) hotkeys I get the transparent background. The problem now is that the rest of the dialog window is still light gray. To change this (to make the window transparent as well), you only need to alter the "dnormal" color pair, such as changing it fromdnormal=black,lightgray:\
You may notice that the input fields stay cyan, as well; you find these fields in quite a lot of dialog boxes. To alter this, I changed
One thing which I consider useful is to have symbolic links displayed in bright cyan (as in the colored listings in the terminal). So I just changed
Now, regarding the rest of the color pairs, I don't really know what they do. However, if at some point after using Midnight Commander more with this new, neat, transparent/green color scheme you'll notice unwanted leftovers, you can try out other changes in the color pairs values, one at a time, until you determine the troublesome one.
After operating the changes above, my [Colors] section in ~/.mc/ini now looks like this:
[Colors] base_color=lightgray,default:\ normal=lightgray,default:\ selected=black,green:\ marked=yellow,default:\ markselect=white,green:\ errors=white,red:\ menu=lightgray,default:\ reverse=black,lightgray:\ dnormal=white,default:\ dfocus=black,green:\ dhotnormal=brightgreen,default:\ dhotfocus=brightgreen,green:\ viewunderline=brightred,default:\ menuhot=yellow,default:\ menusel=white,black:\ menuhotsel=yellow,black:\ helpnormal=black,lightgray:\ helpitalic=red,lightgray:\ helpbold=blue,lightgray:\ helplink=black,cyan:\ helpslink=yellow,default:\ gauge=white,black:\ input=black,green:\ directory=white,default:\ executable=brightgreen,default:\ link=brightcyan,default:\ stalelink=brightred,default:\ device=brightmagenta,default:\ core=red,default:\ special=black,default:\ editnormal=lightgray,default:\ editbold=yellow,default:\ editmarked=black,cyan:\ errdhotnormal=yellow,red:\ errdhotfocus=yellow,lightgray
I need to direct you to the "IMPORTANT NOTE" above. The final [Colors] section above is written like this - one pair on each row, followed by a backslash - for clarity's sake. The actual final [Colors] section in your ~/.mc/ini file will have to be a one-liner, with no blanks and no backslashes. So it will probably look similar to this:
Now, the next time you start mc, the new color scheme will take effect.
As a bonus, here's a picture of how my Midnight Commander looks like, with this new "skin" on:
Posted by Alexandra at 1:54 PM Labels: color scheme, mc, transparency 21 comments: Jared (Dogmeat)September 11, 2009 2:27 AM just saying hello ;)
ReplyDelete Alex.September 11, 2009 6:49 AM Hello Jared! Nice to see you around. As for social networking sites, I'm not into them at all.
ReplyDelete AnonymousSeptember 12, 2009 2:56 AM neither am I- I use it to keep track of bands, but I couldn't put my name without a website... you'll see that I have no "human" friends :P
ReplyDelete AnonymousSeptember 17, 2009 3:01 AM So, why'd you quit? I'm not asking you to come back or anything, but it IS a lot loess lively now. ;)
ReplyDelete AnonymousSeptember 17, 2009 3:02 AM Damn, sorry to spam, but I have to. less*
ReplyDelete Alex.September 17, 2009 6:47 AM Nice pic ;)
Jared, you can e-mail/IM me. I'm sure I left some contact details when I left.
Well, I left because I realized that my other interests were taking too much of my time and would not allow me to play FRP anymore, taking care of the administrating/social issues as well.
Now I'm just working, learning and reading mainly.
ReplyDelete AnonymousSeptember 19, 2009 7:00 PM I was going to email you originally, but I noticed the email address was @futurerp.
The few times I've been on IM, you haven't. :P
ReplyDelete AnonymousSeptember 21, 2009 6:03 AM Excellent post!
ReplyDelete AnonymousMay 19, 2010 3:16 AM still can't get the bar at the bottom to change... no matter what options i change, the numbers are still white/black and the text is always black/cyan :(
ReplyDelete AlexandraMay 19, 2010 3:56 AM Damn. You're right. Something changed in the meantime. I'm sure it did, otherwise the above screenshot would make no sense. Up until this something-got-broken-in-mc unfortunate event, the "status bar" (the menu with the F1...F10 options) was afected by the "selected=foreground/background" keyword.
ReplyDelete AnonymousAugust 6, 2010 11:00 PM How to fix the problem decribed above?
ReplyDelete AnonymousAugust 21, 2010 11:59 AM i have the same problem with F's menu color =(
ReplyDelete kamisoriJanuary 27, 2011 6:49 PM this fixes some colors back to transparent for mc 4.7.5
ReplyDelete AnonymousFebruary 5, 2011 7:31 PM do you have a fix for this? id like to have the same colors as the screen shot but so far its not working
ReplyDelete AnonymousFebruary 5, 2011 7:36 PM this is a Response to the last post as it was me and I found the answer
If you go into your terminal profile and change the cyan color in the colors section to green or whatever you want it will change on Midnight Commander.
hope this was helpful!
ReplyDelete AnonymousAugust 14, 2011 3:55 AM Hello this work for me, but when I "sudo mc" nothing change the default color BLUE background is appeared back. Is this a bug that MC having. I can't seem to get transparency while I'm in sudo. Is it something thing do with the owner ship. I would say it's only work for user not globally. Any suggestion is greatly appreiciated.
ReplyDelete binarymeOctober 5, 2011 3:39 PM Love this! thanks.
ReplyDelete JugheadMarch 5, 2012 10:32 AM This, and all others have one issue: if you write some code and place some tab characters then you will be disturbed by cyan background of this characters
ReplyDelete Nerd ProgreApril 11, 2012 6:44 PM For the life of me I can't seem to find where the Midnight Commander config files are stored, because ".mc" is not under /home/username anymore!!
DAMN I wish Linux devs would stop shuffling things around....
ReplyDelete Nerd ProgreApril 11, 2012 6:53 PM Damn. I will answer myself. With the help from the Fedora mailing list... the config files are now in
~/.config/mc/ plus ~/.local/share/mc/ for other files.
ReplyDelete Alekseiy SerdyukSeptember 10, 2012 1:18 PM Thanks, just what I need!
ReplyDelete Add comment Load more...
Links to this post Create a Link
Newer Post Older Post Home Subscribe to: Post Comments (Atom)
About Plug-and-Pray Hello! I hope you can find something of interest on this blog.
Please don't hesitate to comment and ask questions. If I'm able to assist, I'll reply as soon as possible or even write a "follow-up" post after investigating the problem further.
Add following lines to your
~/.mc/inifile for cool color scheme like this one.
Groupthink : Two Party System as Polyarchy : Corruption of Regulators : Bureaucracies : Understanding Micromanagers and Control Freaks : Toxic Managers : Harvard Mafia : Diplomatic Communication : Surviving a Bad Performance Review : Insufficient Retirement Funds as Immanent Problem of Neoliberal Regime : PseudoScience : Who Rules America : Neoliberalism : The Iron Law of Oligarchy : Libertarian Philosophy
War and Peace : Skeptical Finance : John Kenneth Galbraith :Talleyrand : Oscar Wilde : Otto Von Bismarck : Keynes : George Carlin : Skeptics : Propaganda : SE quotes : Language Design and Programming Quotes : Random IT-related quotes : Somerset Maugham : Marcus Aurelius : Kurt Vonnegut : Eric Hoffer : Winston Churchill : Napoleon Bonaparte : Ambrose Bierce : Bernard Shaw : Mark Twain Quotes
Vol 25, No.12 (December, 2013) Rational Fools vs. Efficient Crooks The efficient markets hypothesis : Political Skeptic Bulletin, 2013 : Unemployment Bulletin, 2010 : Vol 23, No.10 (October, 2011) An observation about corporate security departments : Slightly Skeptical Euromaydan Chronicles, June 2014 : Greenspan legacy bulletin, 2008 : Vol 25, No.10 (October, 2013) Cryptolocker Trojan (Win32/Crilock.A) : Vol 25, No.08 (August, 2013) Cloud providers as intelligence collection hubs : Financial Humor Bulletin, 2010 : Inequality Bulletin, 2009 : Financial Humor Bulletin, 2008 : Copyleft Problems Bulletin, 2004 : Financial Humor Bulletin, 2011 : Energy Bulletin, 2010 : Malware Protection Bulletin, 2010 : Vol 26, No.1 (January, 2013) Object-Oriented Cult : Political Skeptic Bulletin, 2011 : Vol 23, No.11 (November, 2011) Softpanorama classification of sysadmin horror stories : Vol 25, No.05 (May, 2013) Corporate bullshit as a communication method : Vol 25, No.06 (June, 2013) A Note on the Relationship of Brooks Law and Conway Law
Fifty glorious years (1950-2000): the triumph of the US computer engineering : Donald Knuth : TAoCP and its Influence of Computer Science : Richard Stallman : Linus Torvalds : Larry Wall : John K. Ousterhout : CTSS : Multix OS Unix History : Unix shell history : VI editor : History of pipes concept : Solaris : MS DOS : Programming Languages History : PL/1 : Simula 67 : C : History of GCC development : Scripting Languages : Perl history : OS History : Mail : DNS : SSH : CPU Instruction Sets : SPARC systems 1987-2006 : Norton Commander : Norton Utilities : Norton Ghost : Frontpage history : Malware Defense History : GNU Screen : OSS early history
The Peter Principle : Parkinson Law : 1984 : The Mythical Man-Month : How to Solve It by George Polya : The Art of Computer Programming : The Elements of Programming Style : The Unix Haterís Handbook : The Jargon file : The True Believer : Programming Pearls : The Good Soldier Svejk : The Power Elite
Most popular humor pages:
Manifest of the Softpanorama IT Slacker Society : Ten Commandments of the IT Slackers Society : Computer Humor Collection : BSD Logo Story : The Cuckoo's Egg : IT Slang : C++ Humor : ARE YOU A BBS ADDICT? : The Perl Purity Test : Object oriented programmers of all nations : Financial Humor : Financial Humor Bulletin, 2008 : Financial Humor Bulletin, 2010 : The Most Comprehensive Collection of Editor-related Humor : Programming Language Humor : Goldman Sachs related humor : Greenspan humor : C Humor : Scripting Humor : Real Programmers Humor : Web Humor : GPL-related Humor : OFM Humor : Politically Incorrect Humor : IDS Humor : "Linux Sucks" Humor : Russian Musical Humor : Best Russian Programmer Humor : Microsoft plans to buy Catholic Church : Richard Stallman Related Humor : Admin Humor : Perl-related Humor : Linus Torvalds Related humor : PseudoScience Related Humor : Networking Humor : Shell Humor : Financial Humor Bulletin, 2011 : Financial Humor Bulletin, 2012 : Financial Humor Bulletin, 2013 : Java Humor : Software Engineering Humor : Sun Solaris Related Humor : Education Humor : IBM Humor : Assembler-related Humor : VIM Humor : Computer Viruses Humor : Bright tomorrow is rescheduled to a day after tomorrow : Classic Computer Humor
The Last but not Least Technology is dominated by two types of people: those who understand what they do not manage and those who manage what they do not understand ~Archibald Putt. Ph.D
Copyright © 1996-2018 by Dr. Nikolai Bezroukov. www.softpanorama.org was initially created as a service to the (now defunct) UN Sustainable Development Networking Programme (SDNP) in the author free time and without any remuneration. This document is an industrial compilation designed and created exclusively for educational use and is distributed under the Softpanorama Content License. Original materials copyright belong to respective owners. Quotes are made for educational purposes only in compliance with the fair use doctrine.
FAIR USE NOTICE This site contains copyrighted material the use of which has not always been specifically authorized by the copyright owner. We are making such material available to advance understanding of computer science, IT technology, economic, scientific, and social issues. We believe this constitutes a 'fair use' of any such copyrighted material as provided by section 107 of the US Copyright Law according to which such material can be distributed without profit exclusively for research and educational purposes.
This is a Spartan WHYFF (We Help You For Free) site written by people for whom English is not a native language. Grammar and spelling errors should be expected. The site contain some broken links as it develops like a living tree...
|You can use PayPal to make a contribution, supporting development of this site and speed up access. In case softpanorama.org is down you can use the at softpanorama.info|
The statements, views and opinions presented on this web page are those of the author (or referenced source) and are not endorsed by, nor do they necessarily reflect, the opinions of the author present and former employers, SDNP or any other organization the author may be associated with. We do not warrant the correctness of the information provided or its fitness for any purpose.
Last modified: June, 14, 2018