Add files
This commit is contained in:
parent
63d781ebb7
commit
dc94b4835f
|
@ -1,3 +1,10 @@
|
|||
# IDE folders
|
||||
.idea
|
||||
|
||||
# Others
|
||||
dist
|
||||
cmake-*
|
||||
|
||||
# ---> C++
|
||||
# Prerequisites
|
||||
*.d
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
#!/bin/bash
|
||||
VERSION="$(cat VERSION)"
|
||||
|
||||
mkdir -p ./dist
|
||||
cp ./src/main.sh ./dist/lutris-prelaunch.sh
|
||||
|
||||
TO_REPLACE='$(cat VERSION)'
|
||||
|
||||
sed -i "s/$TO_REPLACE/$VERSION/g" ./dist/lutris-prelaunch.sh
|
|
@ -0,0 +1,64 @@
|
|||
#!/bin/bash
|
||||
|
||||
NAME="Lutris Pre-Launcher"
|
||||
SCRIPT_NAME="lutris-prelauncher.sh"
|
||||
VERSION="$(cat VERSION)"
|
||||
QUIET=0
|
||||
CHECK_GAME_UPDATE=1
|
||||
GPU_SETTINGS=1
|
||||
|
||||
cReset='\033[0m' # Reset
|
||||
cRed='\033[0;31m' # Red
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# Log the given String to stdout if QUIET == 0
|
||||
#------------------------------------------------------------------------------
|
||||
function log() {
|
||||
[ $QUIET -eq 0 ] && echo "$1"
|
||||
}
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# Log the given String to stderror
|
||||
#------------------------------------------------------------------------------
|
||||
function error() {
|
||||
echo -e "${cRed}$1${cReset}" 1>&2
|
||||
}
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# Display help
|
||||
#------------------------------------------------------------------------------
|
||||
function help() {
|
||||
echo "Usage: $SCRIPT_NAME [OPTIONS]"
|
||||
echo ""
|
||||
echo "Available options:"
|
||||
echo -e " -gu | --game-update \tEnable game update check."
|
||||
echo -e " -h | --help \t\tDisplay this help message."
|
||||
echo -e " -nv | --nvidia-settings \tEnable nvidia settings."
|
||||
echo -e " -q | --quiet \t\tDisable program output."
|
||||
}
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# Main - Entry Point
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
log "$NAME v$VERSION"
|
||||
|
||||
if [ $CHECK_GAME_UPDATE -eq 1 ]; then
|
||||
GAME_ID="Test"
|
||||
if [ -z "$GAME_ID" ]; then
|
||||
error "Error: 'GAME_ID' variable is undefined!"
|
||||
exit 1
|
||||
fi
|
||||
# TODO: Implement Game Update Check
|
||||
echo "-> Check game update"
|
||||
fi
|
||||
|
||||
if [ $GPU_SETTINGS -eq 1 ]; then
|
||||
# TODO: Implement Gpu Settings
|
||||
echo "-> Gpu Settings"
|
||||
fi
|
||||
|
||||
if [ "$1" == "-h" ] || [ "$1" == "--help" ]; then
|
||||
help
|
||||
fi
|
Loading…
Reference in New Issue