|
1 | 1 | #!/bin/sh |
2 | 2 |
|
3 | 3 | get_screenshot_prefix() { |
4 | | - screenshot_prefix="$(cat /mnt/SDCARD/.userdata/shared/.minui/recent.txt | head -n1 | cut -d$'\t' -f2)" |
5 | | - if [ -z "$screenshot_prefix" ]; then |
6 | | - screenshot_prefix="Screenshot" |
| 4 | + game_name="$(cat /mnt/SDCARD/.userdata/shared/.minui/recent.txt | head -n1 | cut -d$'\t' -f2)" |
| 5 | + if [ -z "$game_name" ]; then |
| 6 | + game_name="Screenshot" |
7 | 7 | fi |
8 | 8 |
|
9 | | - is_running_minarch="false" |
10 | | - is_running_mupen64plus="false" |
11 | | - is_running_drastic="false" |
12 | | - is_running_ppsspp="false" |
| 9 | + use_screenshot_prefix="false" |
13 | 10 | if pgrep "minarch.elf" >/dev/null 2>&1; then |
14 | | - is_running_minarch="true" |
15 | | - fi |
16 | | - if pgrep "mupen64plus" >/dev/null 2>&1; then |
17 | | - is_running_mupen64plus="true" |
18 | | - fi |
19 | | - if pgrep "drastic" >/dev/null 2>&1; then |
20 | | - is_running_drastic="true" |
21 | | - fi |
22 | | - if pgrep "PPSSPPSDL" >/dev/null 2>&1; then |
23 | | - is_running_ppsspp="true" |
| 11 | + use_screenshot_prefix="true" |
| 12 | + elif pgrep "mupen64plus" >/dev/null 2>&1; then |
| 13 | + use_screenshot_prefix="true" |
| 14 | + elif pgrep "drastic" >/dev/null 2>&1; then |
| 15 | + use_screenshot_prefix="true" |
| 16 | + elif pgrep "PPSSPPSDL" >/dev/null 2>&1; then |
| 17 | + use_screenshot_prefix="true" |
24 | 18 | fi |
25 | 19 |
|
26 | | - if [ "$is_running_minarch" = "false" ] && [ "$is_running_mupen64plus" = "false" ] && [ "$is_running_drastic" = "false" ] && [ "$is_running_ppsspp" = "false" ]; then |
27 | | - screenshot_prefix="Screenshot" |
| 20 | + screenshot_prefix="Screenshot" |
| 21 | + if [ "$use_screenshot_prefix" != "true" ]; then |
| 22 | + screenshot_prefix="$game_name" |
28 | 23 | fi |
29 | 24 |
|
30 | 25 | echo "$screenshot_prefix" |
|
0 commit comments