Compare commits

...

10 Commits

Author SHA1 Message Date
SyntaxError!
10f20ff509 Change readme 2026-01-31 23:28:57 -03:00
SyntaxError!
c8733904d7 Change pacman packages to Gentoo packages. Also name, changed from arch to gentoo 2026-01-31 23:24:01 -03:00
Matheus Teixeira Tomaz
22f2aea4e6 Merge pull request #8 from rupakbajgain/master
Some fixes for previous PR, and some other changes
2026-01-25 10:49:20 -03:00
rupak
e8a1189c7c Add option to keep or remove .minecraft directory
.minecraft is created by tlauncher later.
2026-01-17 17:43:41 +05:45
rupak
a84226b8c8 Add sudo to sed command for NVIDIA GPU setup
/usr/bin/tlauncher had been previously created with sudo permission so sudo is needed here
2026-01-17 17:15:04 +05:45
rupak
a68289264b change sh to bash to accept user input
Previous curl to sh don't let user input
2026-01-17 17:12:35 +05:45
Matheus Teixeira Tomaz
9381444367 Merge pull request #5 from rupakbajgain/master 2025-11-25 20:50:31 -03:00
rupak
36cf6b5553 Implement cleanup for previous tlauncher-arch installs
Added cleanup function to remove previous tlauncher-arch installations and prompt user for cleanup.
2025-11-15 10:17:46 +05:45
rupak
035534e402 Implement NVIDIA GPU selection in install script
Added NVIDIA GPU usage option during installation.
2025-11-15 09:28:07 +05:45
mttomaz
b1cb6b6579 Improve install script 2025-06-05 13:35:00 -03:00
4 changed files with 99 additions and 52 deletions

View File

@@ -1,23 +1,27 @@
# TLauncher
This is a repo that i made to install TLauncher on Arch Linux directly from their [site](https://tlauncher.org/).
<div align="center">
### 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.
# tlauncher-gentoo
[![stars](https://img.shields.io/github/stars/synt-xerror/tlauncher-gentoo?color=7E9CD8&style=for-the-badge)](https://github.com/synt-xerror/tlauncher-gentoo/stargazers)
[![issues](https://img.shields.io/github/issues/synt-xerror/tlauncher-gentoo?color=FF5D62&style=for-the-badge)](https://github.com/synt-xerror/tlauncher-gentoo/issues)
[![size](https://img.shields.io/github/repo-size/synt-xerror/tlauncher-gentoo?color=76946A&style=for-the-badge)](https://github.com/synt-xerror/tlauncher-gentoo)
[![license](https://img.shields.io/github/license/synt-xerror/tlauncher-gentoo?color=957FB8&style=for-the-badge)](https://github.com/synt-xerror/tlauncher-gentoo/blob/master/LICENSE)
## How to install
</div>
1. Clone and enter the repo
```bash
git clone https://github.com/MatheusTT/tlauncher-arch.git && cd tlauncher-arch
```
2. Change the permissions of the script
```bash
chmod +x ./install.sh
```
3. Install tlauncher
```bash
./install.sh
```
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:
```bash
bash <(curl -fsSl https://raw.githubusercontent.com/synt-xerror/tlauncher-gentoo/master/install.sh)
```
## Usage
After the installation, you can just type `tlauncher` in the terminal to launch tlauncher.

View File

@@ -1,33 +1,60 @@
#!/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
GREEN="\033[1;32m"
END="\033[0m"
info_msg() {
echo -e "\n\033[1;32m${1}\033[0m"
}
## wget is for downloading TLuncher directly from their website.
## All the other packages are java packages recommended by TLauncher
## (They use java 8, but instead i'm installing the most recent java version).
# Downloading packages
pkgs=(
wget
jdk-openjdk
jre-openjdk
jre-openjdk-headless
java-openjfx
)
sudo pacman -Sy --noconfirm --needed "${pkgs[@]}"
echo "These dependencies need to be installed:"
echo "- net-misc/wget"
echo "- dev-vcs/git"
echo "- app-arch/unzip"
echo "- dev-java/openjdk-jre-bin"
echo ""
read -p "Before continue, would you like to compile dependencies? (y/N): " compile
# Downloading TLauncher
echo -e "\n${GREEN}Downloading TLauncher...${END}"
if [[ "$compile" =~ ^[Yy]$ ]]; then
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/
unzip src/jar -d src/tlauncher.d
mv src/tlauncher.d/*.jar src/tlauncher.d/tlauncher.jar
# Moving TLauncher files
echo -e "\n${GREEN}Installing TLauncher...${END}"
info_msg "Installing TLauncher ..."
sudo mkdir /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.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!"

View File

@@ -1,6 +1,8 @@
#!/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
RED="\033[1;31m"
@@ -12,7 +14,7 @@ usage() {
Usage:
-h, --help, help | Print this message
-u, --update, update | Update tlauncher.jar
-r, --remove, remove | Remove tlauncher from your system, except your \$HOME/.minecraft dir
-r, --remove, remove | Remove tlauncher from your system, except your \$HOME/.minecraft dir
nothing | Launch TLauncher
"
}
@@ -34,19 +36,21 @@ remove() {
/usr/share/applications/tlauncher.desktop
/usr/bin/tlauncher
)
echo -e "\n${GREEN}Removing TLauncher system files...${END}"
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 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
echo -e "\n${GREEN}Removing TLauncher system files ...${END}"
sudo rm -rf "${SYSTEM_FILES[@]}"
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
[[ "${KEEP_JAVA,,}" = "n" ]] && sudo pacman -Rns jre-openjdk
[[ "${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() {
java -jar /usr/share/tlauncher/tlauncher.jar
}
case "$1" in
case "${1:-}" in
-u | --update | update)
update && exit
;;
@@ -57,6 +61,6 @@ case "$1" in
usage && exit
;;
*)
launch
exec java -jar /usr/share/tlauncher/tlauncher.jar
;;
esac

View File

@@ -1,7 +1,7 @@
[Desktop Entry]
Type=Application
Name=TLauncher
Keywords=game;strategy;
Keywords=game;strategy;Minecraft;
Comment=Minecraft is a sandbox video game developed by Mojang
Icon=tlauncher
Exec=tlauncher