File minecraft-launcher of Package minecraft-launcher
#!/usr/bin/env bash
#
# Bootstrap downloader & launch script for minecraft-launcher
#
# Copyright (c) 2021 SUSE LLC
# Copyright (c) 2021 Simon Vogl <simon.vogl@gmx.net>.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
# This launch script automatically uses Feral Gamemode if
# Feral Gamemode is available on the system.
# Set the environment variable MINECRAFT_GAMEMODE_DISABLED=1 in /etc/environment
# to disable Feral Gamemode even if Feral Gamemode is available on the system.
if test -f "$HOME"/.minecraft/launcher/minecraft-launcher; then
if test -f /usr/bin/gamemoderun; then
if [ "$MINECRAFT_GAMEMODE_DISABLED" = "1" ]; then
echo "Starting Minecraft..."
"$HOME"/.minecraft/launcher/minecraft-launcher
else
echo "Starting Minecraft with Feral Gamemode..."
/usr/bin/gamemoderun "$HOME"/.minecraft/launcher/minecraft-launcher
fi
else
echo "Starting Minecraft..."
"$HOME"/.minecraft/launcher/minecraft-launcher
fi
else
echo "Minecraft not installed, downloading..."
mkdir -p "$HOME"/.minecraft/launcher
cd "$HOME"/.minecraft/launcher
wget https://launcher.mojang.com/download/Minecraft.tar.gz
tar -zxvf ./Minecraft.tar.gz
mv ./minecraft-launcher/minecraft-launcher ./minecraft-executable
rm -r ./minecraft-launcher
mv ./minecraft-executable ./minecraft-launcher
rm ./Minecraft.tar.gz
if test -f /usr/bin/gamemoderun; then
if [ "$MINECRAFT_GAMEMODE_DISABLED" = "1" ]; then
echo "Starting Minecraft..."
"$HOME"/.minecraft/launcher/minecraft-launcher
else
echo "Starting Minecraft with Feral Gamemode..."
/usr/bin/gamemoderun "$HOME"/.minecraft/launcher/minecraft-launcher
fi
else
echo "Starting Minecraft..."
"$HOME"/.minecraft/launcher/minecraft-launcher
fi
fi