Skip to content
Merged
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
1 change: 0 additions & 1 deletion .gitarchiveinclude
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
bin/evtest
bin/sdl2imgshow
res/fonts/BPreplayBold.otf
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
.gitattributes export-ignore
.gitarchiveinclude export-ignore
.gitignore export-ignore
Dockerfile.evtest export-ignore
Dockerfile.sdl2imgshow export-ignore
Makefile export-ignore
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ res/fonts/*

!bin/screenshot
!bin/screenshot-monitor
!bin/service-on
!bin/on-boot
24 changes: 0 additions & 24 deletions Dockerfile.evtest

This file was deleted.

10 changes: 1 addition & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,10 @@ BUILD_DATE := "$(shell date -u +%FT%TZ)"
PAK_NAME := $(shell jq -r .label config.json)

clean:
rm -f bin/evtest || true
rm -f bin/sdl2imgshow || true
rm -f res/fonts/BPreplayBold.otf || true

build: bin/evtest bin/sdl2imgshow res/fonts/BPreplayBold.otf

bin/evtest:
docker buildx build --platform linux/arm64 --load -f Dockerfile.evtest --progress plain -t app/evtest:$(TAG) .
docker container create --name extract app/evtest:$(TAG)
docker container cp extract:/go/src/github.com/freedesktop/evtest/evtest bin/evtest
docker container rm extract
chmod +x bin/evtest
build: bin/sdl2imgshow res/fonts/BPreplayBold.otf

bin/sdl2imgshow:
docker buildx build --platform linux/arm64 --load -f Dockerfile.sdl2imgshow --progress plain -t app/sdl2imgshow:$(TAG) .
Expand Down
26 changes: 11 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,31 @@
# trimui-brick-screenshot-monitor.pak
# minui-screenshot-monitor.pak

A TrimUI Brick app allowing for taking screenshots on the device using a hotkey.
A MinUI app allowing for taking screenshots on the device using a hotkey.

## Requirements

- Docker (for building)
This pak is designed and tested on the following MinUI Platforms and devices:

## Building
- `tg5040`: Trimui Brick (formerly `tg3040`), Trimui Smart Pro
- `rg35xxplus`: RG-35XX Plus, RG-34XX, RG-35XX H, RG-35XX SP

```shell
make release
```
Use the correct platform for your device.

## Installation

1. Mount your TrimUI Brick SD card.
1. Mount your MinUI SD card.
2. Download the latest release from Github. It will be named `Screenshot.Monitor.pak.zip`.
3. Copy the zip file to `/Tools/tg5040/Screenshot Monitor.pak.zip`. Please ensure the new zip file name is `Screenshot Monitor.pak.zip`, without a dot (`.`) between the words `Screenshot` and `Monitor`.
3. Copy the zip file to `/Tools/$PLATFORM/Screenshot Monitor.pak.zip`. Please ensure the new zip file name is `Screenshot Monitor.pak.zip`, without a dot (`.`) between the words `Screenshot` and `Monitor`.
4. Extract the zip in place, then delete the zip file.
5. Confirm that there is a `/Tools/tg5040/Screenshot Monitor.pak/launch.sh` file on your SD card.
6. Unmount your SD Card and insert it into your TrimUI Brick.

> [!NOTE]
> The device directory changed from `/Tools/tg3040` to `/Tools/tg5040` in `MinUI-20250126-0` - released 2025-01-26. If you are using an older version of MinUI, use `/Tools/tg3040` instead.
5. Confirm that there is a `/Tools/$PLATFORM/Screenshot Monitor.pak/launch.sh` file on your SD card.
6. Unmount your SD Card and insert it into your MinUI device.

## Usage

> [!IMPORTANT]
> If the zip file was not extracted correctly, the pak may show up under `Tools > Screenshot`. Rename the folder to `Screenshot Monitor.pak` to fix this.

Browse to `Tools > Screenshot Monitor` and press `A` to turn on the screenshot monitor. At this time, it must be turned on manually when the Brick starts in order to function.
Browse to `Tools > Screenshot Monitor` and press `A` to turn on the screenshot monitor.

Press the hotkey when in game. A png screenshot will appear on the SDCard, in `/mnt/SDCARD/Screenshots`, with the name of the game and the current date as the filename.

Expand Down
14 changes: 14 additions & 0 deletions bin/on-boot
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh
bindir="$(dirname "$0")"
progdir="$(dirname "$bindir")"
PAK_NAME="$(basename "$progdir")"

main() {
"$bindir/service-on" &
}

if [ -f "$LOGS_PATH/$PAK_NAME.txt" ]; then
mv "$LOGS_PATH/$PAK_NAME.txt" "$LOGS_PATH/$PAK_NAME.txt.old"
fi

main "$@" >"$LOGS_PATH/$PAK_NAME.txt" 2>&1
29 changes: 29 additions & 0 deletions bin/service-on
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/sh
bindir="$(dirname "$0")"
progdir="$(dirname "$bindir")"
cd "$progdir" || exit 1
PAK_NAME="$(basename "$progdir")"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$progdir/lib"

main() {
cd "$SDCARD_PATH" || exit 1
if [ -f "$LOGS_PATH/$PAK_NAME.service.log" ]; then
mv "$LOGS_PATH/$PAK_NAME.service.log" "$LOGS_PATH/$PAK_NAME.service.log.old"
fi

hotkey="HOTKEY_1"
if [ -f "$progdir/hotkey" ]; then
hotkey="$(cat "$progdir/hotkey")"
fi

if [ -z "$hotkey" ]; then
hotkey="HOTKEY_1"
fi
if [ "$hotkey" != "HOTKEY_1" ] && [ "$hotkey" != "HOTKEY_2" ]; then
hotkey="HOTKEY_1"
fi

(PROGDIR="$progdir" HOTKEY="$hotkey" "$bindir/screenshot-monitor" >"$LOGS_PATH/$PAK_NAME.service.log" 2>&1 &) &
}

main "$@"
Loading