$ show doctorhetfield-cmd/simpleui.koplugin
SimpleUI is a KOReader plugin that provides a highly customizable, distraction-free user interface overlay for the KOReader e-book reader application. It replaces the default homescreen with a modular widget system (clock, currently reading, recent books, reading stats, cover deck, etc.), adds configurable top/bottom bars, quick settings bar, library enhancements (virtual browsing, cover overrides), reading statistics and streaks with heatmaps, backup/restore, and over-the-air updates. The plugin is implemented in Lua and deeply integrates with KOReader's widget framework, extensively monkey-patching core classes like FileChooser, TouchMenu, and TitleBar. Despite heavy coupling to KOReader internals, the codebase exhibits strong engineering practices: lazy loading, parameterized module factories (e.g., GridRenderer), custom caching layers (cover cache, stats cache), a reusable anti-aliased drawing library, and a self-contained i18n system with PO file parsing. The repository is actively maintained with a well-documented public API for external plugins to register quick actions. It is not a standalone application but a plugin that must be installed within KOReader. The primary risk is reliance on KOReader's internal APIs, which may break with upstream changes.
The LLM identified 5 files worth highlighting for reuse:
Provides pure-function anti-aliased drawing primitives (capsule, rounded rect fill/stroke, progress ring, pentagon) using BlitBuffer alpha masks. Highly reusable because it has no project-specific imports and solves a common e-ink rendering problem.
Implements a single-scale LRU cover bitmap cache with prefer-larger put policy and byte-budget cap (~20 MB). Self-contained, idempotent, and designed for constrained e-reader memory. Can be extracted for any image caching need.
Custom PO file parser and translation loader without monkey-patching global gettext. Handles plural forms and fallbacks. Self-contained and can be reused in any Lua project needing lightweight i18n.
Parameterized factory function `GridRenderer.makeModule(spec)` that returns a complete module table with build, getHeight, updateCovers, updateStats, getMenuItems. Used by at least 5 other modules (Recent, New Books, TBR, Collections, etc.). Demonstrates clean separation of concerns and reusability across multiple contexts.
Python script to extract translatable strings from Lua source files, supporting `_()`, `_lc()`, `N_()`, `N_lc()` calls and stripping Lua comments. Standalone and can be adapted for any Lua project's i18n workflow.