Track icon reapply per device, not per card - #1943
Open
robcodedev wants to merge 1 commit into
Open
Conversation
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.
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>
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.
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_NUMBERand reapplies when it does not match.SERIAL_NUMBERalready comes fromread_uuidearlier inmain, so no new dependency.The theme is re-read from settings after the
themeSwitchercall rather than reusing the value from before it.installThemeresolves the theme throughensureThemePath- named theme, then active theme, then default, then/mnt/SDCARD/miyoo/app, then/customer/app- and writes whatever it settled on back tosettings.jsonandconfig/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_iconsalways exits 0 (reinstallThemeisvoidandmainreturns 0 unconditionally), so the exit code carries no information and is not tested. The re-read is what makes this correct.Cost
One extra
jsonvalcall, 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.