Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions docs/pyui-screensaver-customization.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# PyUI Screensaver Customization

## Install Backgrounds

Copy user screensaver images to:

```text
/mnt/SDCARD/App/PyUI/screensavers/
```

SMB path:

```text
\\<device-ip>\sdcard\App\PyUI\screensavers
```

Supported formats: `.png`, `.jpg`, `.jpeg`, `.bmp`, `.gif`.

Theme-specific defaults can also be added as:

```text
/mnt/SDCARD/Themes/<ThemeName>/screensaver.png
/mnt/SDCARD/Themes/<ThemeName>/screensaver.gif
```

## Settings

Open `Settings > Screensaver`.

- `Timeout`: global idle timeout before screensaver starts.
- `Background image`: choose image/GIF with preview.
- `Background color`: RGB picker with live preview.
- `Overlay opacity`: dim background.
- `Edit layout`: visual widget editor.

## Visual Layout Editor

- D-pad: move selected widget.
- `L1` / `R1`: decrease/increase widget size.
- `L2` / `R2`: cycle quick colors.
- `START`: open RGB picker for selected widget color.
- `Y`: change font for clock/date/text, or battery style for battery.
- `X`: show/hide selected widget.
- `SELECT`: switch selected widget.
- `A`: save.
- `B`: cancel.

Included widget fonts:

- `PressStart2P-Regular.ttf`
- `VT323-Regular.ttf`
- `Silkscreen-Regular.ttf`
- `PixelifySans.ttf`
- `Orbitron.ttf`
- `Audiowide-Regular.ttf`
- `BungeeShade-Regular.ttf`
- `EmilysCandy-Regular.ttf`

Battery styles:

- `percent`
- `blocks`
- `bar`
- `pill`
- `segments`

## Performance Notes

Animated GIFs are only loaded after the screensaver timeout and are freed when the user wakes the device. Large 1280x720 GIFs with many frames can still use more memory while active, so prefer short optimized loops.
Binary file added docs/pyui-screensaver-style-preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fonts/Audiowide-Regular.ttf
Binary file not shown.
Binary file added fonts/BungeeShade-Regular.ttf
Binary file not shown.
Binary file added fonts/EmilysCandy-Regular.ttf
Binary file not shown.
Binary file added fonts/Orbitron.ttf
Binary file not shown.
Binary file added fonts/PixelifySans.ttf
Binary file not shown.
Binary file added fonts/PressStart2P-Regular.ttf
Binary file not shown.
Binary file added fonts/Silkscreen-Regular.ttf
Binary file not shown.
Binary file added fonts/VT323-Regular.ttf
Binary file not shown.
16 changes: 8 additions & 8 deletions main-ui/controller/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ def _matches_secret_prefix():
if len(h) < plen:
return False

return h[-plen:] == p
return h[-plen:] == p

@staticmethod
def set_last_input(last_input):
if(last_input == ControllerInput.LEFT_STICK_UP):
Expand Down Expand Up @@ -259,7 +259,7 @@ def last_input():
# PyUiLogger.get_logger().info(f"Returning last input: {Controller.last_controller_input}")
return Controller.last_controller_input

@staticmethod
@staticmethod
def add_button_watcher(button_watcher):
Controller.additional_button_watchers.append(button_watcher)

Expand All @@ -278,9 +278,9 @@ def check_for_hotkey():
if(Controller.get_input(timeout=0.05, called_from_check_for_hotkey=True)):
Controller.perform_hotkey(Controller.last_input())
time.sleep(0.1)
was_hotkey = True
was_hotkey = True
elif(Controller.non_sdl_input is not None):
was_hotkey = True
was_hotkey = True
Controller.perform_hotkey(Controller.non_sdl_input)
time.sleep(0.1)

Expand All @@ -289,7 +289,7 @@ def check_for_hotkey():
Controller.controller_interface.restore_cached_event()
Controller.is_check_for_hotkey = False
return was_hotkey

@staticmethod
def perform_hotkey(controller_input):
PyUiLogger.get_logger().info(f"Performing hotkey for {controller_input}")
Expand All @@ -298,15 +298,15 @@ def perform_hotkey(controller_input):
Device.get_device().raise_lumination()
elif(ControllerInput.VOLUME_DOWN == controller_input):
Device.get_device().lower_lumination()

@staticmethod
def non_sdl_input_event(controller_input, is_down):
TRIGGER_TIME_FOR_HOLD_BUTTONS = 2

if(is_down):
if(controller_input in Controller.hold_buttons):
if controller_input not in Controller.last_press_time_map:
Controller.last_press_time_map[controller_input] = time.time()
Controller.last_press_time_map[controller_input] = time.time()
else:
last_press_time_length = time.time() - Controller.last_press_time_map[controller_input]
if(last_press_time_length > TRIGGER_TIME_FOR_HOLD_BUTTONS):
Expand Down
Loading