mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-01 19:54:32 +02:00
Make menuconfig colors configurable
Closes https://github.com/espressif/esp-idf/issues/4387
This commit is contained in:
@@ -321,6 +321,11 @@ If the previous steps have been done correctly, the following menu appears:
|
|||||||
|
|
||||||
Project configuration - Home window
|
Project configuration - Home window
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
The colors of the menu could be different in your terminal. You can change the appearance with the option
|
||||||
|
``--style``. Please run ``idf.py menuconfig --help`` for further information.
|
||||||
|
|
||||||
To navigate and use ``menuconfig``, press the following keys:
|
To navigate and use ``menuconfig``, press the following keys:
|
||||||
|
|
||||||
* Arrow keys for navigation
|
* Arrow keys for navigation
|
||||||
|
@@ -99,10 +99,12 @@ define RunConfGen
|
|||||||
$1
|
$1
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
export MENUCONFIG_STYLE ?= aquatic
|
||||||
|
|
||||||
ifeq ($(OS),Windows_NT)
|
ifeq ($(OS),Windows_NT)
|
||||||
MENUCONFIG_CMD := $(KCONFIG_TOOL_DIR)/mconf-idf
|
MENUCONFIG_CMD := $(KCONFIG_TOOL_DIR)/mconf-idf
|
||||||
else
|
else
|
||||||
MENUCONFIG_CMD := MENUCONFIG_STYLE=aquatic $(PYTHON) $(IDF_PATH)/tools/kconfig_new/menuconfig.py
|
MENUCONFIG_CMD := $(PYTHON) $(IDF_PATH)/tools/kconfig_new/menuconfig.py
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# macro for running menuconfig
|
# macro for running menuconfig
|
||||||
|
@@ -255,7 +255,7 @@ function(__kconfig_generate_config sdkconfig sdkconfig_defaults)
|
|||||||
|
|
||||||
set(MENUCONFIG_CMD ${mconf})
|
set(MENUCONFIG_CMD ${mconf})
|
||||||
else()
|
else()
|
||||||
set(MENUCONFIG_CMD "MENUCONFIG_STYLE=aquatic" ${python} ${idf_path}/tools/kconfig_new/menuconfig.py)
|
set(MENUCONFIG_CMD ${python} ${idf_path}/tools/kconfig_new/menuconfig.py)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Generate the menuconfig target
|
# Generate the menuconfig target
|
||||||
|
@@ -30,6 +30,14 @@ def action_extensions(base_actions, project_path):
|
|||||||
ensure_build_directory(args, ctx.info_name)
|
ensure_build_directory(args, ctx.info_name)
|
||||||
run_target(target_name, args)
|
run_target(target_name, args)
|
||||||
|
|
||||||
|
def menuconfig(target_name, ctx, args, style):
|
||||||
|
"""
|
||||||
|
Menuconfig target is build_target extended with the style argument for setting the value for the environment
|
||||||
|
variable.
|
||||||
|
"""
|
||||||
|
os.environ['MENUCONFIG_STYLE'] = style
|
||||||
|
build_target(target_name, ctx, args)
|
||||||
|
|
||||||
def fallback_target(target_name, ctx, args):
|
def fallback_target(target_name, ctx, args):
|
||||||
"""
|
"""
|
||||||
Execute targets that are not explicitly known to idf.py
|
Execute targets that are not explicitly known to idf.py
|
||||||
@@ -236,9 +244,22 @@ def action_extensions(base_actions, project_path):
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
"menuconfig": {
|
"menuconfig": {
|
||||||
"callback": build_target,
|
"callback": menuconfig,
|
||||||
"help": 'Run "menuconfig" project configuration tool.',
|
"help": 'Run "menuconfig" project configuration tool.',
|
||||||
"options": global_options,
|
"options": global_options + [
|
||||||
|
{
|
||||||
|
"names": ["--style", "--color-scheme", "style"],
|
||||||
|
"help": (
|
||||||
|
"Menuconfig style.\n"
|
||||||
|
"Is it possible to customize the menuconfig style by either setting the MENUCONFIG_STYLE "
|
||||||
|
"environment variable or through this option. The built-in styles include:\n\n"
|
||||||
|
"- default - a yellowish theme,\n\n"
|
||||||
|
"- monochrome - a black and white theme, or\n"
|
||||||
|
"- aquatic - a blue theme.\n\n"
|
||||||
|
"The default value is \"aquatic\". It is possible to customize these themes further "
|
||||||
|
"as it is described in the Color schemes section of the kconfiglib documentation."),
|
||||||
|
"default": os.environ.get('MENUCONFIG_STYLE', 'aquatic'),
|
||||||
|
}],
|
||||||
},
|
},
|
||||||
"confserver": {
|
"confserver": {
|
||||||
"callback": build_target,
|
"callback": build_target,
|
||||||
|
Reference in New Issue
Block a user