From 6cdf6f79e6dbf2caa34fead5303d68f35734cfc3 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Sun, 27 Mar 2022 02:17:24 -0400 Subject: [PATCH] Log code was actually interfering with game abilities to launch or in some cases show documentation so it was removed. Added game "StickMUD". --- linux-game-manager.sh | 42 ++++++++++++++++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/linux-game-manager.sh b/linux-game-manager.sh index 1ef6f35..b217a9a 100755 --- a/linux-game-manager.sh +++ b/linux-game-manager.sh @@ -64,6 +64,24 @@ fi exit $? } +# Function to open a terminal emulator +terminal_emulator() { + terminals=( + "lxterminal" + "mate-terminal" + "gnome-terminal" + ) + for i in "${terminals[@]}" ; do + if command $i --working-directory="${game%/*}" -e $* ; then + return + fi + done + echo "No suitable terminal emulators found, please install one of:" + for i in "${terminals[@]}" ; do + echo "$i" + done +} + # Function to open urls open_url() { xdg-open "${*}" 2> /dev/null @@ -245,6 +263,8 @@ game_launcher() { if [[ $menuCode -eq 1 ]]; then exit 0 fi + # Remove any trailing | from game variable. + game="${game%|}" case "${game}" in "Aliens") open_url "https://files.jantrid.net/aliens/" @@ -261,9 +281,17 @@ game_launcher() { "Donate") open_url "https://ko-fi.com/stormux" ;; + *".tin") + pushd "${game%/*}" + if [[ -n "${COLORTERM}" ]]; then + terminal_emulator tt++ ${game##*/} + else + exec tt++ ${game##*/} + fi + ;; *) pushd "${game%/*}" - exec ${game%|} + exec ${game} ;; esac exit 0 @@ -286,10 +314,6 @@ if [[ -r "${configFile%/*}/settings.conf" ]]; then fi unset noCache -# Set up logging -echo -e "\n\n-----> Logging started at $(date '+%A, %B %d, %Y at %I:%M%p')\n" >> "${cache}/linux-game-manager.log" -exec &> >(/usr/bin/tee -a "${cache}/linux-game-manager.log") - # The list of games available for installation. # Use menu friendly names. gameList=( @@ -304,10 +328,11 @@ gameList=( "Monkey Spank" "Numnastics" "Onslaught" + "QuentinC Play Room" "S.E.A." "soundStrider" + "StickMUD" "System Fault" - "QuentinC Play Room" "Trigaea" "Wurmus" ) @@ -434,6 +459,11 @@ case "${game}" in unzip -d "${installPath}/soundStrider" "${cache}/soundStrider-linux-x64.zip" add_launcher "${installPath}/soundStrider/soundStrider" ;; + "StickMUD") + git -C "${installPath}/" clone --recurse-submodules https://github.com/stormdragon2976/tintin-stickmud.git | \ + dialog --progressbox "Installing \"${game}\", please wait..." -1 -1 + add_launcher "${installPath}/tintin-stickmud/stickmud.tin" + ;; "System Fault") get_installer "system-fault-linux-x86_64.AppImage" "https://lightsoutgames.itch.io/systemfault" mkdir -p "${installPath}/System_Fault"