Skip to content

Commit 205847b

Browse files
committed
Set Linux menuconfig color scheme as default
This replaces Kconfiglib's original color schemes with Linux kernel's menuconfig (mconf/lxdialog) visual style: - Remove 'default' and 'aquatic' themes - Add 'linux' theme matching lxdialog's set_bluetitle_theme() - Set 'linux' as default (previously 'default') - Keep 'monochrome' for terminals without color support
1 parent 7e256a1 commit 205847b

File tree

1 file changed

+21
-31
lines changed

1 file changed

+21
-31
lines changed

menuconfig.py

Lines changed: 21 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,14 @@
6464
Color schemes
6565
=============
6666
67+
The default color scheme matches the Linux kernel's menuconfig (mconf/lxdialog).
6768
It is possible to customize the color scheme by setting the MENUCONFIG_STYLE
68-
environment variable. For example, setting it to 'aquatic' will enable an
69-
alternative, less yellow, more 'make menuconfig'-like color scheme, contributed
70-
by Mitja Horvat (pinkfluid).
69+
environment variable.
7170
7271
This is the current list of built-in styles:
73-
- default classic Kconfiglib theme with a yellow accent
72+
- linux style matching the Linux kernel's menuconfig (mconf/lxdialog) [default]
7473
- monochrome colorless theme (uses only bold and standout) attributes,
7574
this style is used if the terminal doesn't support colors
76-
- aquatic blue-tinted style loosely resembling the lxdialog theme
7775
7876
It is possible to customize the current style by changing colors of UI
7977
elements on the screen. This is the list of elements that can be stylized:
@@ -137,11 +135,11 @@
137135
to, the assignment will be ignored, along with a warning being printed on
138136
stderr.
139137
140-
The 'default' theme is always implicitly parsed first, so the following two
138+
The 'linux' theme is always implicitly parsed first, so the following two
141139
settings have the same effect:
142140
143141
MENUCONFIG_STYLE="selection=fg:white,bg:red"
144-
MENUCONFIG_STYLE="default selection=fg:white,bg:red"
142+
MENUCONFIG_STYLE="linux selection=fg:white,bg:red"
145143
146144
If the terminal doesn't support colors, the 'monochrome' theme is used, and
147145
MENUCONFIG_STYLE is ignored. The assumption is that the environment is broken
@@ -284,23 +282,25 @@
284282
#
285283

286284
_STYLES = {
287-
"default": """
288-
path=fg:black,bg:white,bold
289-
separator=fg:black,bg:yellow,bold
285+
# Style matching the Linux kernel's menuconfig (mconf/lxdialog)
286+
# Precisely matches lxdialog's set_bluetitle_theme() and set_classic_theme()
287+
"linux": """
288+
path=fg:white,bg:blue,bold
289+
separator=fg:black,bg:white
290290
list=fg:black,bg:white
291291
selection=fg:white,bg:blue,bold
292292
inv-list=fg:red,bg:white
293-
inv-selection=fg:red,bg:blue
294-
help=path
295-
show-help=list
296-
frame=fg:black,bg:yellow,bold
297-
body=fg:white,bg:black
298-
edit=fg:white,bg:blue
299-
jump-edit=edit
300-
text=list
293+
inv-selection=fg:red,bg:blue,bold
294+
help=fg:black,bg:white
295+
show-help=fg:black,bg:white
296+
frame=fg:white,bg:blue,bold
297+
body=fg:black,bg:white
298+
edit=fg:black,bg:white
299+
jump-edit=fg:black,bg:white
300+
text=fg:black,bg:white
301301
""",
302302

303-
# This style is forced on terminals that do no support colors
303+
# This style is forced on terminals that do not support colors
304304
"monochrome": """
305305
path=bold
306306
separator=bold,standout
@@ -315,16 +315,6 @@
315315
edit=standout
316316
jump-edit=
317317
text=
318-
""",
319-
320-
# Blue-tinted style loosely resembling lxdialog
321-
"aquatic": """
322-
path=fg:white,bg:blue
323-
separator=fg:white,bg:cyan
324-
help=path
325-
frame=fg:white,bg:cyan
326-
body=fg:white,bg:blue
327-
edit=fg:black,bg:white
328318
"""
329319
}
330320

@@ -617,9 +607,9 @@ def _init_styles():
617607
# seems to be a lot of general brokenness there.
618608
pass
619609

620-
# Use the 'default' theme as the base, and add any user-defined style
610+
# Use the 'linux' theme as the base, and add any user-defined style
621611
# settings from the environment
622-
_parse_style("default", True)
612+
_parse_style("linux", True)
623613
if "MENUCONFIG_STYLE" in os.environ:
624614
_parse_style(os.environ["MENUCONFIG_STYLE"], False)
625615
else:

0 commit comments

Comments
 (0)