Skip to content

Migrate themes to SD card #29

@anarchyysm

Description

@anarchyysm

Problem

Goal: the 12 themes move out of screen_themes.conf on flash and live in themes/*/theme.conf on SD.
Estimated effort: 2 days

Proposed Solution

  • Create Service/storage_api/include/tos_theme.h
  • Create Service/storage_api/tos_theme.c
  • Implement theme.conf parser (sections [meta], [colors], [protocol_colors])
  • Implement 0xRRGGBB hex → lv_color_t conversion
  • Implement color application to global lv_style_t
  • Implement tos_theme_set_active_protocol(protocol) to swap border_accent for the protocol color
  • Implement fallback: if theme.conf on SD fails, read screen_themes.conf from flash
  • Convert all 12 existing themes from screen_themes.conf to the theme.conf folder format:
    • themes/default/theme.conf
    • themes/matrix/theme.conf
    • themes/cyber_blue/theme.conf
    • themes/blood/theme.conf
    • themes/toxic/theme.conf
    • themes/ghost/theme.conf
    • themes/neon_pink/theme.conf
    • themes/amber/theme.conf
    • themes/terminal/theme.conf
    • themes/ice/theme.conf
    • themes/deep_purple/theme.conf
    • themes/midnight/theme.conf
  • Add the 7 protocol_* tokens to each theme.conf (can use border_accent value as initial default)
  • Implement automatic migration in first_boot_setup(): if themes/ is empty, copy the 12 themes from flash to SD
  • Test: ls /sdcard/themes/ returns 12 directories
  • Test: manually change theme in config/screen.conf and reboot — screens reflect the new colors

Use Case

No response

Alternatives Considered

No response

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

Projects

Status

In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions