Name the Brick Fn switch popup after the configured action#1550
Open
Felixmil wants to merge 1 commit into
Open
Name the Brick Fn switch popup after the configured action#1550Felixmil wants to merge 1 commit into
Felixmil wants to merge 1 commit into
Conversation
- spruce/brick/fn_dip/show_fn_dip_on_msg.sh: - derive the popup label from the active switch action in /usr/trimui/scene - map ledc/quiet/silent/joystick scripts to short labels, fall back to "ON" - invert the LED label so switch-on reads "LED: OFF" - spruce/brick/fn_dip/show_fn_dip_off_msg.sh: - same action-name derivation, fall back to "OFF" - invert the LED label so switch-off reads "LED: ON" - spruce/scripts/platform/device_functions/trimui_a133p.sh: - bind-mount both popup scripts over the firmware copies in runtime_mounts_a133p, before trimui_scened starts
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.
On the TrimUI Brick, flipping the physical Fn switch shows an on-screen popup that always reads a generic ON / OFF, giving no indication of what the switch just toggled. This makes the popup label the configured switch action instead (for example Silent: ON, Quiet: OFF, LED: OFF), so the feedback matches what the switch actually does. The stock firmware popups live in the read-only
/usr/trimuipartition, so spruce overlays its own versions at boot using the same bind-mount mechanism it already uses for other Brick firmware files.Popup scripts
Two replacement popup scripts live under
spruce/brick/fn_dip/. Each derives the label from the active switch action, which is the single script present in/usr/trimui/scene/, by mapping that script's basename to a short name (LED, Quiet, Silent, Joystick). Anything unmapped falls back to the original ON / OFF, so unknown or future actions degrade gracefully. The lookup is self-contained POSIX shell with no dependency on jq, since the daemon runs these on every flip.The LED action is the stock "LED off" toggle, where switch-on turns the LEDs off. Its label is therefore inverted relative to the switch state (switch-on shows
LED: OFF, switch-off showsLED: ON) so the text reflects the LED state rather than the switch position. The other actions follow the switch state directly.Boot integration
runtime_mounts_a133pin the A133P device init now bind-mounts both popup scripts over their firmware copies in/usr/trimui/apps/fn_editor/, alongside the existing/etcand SDL bind-mounts and beforetrimui_scened(the daemon that invokes the popups) starts. This keeps the firmware partition untouched and leaves no trace when the SD card is removed.This builds on the Fn switch dispatch path; the popup only appears while the switch events are being handled (see #1548).