- Python system monitor for USB-C/TFT displays (Turing, XuanFang, Kipye, WeAct) with 3 usage modes: main app (
main.py), config tool (configure.py), and theme editor (theme-editor.py). - The design clearly separates sensor collection, theme rendering, and hardware driver so multiple display revisions can be supported without changing business logic.
- Application entry point:
main.pyorchestrates initialization, scheduler loop, tray icon, and OS signals. - Central config:
library/config.pyloadsconfig.yaml, thenres/themes/<THEME>/theme.yamlwith fallback to defaults. - LCD driver factory:
library/display.pyselects the implementation viaREVISION(A/B/C/D/TUR_USB/WEACT_A/WEACT_B/SIMU). - Hardware drivers:
library/lcd/containsLcdComm*classes (serial/USB) with a uniform API (InitializeComm,DisplayBitmap,DisplayText,SetBrightness, etc.). - Sensors and stats rendering:
library/stats.pycollects metrics (CPU/GPU/RAM/disk/net/weather) and applies theme styles. - Scheduling:
library/scheduler.pyuses decorators (@schedule,@async_job) plus a queue to serialize writes to the display.
config.yaml-> selects hardware/theme/options.library/stats.py-> retrieves values based onHW_SENSORS(AUTO,PYTHON,LHM,STUB).library/display.py+LcdComm*driver -> converts to image/text and pushes to the display.- Dev mode without hardware:
REVISION: SIMUwrites a capture (screencap.png) throughlibrary/lcd/lcd_simulated.py.
- Install dependencies:
pip install -r requirements.txt. - Run app:
python main.py. - Configure via GUI:
python configure.py. - LCD API usage example:
python simple-program.py. - Windows packaging:
pyinstaller turing-system-monitor.spec(bundlesmain,configure,theme-editor,res/,external/,config.yaml).
- License header expected in
.pyfiles:SPDX-License-Identifier: GPL-3.0-or-later(seemain.py). - YAML-first configuration: avoid hardcoding; add options in
config.yamlfirst, then load them inlibrary/config.py. - The project is multi-platform (Windows, macOS, Linux): new code must remain compatible across these platforms.
- Platform-specific code blocks are allowed when required, but prefer direct cross-platform implementations whenever possible.
- Hardware routing goes through
REVISION; do not add a new revision outside the factory inlibrary/display.py. - Periodic updates go through
library/scheduler.py(avoid ad-hoc parallel loops that write to the device). - UI rendering depends on theme keys (example structure in
res/themes/default.yaml): keep schema compatibility.
- Keep pull request changes as limited and focused as possible; avoid broad refactors unless explicitly requested.
- This repository has many users, forks, and open PRs: prefer minimal diffs to reduce merge conflicts and downstream breakage.
- If changes touch different topics, split them into multiple PRs (one topic per PR).
- If a PR is large, split it into several smaller PRs that can be reviewed and merged independently.
- Assume every PR is reviewed by a human maintainer; write clear, reviewable commits and preserve existing behavior by default.
- Breaking changes are unlikely to be merged; maintain backward compatibility unless a maintainer explicitly approves a compatibility break.
pyserialfor serial displays (A/B/C/D, WeAct),pyusbfor Turing USB models.- Advanced Windows sensors:
pythonnet+ DLLs inexternal/LibreHardwareMonitor/. - System metrics:
psutil,GPUtil,pyamdgpuinfo/pyadldepending on OS/GPU. - UI stack:
pystray(tray),tkinter+sv-ttk(config GUI),Pillow/numpy(images).
- Runtime orchestration:
main.py - Config/theme loading:
library/config.py - Display selection and dimensions:
library/display.py - Scheduler/periodic jobs:
library/scheduler.py - Sensor collection/rendering:
library/stats.py - User config schema:
config.yaml - Low-level API example:
simple-program.py - Executable build spec:
turing-system-monitor.spec