Compare commits
10 Commits
a7218ed014
...
10f20ff509
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
10f20ff509 | ||
|
|
c8733904d7 | ||
|
|
22f2aea4e6 | ||
|
|
e8a1189c7c | ||
|
|
a84226b8c8 | ||
|
|
a68289264b | ||
|
|
9381444367 | ||
|
|
36cf6b5553 | ||
|
|
035534e402 | ||
|
|
b1cb6b6579 |
34
README.md
34
README.md
@@ -1,22 +1,26 @@
|
|||||||
# TLauncher
|
<div align="center">
|
||||||
This is a repo that i made to install TLauncher on Arch Linux directly from their [site](https://tlauncher.org/).
|
|
||||||
|
|
||||||
### Warning !
|
# tlauncher-gentoo
|
||||||
This script is only a tool to facilitate the download of TLauncher. The use of TLauncher is entirely at your own risk. I am not responsible for any issues that may arise from the use of TLauncher. If you are curious about why this warning even exists, see [this](https://github.com/MatheusTT/tlauncher-arch/issues/1) issue.
|
[](https://github.com/synt-xerror/tlauncher-gentoo/stargazers)
|
||||||
|
[](https://github.com/synt-xerror/tlauncher-gentoo/issues)
|
||||||
|
[](https://github.com/synt-xerror/tlauncher-gentoo)
|
||||||
|
[](https://github.com/synt-xerror/tlauncher-gentoo/blob/master/LICENSE)
|
||||||
|
|
||||||
## How to install
|
</div>
|
||||||
|
|
||||||
|
This is a repo that i made to install TLauncher on Gentoo Linux directly from their [site](https://tlauncher.org/).
|
||||||
|
|
||||||
|
> [!Warning]
|
||||||
|
> This script is only a tool to facilitate the download of TLauncher.
|
||||||
|
> The use of TLauncher is entirely at your own risk. I am not responsible
|
||||||
|
> for any issues that may arise from the use of TLauncher. If you are curious
|
||||||
|
> about why this warning even exists, see [this](https://github.com/MatheusTT/tlauncher-arch/issues/1) issue.
|
||||||
|
|
||||||
|
## Installing
|
||||||
|
Run the following command to install TLauncher:
|
||||||
|
|
||||||
1. Clone and enter the repo
|
|
||||||
```bash
|
```bash
|
||||||
git clone https://github.com/MatheusTT/tlauncher-arch.git && cd tlauncher-arch
|
bash <(curl -fsSl https://raw.githubusercontent.com/synt-xerror/tlauncher-gentoo/master/install.sh)
|
||||||
```
|
|
||||||
2. Change the permissions of the script
|
|
||||||
```bash
|
|
||||||
chmod +x ./install.sh
|
|
||||||
```
|
|
||||||
3. Install tlauncher
|
|
||||||
```bash
|
|
||||||
./install.sh
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|||||||
81
install.sh
81
install.sh
@@ -1,33 +1,60 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
set -euo pipefail
|
||||||
|
IFS=$'\n\t'
|
||||||
|
|
||||||
[[ "$(whoami)" = "root" ]] && echo "Script must be run as a normal user." && exit
|
[[ "$(id -u)" -eq 0 ]] && echo "Script must be run as a normal user." && exit
|
||||||
|
|
||||||
# Colors
|
info_msg() {
|
||||||
GREEN="\033[1;32m"
|
echo -e "\n\033[1;32m${1}\033[0m"
|
||||||
END="\033[0m"
|
}
|
||||||
|
|
||||||
## wget is for downloading TLuncher directly from their website.
|
echo "These dependencies need to be installed:"
|
||||||
## All the other packages are java packages recommended by TLauncher
|
echo "- net-misc/wget"
|
||||||
## (They use java 8, but instead i'm installing the most recent java version).
|
echo "- dev-vcs/git"
|
||||||
# Downloading packages
|
echo "- app-arch/unzip"
|
||||||
pkgs=(
|
echo "- dev-java/openjdk-jre-bin"
|
||||||
wget
|
echo ""
|
||||||
jdk-openjdk
|
read -p "Before continue, would you like to compile dependencies? (y/N): " compile
|
||||||
jre-openjdk
|
|
||||||
jre-openjdk-headless
|
|
||||||
java-openjfx
|
|
||||||
)
|
|
||||||
sudo pacman -Sy --noconfirm --needed "${pkgs[@]}"
|
|
||||||
|
|
||||||
# Downloading TLauncher
|
if [[ "$compile" =~ ^[Yy]$ ]]; then
|
||||||
echo -e "\n${GREEN}Downloading TLauncher...${END}"
|
info_msg "Compiling and installing ..."
|
||||||
|
sleep 2
|
||||||
|
sudo emerge --noreplace net-misc/wget dev-vcs/git app-arch/unzip dev-java/openjdk-jre-bin
|
||||||
|
else
|
||||||
|
info_msg "Installing using binary packages when available ..."
|
||||||
|
sleep 2
|
||||||
|
sudo emerge --noreplace -g net-misc/wget dev-vcs/git app-arch/unzip dev-java/openjdk-jre-bin
|
||||||
|
fi
|
||||||
|
|
||||||
|
cleanup() {
|
||||||
|
info_msg "Cleaning up previous tlauncher-gentoo installation ..."
|
||||||
|
[[ -d "$HOME/tlauncher-gentoo" ]] && rm -rf "$HOME/tlauncher-gentoo"
|
||||||
|
[[ -d "/usr/share/tlauncher" ]] && sudo rm -rf /usr/share/tlauncher
|
||||||
|
[[ -f "/usr/bin/tlauncher" ]] && sudo rm -f /usr/bin/tlauncher
|
||||||
|
[[ -f "/usr/share/icons/tlauncher.png" ]] && sudo rm -f /usr/share/icons/tlauncher.png
|
||||||
|
[[ -f "/usr/share/applications/tlauncher.desktop" ]] && sudo rm -f /usr/share/applications/tlauncher.desktop
|
||||||
|
}
|
||||||
|
|
||||||
|
# If previous clone exists, ask user whether to cleanup
|
||||||
|
if [[ -d "$HOME/tlauncher-gentoo" ]]; then
|
||||||
|
read -p "If your previous attempt had failed in middle, you can retry with cleanup. Do you want to cleanup? (y/N): " do_cleanup
|
||||||
|
if [[ "$do_cleanup" =~ ^[Yy]$ ]]; then
|
||||||
|
cleanup
|
||||||
|
else
|
||||||
|
info_msg "Skipping cleanup."
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
info_msg "Cloning Repo ..."
|
||||||
|
git clone https://github.com/synt-xerror/tlauncher-gentoo.git "$HOME/tlauncher-gentoo"
|
||||||
|
cd "$HOME/tlauncher-gentoo" || exit
|
||||||
|
|
||||||
|
info_msg "Downloading TLauncher ..."
|
||||||
wget https://tlauncher.org/jar -P src/
|
wget https://tlauncher.org/jar -P src/
|
||||||
unzip src/jar -d src/tlauncher.d
|
unzip src/jar -d src/tlauncher.d
|
||||||
mv src/tlauncher.d/*.jar src/tlauncher.d/tlauncher.jar
|
mv src/tlauncher.d/*.jar src/tlauncher.d/tlauncher.jar
|
||||||
|
|
||||||
# Moving TLauncher files
|
info_msg "Installing TLauncher ..."
|
||||||
echo -e "\n${GREEN}Installing TLauncher...${END}"
|
|
||||||
sudo mkdir /usr/share/tlauncher
|
sudo mkdir /usr/share/tlauncher
|
||||||
sudo mv src/tlauncher.d/* /usr/share/tlauncher
|
sudo mv src/tlauncher.d/* /usr/share/tlauncher
|
||||||
|
|
||||||
@@ -35,4 +62,16 @@ sudo mv src/tlauncher /usr/bin/
|
|||||||
sudo mv src/tlauncher.png /usr/share/icons
|
sudo mv src/tlauncher.png /usr/share/icons
|
||||||
sudo mv src/tlauncher.desktop /usr/share/applications
|
sudo mv src/tlauncher.desktop /usr/share/applications
|
||||||
|
|
||||||
echo -e "\n${GREEN}Installation Complete!${END}"
|
# Check if NVIDIA GPU is present
|
||||||
|
if lspci | grep -i 'nvidia' >/dev/null 2>&1; then
|
||||||
|
read -p "Use NVIDIA GPU by default? (Y/n): " use_nvidia
|
||||||
|
use_nvidia=${use_nvidia:-Y}
|
||||||
|
|
||||||
|
if [[ "$use_nvidia" =~ ^[Yy]$ ]]; then
|
||||||
|
sudo sed -i 's|exec java -jar /usr/share/tlauncher/tlauncher.jar|exec env __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia java -jar /usr/share/tlauncher/tlauncher.jar|' /usr/bin/tlauncher
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd "$OLDPWD" || exit
|
||||||
|
rm -rf "$HOME/tlauncher-gentoo"
|
||||||
|
info_msg "Installation Complete!"
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
set -euo pipefail
|
||||||
|
IFS=$'\n\t'
|
||||||
|
|
||||||
[[ "$(whoami)" = "root" ]] && echo "Script must be run as a normal user." && exit
|
[[ "$(id -u)" -eq 0 ]] && echo "Script must be run as a normal user." && exit
|
||||||
|
|
||||||
# Colors
|
# Colors
|
||||||
RED="\033[1;31m"
|
RED="\033[1;31m"
|
||||||
@@ -35,18 +37,20 @@ remove() {
|
|||||||
/usr/bin/tlauncher
|
/usr/bin/tlauncher
|
||||||
)
|
)
|
||||||
echo -e "\n${GREEN}Removing TLauncher system files ...${END}"
|
echo -e "\n${GREEN}Removing TLauncher system files ...${END}"
|
||||||
rm -rf "${SYSTEM_FILES[@]}"
|
sudo rm -rf "${SYSTEM_FILES[@]}"
|
||||||
echo -en "\nDo you want to keep all those java packages installed (${GREEN}Yy${END}/${RED}Nn${END})?" && read -r KEEP_JAVA
|
echo -en "\nDo you want to keep the package \"jre-openjdk\" installed (${GREEN}Yy${END}/${RED}Nn${END})? " && read -r KEEP_JAVA
|
||||||
echo -en "\nDo you want to keep your \$HOME/.tlauncher dir (${GREEN}Yy${END}/${RED}Nn${END})?" && read -r KEEP_DOTDIR
|
echo -en "\nDo you want to keep your \"\$HOME/.tlauncher\" dir (${GREEN}Yy${END}/${RED}Nn${END})? " && read -r KEEP_DOTDIR
|
||||||
[[ "${KEEP_JAVA,,}" = "n" ]] && sudo pacman -Rns jdk-openjdk jre-openjdk{,-headless} java-openjfx
|
[[ "${KEEP_JAVA,,}" = "n" ]] && sudo pacman -Rns jre-openjdk
|
||||||
[[ "${KEEP_DOTDIR,,}" = "n" ]] && rm -rf "$HOME/.tlauncher"
|
[[ "${KEEP_DOTDIR,,}" = "n" ]] && rm -rf "$HOME/.tlauncher"
|
||||||
|
# This dir is created by tlauncher to save minecraft version
|
||||||
|
if [[ -d "$HOME/.minecraft" ]]; then
|
||||||
|
read -rp $'\nDo you want to keep your "$HOME/.minecraft" dir ('"${GREEN}Yy${END}/${RED}Nn${END}"')?: ' CLEAN_MINECRAFT
|
||||||
|
[[ "${CLEAN_MINECRAFT,,}" == "n" ]] && rm -rf "$HOME/.minecraft"
|
||||||
|
fi
|
||||||
|
echo -e "\n${GREEN}TLauncher Removed!${END}"
|
||||||
}
|
}
|
||||||
|
|
||||||
launch() {
|
case "${1:-}" in
|
||||||
java -jar /usr/share/tlauncher/tlauncher.jar
|
|
||||||
}
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
-u | --update | update)
|
-u | --update | update)
|
||||||
update && exit
|
update && exit
|
||||||
;;
|
;;
|
||||||
@@ -57,6 +61,6 @@ case "$1" in
|
|||||||
usage && exit
|
usage && exit
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
launch
|
exec java -jar /usr/share/tlauncher/tlauncher.jar
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
[Desktop Entry]
|
[Desktop Entry]
|
||||||
Type=Application
|
Type=Application
|
||||||
Name=TLauncher
|
Name=TLauncher
|
||||||
Keywords=game;strategy;
|
Keywords=game;strategy;Minecraft;
|
||||||
Comment=Minecraft is a sandbox video game developed by Mojang
|
Comment=Minecraft is a sandbox video game developed by Mojang
|
||||||
Icon=tlauncher
|
Icon=tlauncher
|
||||||
Exec=tlauncher
|
Exec=tlauncher
|
||||||
|
|||||||
Reference in New Issue
Block a user