blob: a5cbda1bd67b9f3b338f185497690358f73a4e87 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
#!/bin/bash -eu
set -x
GAMESAVES_PATH="$(gamechest showconfig | jq -r .gamesaves_path)"
main()
{
# Game
game="$(\
gamechest list \
| grep -i true \
| cut -d ":" -f 1 \
| cut -d " " -f 1 \
| fzf-frecency gamechest-game \
)"
if [ -z "$game" ]; then
# no game selected
exit 0
fi
# Profile
profile="$(\
yq -r '.profiles[].name' < "$GAMESAVES_PATH/profiles.yaml" \
| fzf-frecency gamechest-profile \
)"
if [ -z "$profile" ]; then
# no profile selected
exit 0
fi
echo "Running $game with $profile profile"
exec gamechest run --profile_id=$profile $game
}
main
|