Skip to content
Merged
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
33 changes: 14 additions & 19 deletions bin/screenshot
Original file line number Diff line number Diff line change
@@ -1,30 +1,25 @@
#!/bin/sh

get_screenshot_prefix() {
screenshot_prefix="$(cat /mnt/SDCARD/.userdata/shared/.minui/recent.txt | head -n1 | cut -d$'\t' -f2)"
if [ -z "$screenshot_prefix" ]; then
screenshot_prefix="Screenshot"
game_name="$(cat /mnt/SDCARD/.userdata/shared/.minui/recent.txt | head -n1 | cut -d$'\t' -f2)"
if [ -z "$game_name" ]; then
game_name="Screenshot"
fi

is_running_minarch="false"
is_running_mupen64plus="false"
is_running_drastic="false"
is_running_ppsspp="false"
use_screenshot_prefix="false"
if pgrep "minarch.elf" >/dev/null 2>&1; then
is_running_minarch="true"
fi
if pgrep "mupen64plus" >/dev/null 2>&1; then
is_running_mupen64plus="true"
fi
if pgrep "drastic" >/dev/null 2>&1; then
is_running_drastic="true"
fi
if pgrep "PPSSPPSDL" >/dev/null 2>&1; then
is_running_ppsspp="true"
use_screenshot_prefix="true"
elif pgrep "mupen64plus" >/dev/null 2>&1; then
use_screenshot_prefix="true"
elif pgrep "drastic" >/dev/null 2>&1; then
use_screenshot_prefix="true"
elif pgrep "PPSSPPSDL" >/dev/null 2>&1; then
use_screenshot_prefix="true"
fi

if [ "$is_running_minarch" = "false" ] && [ "$is_running_mupen64plus" = "false" ] && [ "$is_running_drastic" = "false" ] && [ "$is_running_ppsspp" = "false" ]; then
screenshot_prefix="Screenshot"
screenshot_prefix="Screenshot"
if [ "$use_screenshot_prefix" != "true" ]; then
screenshot_prefix="$game_name"
fi

echo "$screenshot_prefix"
Expand Down