$ show Swordfish90/cool-retro-term
cool-retro-term is a desktop terminal emulator that simulates the visual appearance of vintage cathode-ray tube (CRT) monitors. It renders a real terminal session (via QMLTermWidget) with a chain of GPU shader effects including scanline patterns, bloom, screen curvature, burn-in, chromatic aberration, and frame reflections. The application is built with Qt 6 (QML and C++) and runs on Linux and macOS. It provides a rich settings interface for customizing all visual parameters, and ships with 14 built-in retro profiles (e.g., Amber, Green, Commodore 64, Apple II) and a curated collection of bitmap fonts to match authentic terminal looks. Architecturally, the C++ layer handles font management (FontManager), font list models, file I/O, and the main entry point. The QML layer composes the terminal window, tabs, settings panels, and the shader pipeline. Shaders are pre-compiled into .qsb files for 48+ combinations of effect flags, enabling smooth runtime switching without compilation latency. Persistent settings are stored in SQLite via a thin QML wrapper (Storage.qml). The application uses two Git submodules: qmltermwidget for the actual terminal emulation and KDSingleApplication for single-instance enforcement. Key entry points include app/main.cpp (C++ startup), app/qml/main.qml (QML root), and the shader fragment files in app/shaders/. External dependencies are Qt 6, QMLTermWidget, and KDSingleApplication. The build system is qmake (with a planned but not yet executed migration to CMake). Packaging is provided for AppImage, DMG, Debian, RPM, and Snap.
The LLM identified 3 files worth highlighting for reuse:
FontManager is a C++ singleton exposed to QML that handles font discovery, resolution, bundling, fallback chains, and rasterization mode. It abstracts the complexity of font metrics and system font enumeration, providing a clean API for QML to select fonts by name or bundled asset. The component is self-contained (only depends on Qt Gui) and could be extracted into any Qt Quick application needing advanced font selection with failover support.
Storage.qml is a minimal QML singleton that wraps Qt Quick's LocalStorage API for persistent key-value settings. It provides getSetting() and setSetting() functions with synchronous reads and lazy database initialization. The pattern is clean, self-contained, and easily reusable in any QML application that needs simple persistent configuration without external dependencies.
utils.js is a lightweight JavaScript utility module for QML providing color mixing (mix), hex string parsing (strToColor), and a lint function. It is dependency-free and implements a simple linear interpolation of RGBA components. This is a reusable pattern for any QML application that needs dynamic color computation or blending, especially in theme or effect systems.