In the previous example, we saw how to get our custom Neofetch callback up and running. Now, let’s take it a step further and explore how to customize it!
Currently, there are 7 built-in parameters that you can modify:
header_text
→ Name displayed in the header (C-string)
header_line
→ Character used for the line under the header (must be a single character)
fw_text
→ Firmware text (C-string)
cpu_text
→ Processor/microcontroller identifier (C-string)
compiler_text
→ Compiler identifier (C-string)
compile_date_text
→ Compilation date (C-string)
author_text
→ Project owner (C-string)
Each of these parameters also has a color and style option. For example, header_text
can be customized using header_text_color
and header_text_style
.
Additionally, you can format the parameter labels using field_text_color
and field_text_style
.
Custom User Fields
There are also 5 user-defined fields that you can fully customize—**names, values, colors, and styles**:
user_field_1_label
→ Field name (C-string)
user_field_1_text
→ Field value (C-string)
user_field_1_text_color
→ Field text color (C-string)
user_field_1_text_style
→ Field text style (C-string)
user_field_2_label
→ Field name (C-string)
- ...
One important thing to note: User fields are only displayed if their corresponding field_label
is not an empty C-string.
Implementation Details
These parameters are implemented using the __weak__
attribute, which means they can normally be overwritten in user code instead of using the built-in defaults from the library. However, for some reason, this doesn’t work in the web-based demo, so we didn’t include an interactive example here.
That said, the image below shows what it would look like in PuTTY, visualizing all the available fields in action!
Whole Code
void setup(){
Serial.begin(115200);
shell.clear();
shell.begin( "arnold" );
}
void loop(){
shell.update();
}
int SHELLMINATOR_WEAK neofetch_user_field_5_text_color
const char *SHELLMINATOR_WEAK neofetch_author_text
int SHELLMINATOR_WEAK neofetch_user_field_1_text_color
int SHELLMINATOR_WEAK neofetch_user_field_3_text_color
int SHELLMINATOR_WEAK neofetch_header_text_style
int SHELLMINATOR_WEAK neofetch_compile_date_text_style
int SHELLMINATOR_WEAK neofetch_author_text_style
int SHELLMINATOR_WEAK neofetch_compile_date_text_color
int SHELLMINATOR_WEAK neofetch_user_field_2_text_style
const char *SHELLMINATOR_WEAK neofetch_user_field_2_label
int SHELLMINATOR_WEAK neofetch_fw_text_style
const char *SHELLMINATOR_WEAK neofetch_compile_date_text
int SHELLMINATOR_WEAK neofetch_user_field_5_text_style
const char *SHELLMINATOR_WEAK neofetch_user_field_3_label
int SHELLMINATOR_WEAK neofetch_header_text_color
const char *SHELLMINATOR_WEAK neofetch_user_field_1_label
int SHELLMINATOR_WEAK neofetch_header_line_style
const char *SHELLMINATOR_WEAK neofetch_cpu_text
int SHELLMINATOR_WEAK neofetch_fw_text_color
char SHELLMINATOR_WEAK neofetch_header_line_char
const char *SHELLMINATOR_WEAK neofetch_user_field_5_label
const char *SHELLMINATOR_WEAK neofetch_user_field_5_text
int SHELLMINATOR_WEAK neofetch_field_text_style
int SHELLMINATOR_WEAK neofetch_compiler_text_style
const char *SHELLMINATOR_WEAK neofetch_user_field_1_text
const char *SHELLMINATOR_WEAK neofetch_header_text
int SHELLMINATOR_WEAK neofetch_cpu_text_style
int SHELLMINATOR_WEAK neofetch_user_field_4_text_color
const char *SHELLMINATOR_WEAK neofetch_fw_text
void defaultShellminatorNeofetch(Shellminator *parent)
int SHELLMINATOR_WEAK neofetch_user_field_1_text_style
const char *SHELLMINATOR_WEAK neofetch_compiler_text
const char *SHELLMINATOR_WEAK neofetch_user_field_4_text
const char *SHELLMINATOR_WEAK neofetch_user_field_4_label
int SHELLMINATOR_WEAK neofetch_user_field_4_text_style
int SHELLMINATOR_WEAK neofetch_user_field_2_text_color
const char *SHELLMINATOR_WEAK neofetch_user_field_3_text
int SHELLMINATOR_WEAK neofetch_field_text_color
const char *SHELLMINATOR_WEAK neofetch_user_field_2_text
int SHELLMINATOR_WEAK neofetch_user_field_3_text_style
int SHELLMINATOR_WEAK neofetch_cpu_text_color
int SHELLMINATOR_WEAK neofetch_author_text_color
int SHELLMINATOR_WEAK neofetch_compiler_text_color
int SHELLMINATOR_WEAK neofetch_header_line_color
#define SHELLMINATOR_VERSION
+---— Custom configuration ---—+ | | | This is where you have to config | | your defines!...
@ YELLOW
Yellow text color.