25 lines
552 B
Bash
Executable File
25 lines
552 B
Bash
Executable File
#!/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
|