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
2 changes: 2 additions & 0 deletions .gitarchiveinclude
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
bin/minui-btntest-tg5040
bin/minui-btntest-rg35xxplus
bin/minui-keyboard-tg5040
bin/minui-keyboard-rg35xxplus
bin/minui-list-tg5040
Expand Down
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,21 @@ PAK_NAME := $(shell jq -r .label config.json)
PLATFORMS := tg5040 rg35xxplus
MINUI_LIST_VERSION := 0.3.1
MINUI_KEYBOARD_VERSION := 0.2.1
MINUI_BTNTEST_VERSION := 0.2.0

clean:
rm -f bin/minui-btntest-* || true
rm -f bin/minui-keyboard-* || true
rm -f bin/minui-list-* || true
rm -f bin/screenshot-monitor || true
rm -f bin/sdl2imgshow || true
rm -f res/fonts/BPreplayBold.otf || true

build: $(foreach platform,$(PLATFORMS),bin/minui-keyboard-$(platform) bin/minui-list-$(platform) bin/screenshot-monitor) bin/sdl2imgshow res/fonts/BPreplayBold.otf
build: $(foreach platform,$(PLATFORMS),bin/minui-keyboard-$(platform) bin/minui-list-$(platform) bin/minui-btntest-$(platform)) bin/screenshot-monitor bin/sdl2imgshow res/fonts/BPreplayBold.otf

bin/minui-btntest-%:
curl -f -o bin/minui-btntest-$* -sSL https://github.com/josegonzalez/minui-btntest/releases/download/$(MINUI_BTNTEST_VERSION)/minui-btntest-$*
chmod +x bin/minui-btntest-$*

bin/minui-keyboard-%:
curl -f -o bin/minui-keyboard-$* -sSL https://github.com/josegonzalez/minui-keyboard/releases/download/$(MINUI_KEYBOARD_VERSION)/minui-keyboard-$*
Expand Down
7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,7 @@ Press the hotkey when in game. A png screenshot will appear on the SDCard, in `/
> [!IMPORTANT]
> If one of the hotkeys in use is mapped to something else within MinUI, the pak may not trigger.

The default hotkey is Hotkey 1 (or `L3`), the left hotkey button. To utilize a different hotkey, create a file named `hotkey` in the pak folder with the name of the key you want to monitor. Only the following buttons are supported at this time:

- `HOTKEY_1` (left hotkey)
- `HOTKEY_2` (right hotkey)

If another value is specified, this pak will revert to using `HOTKEY_1`.
The default hotkey is `L3` - see the Input app to determine what this maps to on your device. To utilize a different hotkey, create a file named `hotkey` in the pak folder with the name of the key you want to monitor. Any of the buttons supported by [`minui-btntest`](https://github.com/josegonzalez/minui-btntest) are supported.

### Debug Logging

Expand Down
28 changes: 6 additions & 22 deletions bin/screenshot-monitor
Original file line number Diff line number Diff line change
@@ -1,31 +1,15 @@
#!/bin/sh

wait_for_button() {
button="$1"

chmod +x "$PROGDIR/bin/evtest"
"$PROGDIR/bin/evtest" "/dev/input/event3" 2>&1 | while read -r line; do
if echo "$line" | grep -q "code 317 (BTN_THUMBL), *value 1"; then
if [ "$button" = "HOTKEY_1" ]; then
echo "Taking screenshot..."
"$PROGDIR/bin/screenshot" &
fi
fi

if echo "$line" | grep -q "code 318 (BTN_THUMBR), *value 1"; then
if [ "$button" = "HOTKEY_2" ]; then
echo "Taking screenshot..."
"$PROGDIR/bin/screenshot" &
fi
fi
done
}

main() {
echo "Starting screenshot monitor on $HOTKEY..."
chmod +x "$PROGDIR/bin/evtest"
chmod +x "$PROGDIR/bin/minui-btntest-$PLATFORM"

while true; do
echo "Waiting for $HOTKEY..."
wait_for_button "$HOTKEY"
"$PROGDIR/bin/minui-btntest-$PLATFORM" wait just_released all "$HOTKEY"
echo "Taking screenshot..."
"$PROGDIR/bin/screenshot" &
done
}

Expand Down
5 changes: 1 addition & 4 deletions bin/service-on
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@ main() {
fi

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

(PROGDIR="$progdir" HOTKEY="$hotkey" "$bindir/screenshot-monitor" >"$LOGS_PATH/$PAK_NAME.service.txt" 2>&1 &) &
Expand Down
5 changes: 5 additions & 0 deletions launch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,11 @@ main() {
return 1
fi

if [ ! -f "$progdir/bin/minui-btntest-$PLATFORM" ]; then
show_message "$progdir/bin/minui-btntest-$PLATFORM not found" 2
return 1
fi

if [ ! -f "$progdir/bin/minui-keyboard-$PLATFORM" ]; then
show_message "$progdir/bin/minui-keyboard-$PLATFORM not found" 2
return 1
Expand Down
Loading