config: unify settings into ~/.config/cardputerzero/config.json#86
Merged
Conversation
Move the launcher config store from the flat key=value file at
/var/lib/applaunch/settings to a single per-user JSON file at
~/.config/cardputerzero/config.json, shared with other apps.
- Add a small header-only JSON reader/writer (cp0_config_json.h) that
maps dotted keys to nested JSON, so flat launcher keys stay top-level
while camera.resolution.{width,height} is a nested object the camera
app reads.
- Rewrite the cp0 and sdl config backends to load/save JSON.
- Camera Resolution in Settings now writes real width/height under
camera.resolution instead of an unused option index, fixing the bug
where the resolution setting had no effect.
No migration from the legacy file (no shipped users yet).
Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/var/lib/applaunch/settings(扁平 key=value)整体迁到单一的用户级 JSON 文件~/.config/cardputerzero/config.json,与其它 app 共享。cp0_config_json.h:dotted key ↔ 嵌套结构,launcher 自身设置为顶层键,camera.resolution.{width,height}为嵌套对象(与 camera 开发者的读取契约一致)。cp0_lvgl_config.cpp与模拟器版sdl_lvgl_config.cpp走 JSON 读写。camera.resolution,而不是无人读取的选项索引。Camera 开发者契约
读取
~/.config/cardputerzero/config.json里的camera.resolution.width/camera.resolution.height(整数),缺失时用自身默认值兜底。示例:{ "camera": { "resolution": { "width": 640, "height": 480 } } }Test plan
Made with Cursor