Initial commit

This commit is contained in:
Marco Cawthorne 2022-05-21 13:55:52 -07:00
commit 493b0aab4d
Signed by: eukara
GPG Key ID: CE2032F0A2882A22
3 changed files with 44 additions and 0 deletions

13
compatibilitytool.vdf Normal file
View File

@ -0,0 +1,13 @@
"compatibilitytools"
{
"compat_tools"
{
"custom-tool" // Internal name of this tool
{
"install_path" "."
"display_name" "SteamPlay Custom"
"from_oslist" "windows"
"to_oslist" "linux"
}
}
}

7
toolmanifest.vdf Normal file
View File

@ -0,0 +1,7 @@
"manifest"
{
"commandline" "/wrapper run"
"commandline_waitforexitandrun" "/wrapper wait-before-run"
"commandline_getnativepath" "/wrapper get-native-path"
"commandline_getcompatpath" "/wrapper get-compat-path"
}

24
wrapper Executable file
View File

@ -0,0 +1,24 @@
#!/bin/sh
SPC_CFG="$HOME/.config/steamcustomrc"
COMMANDTYPE=$1
if [ "$COMMANDTYPE" = "wait-before-run" ]; then
# env check
STEAM_APPID="$SteamGameId"
# find something valid, first result only
CHECK_GAME=$(grep "$STEAM_APPID:" "$SPC_CFG" | head -n 1)
# nothing found? throw a message...
if [ -z "$CHECK_GAME" ]; then
notify-send -a "SteamPlay-Custom" \
-i "steam" "SteamPlay-Custom" \
"AppID $STEAM_APPID has no entry in $SPC_CFG"
exit
fi
# run our alternative
RUN_GAME=$(echo "$CHECK_GAME" | cut -d ':' -f 2)
exec $RUN_GAME
fi