Skip to content

Track icon reapply per device, not per card - #1943

Open
robcodedev wants to merge 1 commit into
OnionUI:v4.5-devfrom
robcodedev:reapply-theme-per-device
Open

Track icon reapply per device, not per card#1943
robcodedev wants to merge 1 commit into
OnionUI:v4.5-devfrom
robcodedev:reapply-theme-per-device

Conversation

@robcodedev

Copy link
Copy Markdown

Problem

The reapply check compares the system theme against config/active_theme, and both live on the SD card. A card whose icons were already applied on one device looks done on the next one, so you keep the first device's icons.

What this does

Records the applied theme in config/theme-applied-$SERIAL_NUMBER and reapplies when it does not match. SERIAL_NUMBER already comes from read_uuid earlier in main, so no new dependency.

The theme is re-read from settings after the themeSwitcher call rather than reusing the value from before it. installTheme resolves the theme through ensureThemePath - named theme, then active theme, then default, then /mnt/SDCARD/miyoo/app, then /customer/app - and writes whatever it settled on back to settings.json and config/active_theme. Re-reading means the state file records the theme resolved in settings after the reapply, rather than the pre-call value, so a fallback does not get recorded as a successful apply of the requested theme.

Note that themeSwitcher --reapply_icons always exits 0 (reinstallTheme is void and main returns 0 unconditionally), so the exit code carries no information and is not tested. The re-read is what makes this correct.

Cost

One extra jsonval call, and only on boots where a reapply actually runs.

Testing

Same card booted on two devices; icons reapplied on the second, and the state file records the theme in use.

The check compared the system theme against config/active_theme. Both
live on the card, so a card that already had its icons applied on one
device looked done on the next one, and you kept the first device's
icons.

Use a theme-applied-$SERIAL_NUMBER file instead.

Re-read the theme from settings after the reapply rather than reusing
the value from before it. themeSwitcher resolves the theme through a
fallback chain and writes whatever it settled on back to settings.json
and config/active_theme, so the re-read records what was resolved after
the reapply.
@robcodedev robcodedev changed the title runtime: track icon reapply per device, not per card Track icon reapply per device, not per card Sep 8, 2026
Copilot AI added a commit to Amiga500/Onion that referenced this pull request Sep 9, 2026
…1943 OnionUI#1944 OnionUI#1945 OnionUI#1946 (runtime.sh, keymon, lt.lang)

Co-authored-by: Amiga500 <16525337+Amiga500@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant