// Based on #1576 { "$schema":…
- User
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
// Based on #1576 { "schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json", "display": { "color": { "keys": "blue" }, "separator": "", "constants": [ "──────────────────────────────────────────────", "\u001b[47D", "\u001b[47C", "\u001b[46C" ], "brightColor": false }, "modules": [ { "type": "version", "key": "┌───────────────┬─{1}┐\u001b[41D", "format": "\u001b[1m{#keys} {1} - {2} " }, { "type": "os", "key": "│ {icon} \u001b[s{sysname}\u001b[u\u001b[10C│{3}│{2}" }, { "type": "datetime", "key": "│ {icon} Fetched │{3}│{2}", "format": "{year}-{month-pretty}-{day-pretty} {hour-pretty}:{minute-pretty}:{second-pretty} {timezone-name}" }, { "type": "locale", "key": "│ {icon} Locale │{3}│{2}" },
// Hardware
{
"type": "custom",
"key": "│{#cyan}┌──────────────┬{$1}┐{#keys}│\u001b[37D",
"format": "{#bright_cyan} Hardware "
},
{
"type": "chassis",
"key": "│{#cyan}│ {icon} Chassis │{$4}│{#keys}│{$2}"
},
{
"type": "memory",
"key": "│{#cyan}│ {icon} RAM │{$4}│{#keys}│{$2}"
},
{
"type": "swap",
"key": "│{#cyan}│ {icon} SWAP │{$4}│{#keys}│{$2}"
},
{
"type": "cpu",
"key": "│{#cyan}│ {icon} CPU │{$4}│{#keys}│{$2}",
"showPeCoreCount": true
},
{
"type": "gpu",
"key": "│{#cyan}│ {icon} GPU │{$4}│{#keys}│{$2}"
},
{
"type": "disk",
"key": "│{#cyan}│ {icon} Disk │{$4}│{#keys}│{$2}",
"format": "{size-used} \/ {size-total} ({size-percentage}) - {filesystem}",
},
{
"type": "battery",
"key": "│{#cyan}│ {icon} Battery │{$4}│{#keys}│{$2}"
},
{
"type": "custom",
"key": "│{#cyan}└──────────────┴{$1}┘{#keys}│",
"format": ""
},
// Desktop
{
"type": "custom",
"key": "│{#green}┌──────────────┬{$1}┐{#keys}│\u001b[37D",
"format": "{#bright_green} Desktop "
},
{
"type": "de",
"key": "│{#green}│ {icon} Desktop │{$4}│{#keys}│{$2}"
},
{
"type": "wm",
"key": "│{#green}│ {icon} Session │{$4}│{#keys}│{$2}"
},
{
"type": "display",
"key": "│{#green}│ {icon} Display │{$4}│{#keys}│{$2}",
"compactType": "original-with-refresh-rate"
},
{
"type": "gpu",
"key": "│{#green}│ {icon} G-Driver │{$4}│{#keys}│{$2}",
"format": "{driver}"
},
{
"type": "custom",
"key": "│{#green}└──────────────┴{$1}┘{#keys}│",
"format": ""
},
// Terminal
{
"type": "custom",
"key": "│{#yellow}┌──────────────┬{$1}┐{#keys}│\u001b[37D",
"format": "{#bright_yellow} Terminal "
},
{
"type": "shell",
"key": "│{#yellow}│ {icon} Shell │{$4}│{#keys}│{$2}"
},
{
"type": "terminal",
"key": "│{#yellow}│ {icon} Terminal │{$4}│{#keys}│{$2}"
},
{
"type": "terminalfont",
"key": "│{#yellow}│ {icon} Term Font │{$4}│{#keys}│{$2}"
},
{
"type": "terminaltheme",
"key": "│{#yellow}│ {icon} Colors │{$4}│{#keys}│{$2}"
},
{
"type": "packages",
"key": "│{#yellow}│ {icon} Packages │{$4}│{#keys}│{$2}"
},
{
"type": "custom",
"key": "│{#yellow}└──────────────┴{$1}┘{#keys}│",
"format": ""
},
// Development
{
"type": "custom",
"key": "│{#red}┌──────────────┬{$1}┐{#keys}│\u001b[39D",
"format": "{#bright_red} Development "
},
{
"type": "command",
"keyIcon": "",
"key": "│{#red}│ {icon} Rust │{$4}│{#keys}│{$2}",
"text": "rustc --version | cut -d' ' -f2",
"format": "rustc {}"
},
{
"type": "command",
"keyIcon": "",
"key": "│{#red}│ {icon} Clang │{$4}│{#keys}│{$2}",
"text": "clang --version | head -1 | awk '{print $NF}'",
"format": "clang {}"
},
{
"type": "command",
"keyIcon": "",
"key": "│{#red}│ {icon} NodeJS │{$4}│{#keys}│{$2}",
"text": "node --version",
"format": "node {~1}"
},
{
"type": "command",
"keyIcon": "",
"key": "│{#red}│ {icon} Go │{$4}│{#keys}│{$2}",
"text": "go version | cut -d' ' -f3",
"format": "go {~2}"
},
{
"type": "command",
"keyIcon": "",
"key": "│{#red}│ {icon} Zig │{$4}│{#keys}│{$2}",
"text": "zig version",
"format": "zig {}"
},
{
"type": "editor",
"key": "│{#red}│ {icon} Editor │{$4}│{#keys}│{$2}"
},
{
"type": "command",
"keyIcon": "",
"key": "│{#red}│ {icon} Git │{$4}│{#keys}│{$2}",
"text": "git version",
"format": "git {~12}"
},
{
"type": "font",
"key": "│{#red}│ {icon} Interface │{$4}│{#keys}│{$2}"
},
{
"type": "custom",
"key": "│{#red}└──────────────┴{$1}┘{#keys}│",
"format": ""
},
// Uptime
{
"type": "custom",
"key": "│{#magenta}┌──────────────┬{$1}┐{#keys}│\u001b[36D",
"format": "{#bright_magenta} Uptime "
},
{
"type": "uptime",
"key": "│{#magenta}│ {icon} Uptime │{$4}│{#keys}│{$2}"
},
{
"type": "users",
"myselfOnly": true,
"keyIcon": "",
"key": "│{#magenta}│ {icon} Login │{$4}│{#keys}│{$2}"
},
{
"type": "disk",
"keyIcon": "",
"key": "│{#magenta}│ {icon} OS Age │{$4}│{#keys}│{$2}",
"folders": "/", // On macOS, "/System/Volumes/VM" works for me
"format": "{create-time:10} [{days} days]"
},
{
"type": "custom",
"key": "│{#magenta}└──────────────┴{$1}┘{#keys}│",
"format": ""
},
{
"type": "custom",
"key": "└─────────────────{$1}┘",
"format": ""
},
// End
"break",
"colors"
]
}
This JSON configuration file is for fastfetch, a system information tool similar to neofetch but written in C for better performance. It defines how system information is displayed, including formatting, colors, and layout. The configuration is highly customized, using ANSI escape codes for precise cursor positioning and Unicode characters for visual elements like borders and icons. Below, I'll break down the key components and explain how this configuration works, as well as provide some context and potential improvements.
This configuration creates a visually appealing, table-like output with sections for system information, hardware, desktop environment, terminal, development tools, and uptime. Each section is color-coded and uses Unicode box-drawing characters to create a structured layout. The configuration also uses ANSI escape codes (\u001b[...) to control cursor positioning and text formatting.
Key features:
fastfetch modules (e.g., cpu, gpu, os) and custom modules (via type: "custom") to display headers and footers for sections.\u001b[47D, \u001b[47C, etc.) to align text within the table structure.$schema"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json"
This specifies the JSON schema for validation, ensuring the configuration adheres to fastfetch's expected format.
display Section"display": {
"color": {
"keys": "blue"
},
"separator": "",
"constants": [
"──────────────────────────────────────────────",
"\u001b[47D",
"\u001b[47C",
"\u001b[46C"
],
"brightColor": false
}
color.keysseparator: Set to an empty string, meaning no default separator is used between key and value. Instead, custom separators are defined in the key fields of modules.constants: Defines reusable strings, accessible as {$1}, {$2}, etc., in module definitions:
{$1}: A horizontal line (──────────────────────────────────────────────) used for borders.{$2}: \u001b[47D (move cursor 47 positions left).{$3}: \u001b[47C (move cursor 47 positions right).{$4}: \u001b[46C (move cursor 46 positions right).
These constants are used to align text and draw the table structure.brightColor: Disables bright colors, ensuring a more muted color scheme.modules SectionThe modules array defines the information to display and how to format it. Each module can be a built-in fastfetch module (e.g., os, cpu) or a custom module (e.g., for headers/footers). Modules are grouped into sections, each with a header, content, and footer.
Each module typically has:
type: Specifies the type of information to display (e.g., os, cpu, custom).key: Defines the label (left column) of the output, often including formatting and cursor positioning.format: Customizes the output format for the module's value (right column).keyIcon: (Optional) Specifies a custom icon for the module (used in some custom command modules).This section displays basic system information, such as OS, date/time, and locale.
{
"type": "version",
"key": "┌───────────────┬─{$1}┐\u001b[41D",
"format": "\u001b[1m{#keys} {1} - {2} "
}
fastfetch version.key: Draws the top border of the table (┌───────────────┬─) followed by a horizontal line ({$1}) and moves the cursor left (\u001b[41D) to position the value.format: Uses bold text (\u001b[1m) and the key color ({#keys}) to display the version.{
"type": "os",
"key": "│ {icon} \u001b[s{sysname}\u001b[u\u001b[10C│{$3}│{$2}"
}
key: Uses the OS icon ({icon}), saves the cursor position (\u001b[s), prints the system name ({sysname}), restores the cursor position (\u001b[u), moves right (\u001b[10C), and draws the table borders (│{$3}│{$2}).{
"type": "datetime",
"key": "│ {icon} Fetched │{$3}│{$2}",
"format": "{year}-{month-pretty}-{day-pretty} {hour-pretty}:{minute-pretty}:{second-pretty} {timezone-name}"
}
format: Customizes the output to show a detailed timestamp with timezone.{
"type": "locale",
"key": "│ {icon} Locale │{$3}│{$2}"
}
This section displays hardware-related information, such as chassis, RAM, CPU, etc. It is color-coded in cyan.
{
"type": "custom",
"key": "│{#cyan}┌──────────────┬{$1}┐{#keys}│\u001b[37D",
"format": "{#bright_cyan} Hardware "
}
key: Draws the top border of the subsection in cyan ({#cyan}) and positions the cursor.format: Displays "Hardware" in bright cyan.{
"type": "chassis",
"key": "│{#cyan}│ {icon} Chassis │{$4}│{#keys}│{$2}"
}
key: Uses cyan for the borders and positions the cursor for alignment.Similar modules follow for memory, swap, cpu, gpu, disk, and battery, each with consistent formatting and cyan coloring.
{
"type": "custom",
"key": "│{#cyan}└──────────────┴{$1}┘{#keys}│",
"format": ""
}
This section displays desktop environment information, color-coded in green.
{
"type": "custom",
"key": "│{#green}┌──────────────┬{$1}┐{#keys}│\u001b[37D",
"format": "{#bright_green} Desktop "
}
Modules for de (desktop environment), wm (window manager), display, and GPU driver follow, each with green borders.
This section displays terminal-related information, color-coded in yellow.
{
"type": "custom",
"key": "│{#yellow}┌──────────────┬{$1}┐{#keys}│\u001b[37D",
"format": "{#bright_yellow} Terminal "
}
Modules for shell, terminal, terminalfont, terminaltheme, and packages follow, each with yellow borders.
This section displays development tool versions, color-coded in red. It uses command modules to fetch version information via shell commands.
{
"type": "custom",
"key": "│{#red}┌──────────────┬{$1}┐{#keys}│\u001b[39D",
"format": "{#bright_red} Development "
}
Example command module:
{
"type": "command",
"keyIcon": "",
"key": "│{#red}│ {icon} Rust │{$4}│{#keys}│{$2}",
"text": "rustc --version | cut -d' ' -f2",
"format": "rustc {}"
}
rustc --version | cut -d' ' -f2 to get the Rust compiler version.keyIcon: Uses a custom icon () for Rust.format: Displays the version with the prefix "rustc".Similar modules follow for Clang, Node.js, Go, Zig, editor, Git, and font.
This section displays uptime and related information, color-coded in magenta.
{
"type": "custom",
"key": "│{#magenta}┌──────────────┬{$1}┐{#keys}│\u001b[36D",
"format": "{#bright_magenta} Uptime "
}
Modules for uptime, users, and OS installation age (disk) follow, each with magenta borders.
{
"type": "custom",
"key": "└─────────────────{$1}┘",
"format": ""
}
"break",
"colors"
When fastfetch runs with this configuration, it:
key and format fields, using ANSI escape codes for cursor positioning and color.The result is a highly structured, visually appealing output that looks like a table with sections for different types of system information.
While this configuration is already very polished, here are some suggestions for improvement or customization:
Error Handling for Commands:
command modules (e.g., for Rust, Clang) assume the tools are installed. If a tool is not installed, the command will fail, and the output may look broken. Consider adding a fallback or error message:
{
"type": "command",
"keyIcon": "",
"key": "│{#red}│ {icon} Rust │{$4}│{#keys}│{$2}",
"text": "rustc --version | cut -d' ' -f2 || echo 'Not installed'",
"format": "rustc {}"
}
Dynamic Width Adjustment:
\u001b[47D and \u001b[47C. This works well for terminals of a specific width but may break in narrower or wider terminals. Consider using fastfetch's built-in width detection or making the table width configurable.Conditional Modules:
battery) are irrelevant on desktop systems. You could use fastfetch's conditional module feature to only display certain modules on specific system types (e.g., laptops).Localization:
fastfetch's localization features or external scripts to dynamically set labels.Performance Optimization:
command modules, which execute shell commands. This can slow down the output, especially on systems with slow I/O. Consider caching results or using built-in fastfetch modules where possible.Icon Customization:
{icon}) are provided by fastfetch based on the module type. For more control, you could hardcode specific Unicode icons or use a custom icon set.Theme Support:
{#cyan}, {#green}). To support different terminal themes, consider using fastfetch's theme detection or allowing users to override colors via environment variables.Here’s a simplified example of what the output might look like (actual output depends on your system):
┌───────────────┬──────────────────────────────────────────────┐
│ fastfetch │ fastfetch 2.0.0 - x86_64-linux-gnu
│ 🐧 Linux │ Arch Linux
│ 📅 Fetched │ 2023-October-Friday 14:30:45 PDT
│ 🌐 Locale │ en_US.UTF-8
│┌──────────────┬──────────────────────────────────────────────┐
│ Hardware
││ 🖥️ Chassis │ Desktop
││ 🧠 RAM │ 15.6 GiB / 32.0 GiB
││ 💾 SWAP │ 0.0 GiB / 8.0 GiB
││ 🔢 CPU │ AMD Ryzen 7 5800X (8 cores, 16 threads)
││ 🎮 GPU │ NVIDIA GeForce RTX 3080
││ 💽 Disk │ 250.0 GiB / 1.0 TiB (25%) - ext4
││ 🔋 Battery │ Not detected
│└──────────────┴──────────────────────────────────────────────┘
│┌──────────────┬──────────────────────────────────────────────┐
│ Desktop
││ 🖼️ Desktop │ GNOME 44.3
││ 🪟 Session │ X11
││ 🖥️ Display │ 1920x1080 @ 144Hz
││ 🎮 G-Driver │ NVIDIA 535.86.05
│└──────────────┴──────────────────────────────────────────────┘
│┌──────────────┬──────────────────────────────────────────────┐
│ Terminal
││ 🖥️ Shell │ zsh 5.9
││ 🖥️ Terminal │ GNOME Terminal 3.48.1
││ 🖋️ Term Font │ Fira Code 12
││ 🎨 Colors │ Solarized Dark
││ 📦 Packages │ 1234 (pacman)
│└──────────────┴──────────────────────────────────────────────┘
│┌──────────────┬──────────────────────────────────────────────┐
│ Development
││ Rust │ rustc 1.72.0
││ Clang │ clang 15.0.7
││ NodeJS │ node 18.17.1
││ Go │ go 1.21.0
││ Zig │ zig 0.11.0
││ 🖋️ Editor │ Visual Studio Code
││ Git │ git 2.41.0
││ 🖋️ Interface │ Fira Sans 10
│└──────────────┴──────────────────────────────────────────────┘
│┌──────────────┬──────────────────────────────────────────────┐
│ Uptime
││ ⏰ Uptime │ 5 days, 3 hours, 15 minutes
││ Login │ user@hostname
││ OS Age │ 2022-01-15 [600 days]
│└──────────────┴──────────────────────────────────────────────┘
└───────────────────────────────────────────────────────────────┘
[Color palette]
This fastfetch configuration is a great example of how to create a highly customized, visually appealing system information display. It leverages fastfetch's powerful formatting capabilities, including ANSI escape codes, Unicode characters, and custom commands. With some minor tweaks (e.g., error handling, dynamic width), it could be made even more robust and adaptable to different systems and terminal environments.
If you have specific questions about any part of the configuration or need help implementing improvements, feel free to ask!