Added game Monkey Spank.
This commit is contained in:
parent
2352ad132d
commit
7c3201a12c
@ -1,4 +1,4 @@
|
|||||||
Linux Game manager
|
## Linux Game manager
|
||||||
|
|
||||||
Installer and launcher for accessible to the blind games that run natively in Linux.
|
Installer and launcher for accessible to the blind games that run natively in Linux.
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ check_update() {
|
|||||||
|
|
||||||
# Function to open urls
|
# Function to open urls
|
||||||
open_url() {
|
open_url() {
|
||||||
xdg-open "${*}" 2> /dev/null
|
xdg-open "${*}" 2> /dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
# Create desktop launcher file
|
# Create desktop launcher file
|
||||||
@ -128,7 +128,7 @@ download() {
|
|||||||
# Remove the destination file if it is empty.
|
# Remove the destination file if it is empty.
|
||||||
test -s "${cache}/${dest}" || rm -f "${cache}/${dest}" 2> /dev/null
|
test -s "${cache}/${dest}" || rm -f "${cache}/${dest}" 2> /dev/null
|
||||||
if [[ "${redownload}" == "true" ]] && [[ -e "${cache}/${dest}" ]]; then
|
if [[ "${redownload}" == "true" ]] && [[ -e "${cache}/${dest}" ]]; then
|
||||||
rm -v "${cache}/${dest}"
|
rm -v "${cache}/${dest}"
|
||||||
fi
|
fi
|
||||||
# Skip if the item is in cache.
|
# Skip if the item is in cache.
|
||||||
test -e "${cache}/${dest}" && continue
|
test -e "${cache}/${dest}" && continue
|
||||||
@ -140,32 +140,32 @@ download() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get_installer() {
|
get_installer() {
|
||||||
trap "exit 0" SIGINT
|
trap "exit 0" SIGINT
|
||||||
# If the file is in cache nothing else needs to be done.
|
# If the file is in cache nothing else needs to be done.
|
||||||
if [[ -f "${cache}/$1" ]]; then
|
if [[ -f "${cache}/$1" ]]; then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
# Create message for dialog.
|
# Create message for dialog.
|
||||||
local message="Make sure $1 is available in either your Downloads or Desktop directory and press enter to continue."
|
local message="Make sure $1 is available in either your Downloads or Desktop directory and press enter to continue."
|
||||||
if [[ -n "$2" ]]; then
|
if [[ -n "$2" ]]; then
|
||||||
message+="\n\nThe last good known URL for $game is:"
|
message+="\n\nThe last good known URL for $game is:"
|
||||||
message+="\n$2"
|
message+="\n$2"
|
||||||
fi
|
fi
|
||||||
if echo "$2" | xclip -selection clipboard 2> /dev/null ; then
|
if echo "$2" | xclip -selection clipboard 2> /dev/null ; then
|
||||||
message+="\n\nThe URL has been copied to the clipboard."
|
message+="\n\nThe URL has been copied to the clipboard."
|
||||||
fi
|
fi
|
||||||
dialog --ok-label "Continue" \
|
dialog --ok-label "Continue" \
|
||||||
--backtitle "Linux Game Manager" \
|
--backtitle "Linux Game Manager" \
|
||||||
--msgbox "$message" -1 -1
|
--msgbox "$message" -1 -1
|
||||||
# Search the Desktop and Downloads directories for the installation file
|
# Search the Desktop and Downloads directories for the installation file
|
||||||
for i in ~/Downloads ~/Desktop ; do
|
for i in ~/Downloads ~/Desktop ; do
|
||||||
find $i -type f -name "$1" -exec mv -v {} "${cache}/" \;
|
find $i -type f -name "$1" -exec mv -v {} "${cache}/" \;
|
||||||
done
|
done
|
||||||
# If the file is still not available abort.
|
# If the file is still not available abort.
|
||||||
if [[ ! -f "${cache}/$1" ]]; then
|
if [[ ! -f "${cache}/$1" ]]; then
|
||||||
echo "couldn't find $1. Please download the file and try again."
|
echo "couldn't find $1. Please download the file and try again."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
help() {
|
help() {
|
||||||
@ -225,32 +225,32 @@ game_launcher() {
|
|||||||
echo "Install some games first."
|
echo "Install some games first."
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
# Create the menu of installed games
|
# Create the menu of installed games
|
||||||
declare -a menuList
|
declare -a menuList
|
||||||
for i in "${lines[@]}" ; do
|
for i in "${lines[@]}" ; do
|
||||||
menuList+=("${i#*|}" "${i%|*}")
|
menuList+=("${i#*|}" "${i%|*}")
|
||||||
done
|
done
|
||||||
# Web based games and donation
|
# Web based games and donation
|
||||||
menuList+=("Aliens" "Aliens")
|
menuList+=("Aliens" "Aliens")
|
||||||
menuList+=("Donate" "Donate")
|
menuList+=("Donate" "Donate")
|
||||||
game="$(dialog --backtitle "Linux Game Launcher" \
|
game="$(dialog --backtitle "Linux Game Launcher" \
|
||||||
--clear \
|
--clear \
|
||||||
--no-tags \
|
--no-tags \
|
||||||
--menu "Please select a game to play" 0 0 0 "${menuList[@]}" --stdout)"
|
--menu "Please select a game to play" 0 0 0 "${menuList[@]}" --stdout)"
|
||||||
local menuCode=$?
|
local menuCode=$?
|
||||||
if [[ $menuCode -eq 1 ]]; then
|
if [[ $menuCode -eq 1 ]]; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
case "${game}" in
|
||||||
|
"Aliens")
|
||||||
|
open_url "https://files.jantrid.net/aliens/"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
|
||||||
case "${game}" in
|
|
||||||
"Aliens")
|
|
||||||
open_url "https://files.jantrid.net/aliens/"
|
|
||||||
exit 0
|
|
||||||
;;
|
;;
|
||||||
"Donate")
|
"Donate")
|
||||||
open_url "https://ko-fi.com/stormux"
|
open_url "https://ko-fi.com/stormux"
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
pushd ${game%/*}
|
pushd ${game%/*}
|
||||||
exec ${game%|}
|
exec ${game%|}
|
||||||
}
|
}
|
||||||
@ -282,6 +282,7 @@ gameList=(
|
|||||||
"Aliens"
|
"Aliens"
|
||||||
"E.X.O."
|
"E.X.O."
|
||||||
"Fantasy Story II"
|
"Fantasy Story II"
|
||||||
|
"Monkey Spank"
|
||||||
"Numnastics"
|
"Numnastics"
|
||||||
"S.E.A."
|
"S.E.A."
|
||||||
"soundStrider"
|
"soundStrider"
|
||||||
@ -323,17 +324,17 @@ args="${!command[*]}"
|
|||||||
args="${args//[[:space:]]/}"
|
args="${args//[[:space:]]/}"
|
||||||
while getopts "${args}" i ; do
|
while getopts "${args}" i ; do
|
||||||
case "$i" in
|
case "$i" in
|
||||||
C) clear_cache;;
|
C) clear_cache ;;
|
||||||
D) desktop_launcher;;
|
D) desktop_launcher ;;
|
||||||
h) help;;
|
h) help ;;
|
||||||
i) game_installer;;
|
i) game_installer ;;
|
||||||
L) license;;
|
L) license ;;
|
||||||
N) noCache="true";;
|
N) noCache="true" ;;
|
||||||
R) redownload="true";;
|
R) redownload="true" ;;
|
||||||
t)
|
t)
|
||||||
dialog --backtitle "Linux Game Manager" \
|
dialog --backtitle "Linux Game Manager" \
|
||||||
--infobox "There are currently ${#gameList[@]} games available." -1 -1
|
--infobox "There are currently ${#gameList[@]} games available." -1 -1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
@ -344,42 +345,46 @@ case "${game}" in
|
|||||||
"Aliens")
|
"Aliens")
|
||||||
dialog --backtitle "Linux Game manager" \
|
dialog --backtitle "Linux Game manager" \
|
||||||
--infobox "${game} is a web based game and does not need to be installed." -1 -1
|
--infobox "${game} is a web based game and does not need to be installed." -1 -1
|
||||||
;;
|
;;
|
||||||
"E.X.O.")
|
"E.X.O.")
|
||||||
get_installer "EXO-linux-x64.zip" "https://shiftbacktick.itch.io/exo"
|
get_installer "EXO-linux-x64.zip" "https://shiftbacktick.itch.io/exo"
|
||||||
mkdir -p "${installPath}/E.X.O."
|
mkdir -p "${installPath}/E.X.O."
|
||||||
unzip -d "${installPath}/E.X.O." "${cache}/EXO-linux-x64.zip"
|
unzip -d "${installPath}/E.X.O." "${cache}/EXO-linux-x64.zip"
|
||||||
add_launcher "${installPath}/E.X.O./EXO"
|
add_launcher "${installPath}/E.X.O./EXO"
|
||||||
;;
|
;;
|
||||||
"Fantasy Story II")
|
"Fantasy Story II")
|
||||||
get_installer "FS2_2.6_Linux.zip" "https://drive.google.com/file/d/187OaD1HhPoty85yJafZyvfqD5_G3P04c/view?usp=sharing"
|
get_installer "FS2_2.6_Linux.zip" "https://drive.google.com/file/d/187OaD1HhPoty85yJafZyvfqD5_G3P04c/view?usp=sharing"
|
||||||
unzip -d "${installPath}" "${cache}/FS2_2.6_Linux.zip"
|
unzip -d "${installPath}" "${cache}/FS2_2.6_Linux.zip"
|
||||||
chmod +x "${installPath}/FS2_2.6_Linux/FS2.x86_64"
|
chmod +x "${installPath}/FS2_2.6_Linux/FS2.x86_64"
|
||||||
add_launcher "${installPath}/FS2_2.6_Linux/FS2.x86_64" "-ESpeakApplication=espeak-ng"
|
add_launcher "${installPath}/FS2_2.6_Linux/FS2.x86_64" "-ESpeakApplication=espeak-ng"
|
||||||
;;
|
;;
|
||||||
|
"Monkey Spank")
|
||||||
|
git -C "${installPath}" clone --recurse-submodules https://gitlab.com/stormdragon2976/monkeyspank.git
|
||||||
|
add_launcher "${installPath}/monkeyspank/monkeyspank"
|
||||||
|
;;
|
||||||
"Numnastics")
|
"Numnastics")
|
||||||
git -C "${installPath}" clone --recurse-submodules https://gitlab.com/stormdragon2976/numnastics.git
|
git -C "${installPath}" clone --recurse-submodules https://gitlab.com/stormdragon2976/numnastics.git
|
||||||
add_launcher "${installPath}/numnastics/numnastics"
|
add_launcher "${installPath}/numnastics/numnastics"
|
||||||
;;
|
;;
|
||||||
"S.E.A.")
|
"S.E.A.")
|
||||||
get_installer "SEA-linux-x64.zip" "https://shiftbacktick.itch.io/sea"
|
get_installer "SEA-linux-x64.zip" "https://shiftbacktick.itch.io/sea"
|
||||||
mkdir -p "${installPath}/S.E.A."
|
mkdir -p "${installPath}/S.E.A."
|
||||||
unzip -d "${installPath}/S.E.A." "${cache}/SEA-linux-x64.zip"
|
unzip -d "${installPath}/S.E.A." "${cache}/SEA-linux-x64.zip"
|
||||||
add_launcher "${installPath}/S.E.A./SEA"
|
add_launcher "${installPath}/S.E.A./SEA"
|
||||||
;;
|
;;
|
||||||
"soundStrider")
|
"soundStrider")
|
||||||
get_installer "soundStrider-linux-x64.zip" "https://shiftbacktick.itch.io/soundstrider"
|
get_installer "soundStrider-linux-x64.zip" "https://shiftbacktick.itch.io/soundstrider"
|
||||||
mkdir -p "${installPath}/soundStrider"
|
mkdir -p "${installPath}/soundStrider"
|
||||||
unzip -d "${installPath}/soundStrider" "${cache}/soundStrider-linux-x64.zip"
|
unzip -d "${installPath}/soundStrider" "${cache}/soundStrider-linux-x64.zip"
|
||||||
add_launcher "${installPath}/soundStrider/soundStrider"
|
add_launcher "${installPath}/soundStrider/soundStrider"
|
||||||
;;
|
;;
|
||||||
"Donate")
|
"Donate")
|
||||||
open_url "https://ko-fi.com/stormux"
|
open_url "https://ko-fi.com/stormux"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
[[ -n "${game}" ]] && echo "Game \"${game}\" not found."
|
[[ -n "${game}" ]] && echo "Game \"${game}\" not found."
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
Loading…
Reference in New Issue
Block a user