Shellminator V3.0.1
Simple Terminal
Loading...
Searching...
No Matches
Example 121 Neofetch Advanced

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!

Neofetch Field Names

Whole Code

/*
* Created on June 8 2024
*
* Copyright (c) 2023 - Daniel Hajnal
* hajnal.daniel96@gmail.com
* This file is part of the Shellminator project.
* Modified 2023.05.13
*/
#include "Shellminator.hpp"
// Header
const char* neofetch_header_text = "Arnold@T800.local";
// Header Underline
// Field Format
// Version
// CPU
const char* neofetch_cpu_text = "AVR";
// Compiler
const char* neofetch_compiler_text = "GCC " __VERSION__;
// Compile Date
const char* neofetch_compile_date_text = __DATE__;
// Author
const char* neofetch_author_text = "Daniel Hajnal";
// User Field 1
const char* neofetch_user_field_1_label = "License: ";
const char* neofetch_user_field_1_text = "MIT";
// User Field 2
const char* neofetch_user_field_2_label = "Manufacturer: ";
const char* neofetch_user_field_2_text = "Cyberdyne";
// User Field 3
const char* neofetch_user_field_3_label = "Parser: ";
const char* neofetch_user_field_3_text = "Commander-API";
// User Field 4
const char* neofetch_user_field_4_label = "System Memory: ";
const char* neofetch_user_field_4_text = "2kByte";
// User Field 5
const char* neofetch_user_field_5_label = "OS: ";
const char* neofetch_user_field_5_text = "mulatOS";
// Create a Shellminator object, and initialize it to use Serial
Shellminator shell( &Serial );
// System init section.
void setup(){
Serial.begin(115200);
// Clear the terminal
shell.clear();
// Attach the default neofetch callback.
shell.attachNeofetchFunc( defaultShellminatorNeofetch );
// Initialize shell object.
shell.begin( "arnold" );
}
// Infinite loop.
void loop(){
// Process the new data.
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!...
Shellminator object.
@ BOLD
Bold text style.
@ YELLOW
Yellow text color.
@ GREEN
Green text color.
@ WHITE
White text color.