Skip to content

feat: add TrimUI PyUI media and fn settings#1565

Open
vigstudio wants to merge 9 commits into
spruceUI:Developmentfrom
vigstudio:feature/trimui-stock-settings
Open

feat: add TrimUI PyUI media and fn settings#1565
vigstudio wants to merge 9 commits into
spruceUI:Developmentfrom
vigstudio:feature/trimui-stock-settings

Conversation

@vigstudio

Copy link
Copy Markdown

Why

TrimUI Smart Pro/S users need PyUI-native access to stock-like video playback and Fn/DIP switch settings without falling back to the stock TrimUI UI. The stock CPU scene scripts also fail under spruceOS because CPU sysfs controls are locked and some stock frequencies are invalid on Smart Pro S, so Fn slider CPU performance mode does not apply reliably.

What Changed

  • Added PyUI Video Player browse, search, and controls screens backed by the existing MEDIA launcher.
  • Added PyUI Fn Key Settings for stock TrimUI DIP switch scene actions and joystick mode.
  • Added English and Vietnamese strings for the new PyUI screens.
  • Added Video Player and Fn editor icons, and made built-in app icons prefer app-folder icons.
  • Updated backlight Fn script to write the device backlight directly and persist brightness in /mnt/UDISK/system.json.
  • Added Smart Pro S CPU performance/save scene scripts that unlock and re-lock CPU sysfs controls and use valid CPU4 frequencies.
  • Updated buttons_watchdog.sh to poll GPIO363 for Fn slider/DIP changes, run scene scripts, and stop prior scene script instances before starting new ones.

Verification

  • Ran git diff --check successfully.
  • Ran python -m py_compile for trimui_fn_settings_app.py, video_player_app.py, and app_menu.py successfully.
  • On TrimUI Smart Pro S over SSH, toggled the physical Fn slider and verified /tmp/buttons_watchdog_dip.log recorded state 1 and state 0 transitions.
  • Verified CPU4 changes to performance 1992000 1992000 for performance state and returns to ondemand 1008000 1992000 for normal state.

vigstudio added 5 commits July 2, 2026 11:37
Expose fn_editor for Smart Pro family devices and mirror Smart Pro display color settings with safe sysfs fallbacks on Smart Pro S.
Launch the firmware TinaPlayer via /usr/trimui/apps/player from PyUI Apps, and drop the mistaken display calibration changes on Smart Pro S.
Replace stock firmware app launches with themed PyUI menus: video browser plus ffplay playback, and Smart Pro Fn or switch toggles. Hide the legacy VideoPlayer wrapper and keep stock fneditor on Brick only.
Lazy-import Video Player and Fn settings in app_menu, and defer MiyooTrimCommon import until playback.
@vigstudio
vigstudio marked this pull request as ready for review July 2, 2026 10:05
Comment thread spruce/scripts/buttons_watchdog.sh Outdated
brightness_up
fi
;;
*"key $B_L3 1"*) # Left Fn key down

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the fn-key have the same keycode as L3/R3?

Even if it does this should be slightly refactored to

  1. Have a new export for fn-key instead of reusing l3/r3
  2. Make a call to fn_key_down/fn_key_up
  3. in device.sh just make empty fn_key_down/up methods like all the others in there
  4. move the run_fn_config into SmartProS.sh and this call into fn_key_down/up methods from (3)

Comment thread App/PyUI/main-ui/menus/app/app_menu.py Outdated
return ControllerInput.R1



Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are most of the line changes just line ending?

".mp4", ".mkv", ".avi", ".mov", ".flv", ".ts", ".webm",
".m4v", ".wmv", ".mpeg", ".mpg", ".3gp",
}
VIDEO_ROOT = "/mnt/SDCARD/Roms/MEDIA"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update these to go through py-ui-config.json (located in App/PyUI/py-ui-config.json) and loaded through PyUiConfig.py

…ui-stock-settings

# Conflicts:
#	App/PyUI/lang/English.json
#	App/PyUI/lang/Vietnamese.json
#	App/PyUI/main-ui/menus/app/app_menu.py
@vigstudio

vigstudio commented Jul 8, 2026

Copy link
Copy Markdown
Author

Updated branch vigstudio:feature/trimui-stock-settings.

Changes addressed:

  • Merged current upstream/Development and resolved conflicts in English.json, Vietnamese.json, and app_menu.py.
  • Reduced app_menu.py conflict to functional app additions while keeping upstream i18n descriptions.
  • Moved video root path into App/PyUI/py-ui-config.json and PyUiConfig.get_video_root_path().
  • Added device-level fn_key_down / fn_key_up hooks, SmartProS-specific Fn handling, and separate B_FN_LEFT / B_FN_RIGHT exports instead of using B_L3 / B_R3 directly in buttons_watchdog.sh.

Validation run:

  • python -m json.tool App/PyUI/lang/English.json
  • python -m json.tool App/PyUI/lang/Vietnamese.json
  • python -m json.tool App/PyUI/py-ui-config.json
  • python -m py_compile App/PyUI/main-ui/menus/app/app_menu.py App/PyUI/main-ui/menus/apps/video_player_app.py App/PyUI/main-ui/menus/apps/trimui_fn_settings_app.py App/PyUI/main-ui/utils/py_ui_config.py
  • bash -n spruce/scripts/buttons_watchdog.sh spruce/scripts/platform/device.sh spruce/scripts/platform/device_functions/SmartProS.sh App/fn_editor/com.trimui.cpuperformance.sh App/fn_editor/com.trimui.cpusave.sh App/fn_editor/com.trimui.switch.backlight.sh

Note: git diff --check still reports trailing whitespace from the upstream/Development i18n merge content; I left it untouched to avoid a broad whitespace-only cleanup in this PR.

@vigstudio

Copy link
Copy Markdown
Author

Created duplicate PyUI-only PR for MainPyUI:
chrisj951/MainPyUI#91

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.

2 participants