Skip to content

About

Fastfetch config online generator

Resources

Stars

14 stars

Watchers

0 watching

Forks

Repository files navigation

Fastfetch Config Editor

GitHub Pages CI Status

A visual configuration editor for Fastfetch β€” inspect, tweak, and generate config.jsonc through a graphical interface without writing a single line of JSON by hand.

Disclaimer

This project is fully AI generated and barelyβ€Œ tested. Bugs are expected.

Overview

Fastfetch is a cross-platform system information tool. Its configuration file uses the JSONC format, with every available setting defined by a canonical JSON Schema. This project fetches that schema live from the official Fastfetch repository and renders it into a three-panel editing experience modelled after the VS Code Settings UI β€” what you see is what you get.

Features

  • Dynamic JSON Schema forms β€” parses Fastfetch's schema and recursively renders type-appropriate form controls
  • Three-panel layout β€” sidebar navigation, settings editor, and live JSONC preview
  • Comprehensive schema support β€” objects (collapsible nested properties), arrays (add/remove/reorder), enum select boxes, boolean toggles, numeric and text inputs
  • oneOf / anyOf variant switching β€” automatically detects branching schemas, switches between variants, and inherits correct defaults
  • $ref resolution β€” resolves internal schema references recursively against the root schema
  • Module manager β€” purpose-built for Fastfetch's modules array; search, add, delete, reorder, collapse, and convert between string-mode and object-mode
  • Import & export β€” import existing .json / .jsonc files, download a syntax-highlighted config.jsonc
  • Markdown rendering β€” schema description fields support Markdown via marked
  • JSONC syntax highlighting β€” the live preview pane highlights properties, strings, numbers, literals, and punctuation
  • Dark & light theme β€” automatically adapts to the system color scheme
  • Responsive layout β€” optimized for desktop, tablet, and mobile breakpoints

Tech Stack

Category Tools
Framework Vue 3 (<script setup> + TypeScript)
Build tool Vite 8
Language TypeScript ~6.0
Styling SCSS / Sass
Key dependencies jsonc-parser (JSONC parsing), marked (Markdown rendering)
Type checking vue-tsc

Getting Started

# Install dependencies
pnpm install

# Start the development server
pnpm dev

# Build for production
pnpm build

# Preview the production build
pnpm preview

Project Structure

src/
β”œβ”€β”€ main.ts                          # Application entry point
β”œβ”€β”€ App.vue                          # Main shell: three-panel layout, module management, import/export
β”œβ”€β”€ style.scss                       # Global styles & CSS custom properties
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ SchemaField.vue              # Core recursive component: JSON Schema β†’ form controls
β”‚   └── MarkdownDescription.vue      # Markdown renderer wrapping `marked`

Architecture

1. Data Flow

flowchart LR
    A[Remote JSON Schema] -->|fetch| B[App.vue]
    B --> C[reactive config object]
    C --> D[SchemaField recursive render]
    D <-->|v-model| C
    C --> E[Live preview: JSON.stringify]
    E --> F[Syntax highlighting + line numbers]
Loading

2. SchemaField Recursive Component

SchemaField.vue is the heart of the editor. It accepts any JSON Schema node and maps its type and structural features to the appropriate form control:

Schema trait Rendered control
oneOf / anyOf (no const) Variant picker β€” switches the entire sub-form
type: "object" or properties Collapsible property list with add/remove support
type: "array" Array editor with add/remove, each item recursed
enum Select box
type: "boolean" Toggle switch
type: "number" / "integer" Numeric input
Everything else Text input

Key design decisions:

  • Depth tracking via props.depth controls indentation and CSS nesting class
  • Property collapsing uses a Set<string> (collapsedProperties) β€” lightweight, O(1) lookup
  • Smart defaults β€” defaultValue() inspects the schema (e.g. default, minimum, type) to produce a sensible starting value

3. Module Manager

Fastfetch's modules array is the most complex part of the configuration: each element's structure depends on its type. App.vue implements a dedicated module-management layer:

  • Module type selection β€” extracts available modules from items.anyOf[0].oneOf, with real-time search filtering
  • Reordering β€” up / down buttons rearrange modules within the array via splice
  • String mode β€” uncustomized modules are stored as plain strings, keeping configs concise
  • Object mode β€” clicking "Customize" promotes a string module to a full object, exposing the complete sub-schema form
  • Collapse β€” individual module cards can be collapsed to keep long lists manageable

4. Configuration Lifecycle

Phase Implementation
New Resets the reactive config, preserving only the $schema reference
Import Uses jsonc-parser to parse the selected .jsonc file, merging into the current config
Edit SchemaField binds bidirectionally to the reactive config object β€” changes appear instantly
Export Serialises the config with JSON.stringify, wraps it in a JSONC template (with // Generated header), and triggers a Blob download

License

MIT

About

Fastfetch config online generator

Resources

Stars

14 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages