Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding executables/launchers names to umu-database.csv #48

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

MrDraxs
Copy link

@MrDraxs MrDraxs commented Oct 29, 2024

No description provided.

@imLinguin
Copy link
Member

Could you provide context on that? and why would we need that field?

@MrDraxs
Copy link
Author

MrDraxs commented Nov 2, 2024

Could you provide context on that? and why would we need that field?

ideal for making simpler when configuring scripts to launch games.

as a example i have create a bash script to automatic setup umu with patches to launch games, for now i have to do a bigger process using tools like sed instead of just comparing the executable name.

https://github.com/MrDraxs/umu-launcher-bash-script

#!/bin/bash

enable -f /usr/lib/bash/csv csv

[[ ! -d "${PWD}/.wp" ]] && mkdir "${PWD}/.wp"

gi=0

if [ -n "${1}" ]
then
if [ "${1}" = "-ge" ]
then
gn=${2%%.*}
export PROTONPATH=GE-Proton
gex=$2
else
gn=${1%%.*}
gex=$1
fi
if [ ! -f "$PWD"/UMU-GAME-ID.txt ]
then
while read -r line; do
    csv -a row "$line"
    # Break out when you find a match
    gl=$( echo ${row[0]} | sed "s/ //g")
    [[ $gl = $gn ]] && gi=${row[3]} && printf "\n\n$gl(=)$gn\n" && break
    printf "\n$gl(X)$gn"
done < <(wget -q -O - "https://github.com/Open-Wine-Components/umu-database/raw/refs/heads/main/umu-database.csv")
cat > "UMU-GAME-ID.txt" << EOF
$gi
EOF
fi
export WINEPREFIX="${PWD}"/.wp
export GAMEID=$(cat "$PWD"/UMU-GAME-ID.txt)

printf "\n
WINEPREFIX=$WINEPREFIX
GAMEID=$GAMEID
"
[[ "${1}" == "-ge" ]] && printf 'PROTONPATH=GE-PROTON\n\n'

umu-run "$PWD"/"$gex"

if [[ $(echo "$PWD" | grep -o '[^/]*$') =~ \ |\' ]]
then
mv "$PWD" $(echo "$PWD" | sed 's![^/]*$!!')$(echo "$PWD" | grep -o '[^/]*$' | sed 's/ /-/g')
fi

else
printf ' ------------------------
 |give a game executable|
 ------------------------
'
fi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants