#!/bin/bash set -x # Colors RED='\033[0;31m' GREEN='\033[0;32m' YELLOW='\033[1;33m' NC='\033[0m' echo -e "${GREEN}>>> Lutris Git Installer for SteamOS${NC}" echo -e "${YELLOW}>>> This script will auto-install missing system dependencies via pacman.${NC}" echo -e "${YELLOW}>>> Lutris itself will be installed from Git via pip --user.${NC}" echo -e "${YELLOW}>>> NO icons, NO desktop files, NO extra crap.${NC}" echo "" # 1. Install system dependencies via pacman (if missing) echo -e "${GREEN}>>> Checking and installing system dependencies...${NC}" DEPS=( git python3 python-pip python-yaml python-requests python-pillow python-gobject gtk3 libnotify webkit2gtk gstreamer cabextract unzip p7zip curl xorg-xrandr python-evdev libgirepository python-setproctitle python-distro pkgconf gcc make ) # Filter out already installed packages TO_INSTALL=() for pkg in "${DEPS[@]}"; do if ! pacman -Q "$pkg" &>/dev/null; then TO_INSTALL+=("$pkg") fi done if [ ${#TO_INSTALL[@]} -gt 0 ]; then echo -e "${YELLOW}>>> Installing missing packages: ${TO_INSTALL[*]}${NC}" pacman -Sy --noconfirm "${TO_INSTALL[@]}" if [ ${?} -ne 0 ]; then echo -e "${RED}>>> Warning: Failed to install some system packages. Trying to continue...${NC}" fi else echo -e "${GREEN}>>> All system dependencies are already installed.${NC}" fi # 2. Switch to non-root user for pip/user install if [ -z "$SUDO_USER" ]; then REAL_USER="root" else REAL_USER="$SUDO_USER" fi HOME_DIR=$(eval echo ~$REAL_USER) echo -e "${GREEN}>>> Cloning Lutris from Git...${NC}" LUTRIS_SRC="$HOME_DIR/lutris-source" rm -rf "$LUTRIS_SRC" su - "$REAL_USER" -c "git clone --depth 1 https://github.com/lutris/lutris.git '$LUTRIS_SRC'" cd "$LUTRIS_SRC" || exit 1 steamos-readonly disable || exit 1 pacman-key --init || exit 1 pacman-key --populate || exit 1 pacman -Sy --noconfirm 'python-pip' || exit 1 pacman -R --noconfirm 'lutirs' || exit 1 pip install setuptools --break-system-packages || exit 1 pip install requests Pillow lxml --break-system-packages || exit 1 cd "$LUTRIS_SRC" && python3 setup.py install || exit 1 echo -e "${GREEN}=========================================${NC}" echo -e "${GREEN}>>> DONE.${NC}" echo -e "${GREEN}=========================================${NC}" echo "" echo -e "${YELLOW}>>> To run Lutris:${NC}" echo -e "1. Exit sudo (if you are root) and run: ${GREEN}lutris${NC}" echo -e "2. Or re-login and launch from terminal/menu." echo "" echo -e "${RED}>>> NOTE:${NC} If 'lutris' command is not found, run:" echo -e " ${GREEN}export PATH=\"\$HOME/.local/bin:\$PATH\"${NC}" echo -e " Then try again: ${GREEN}lutris${NC}" echo "" echo -e "${YELLOW}>>> No icons, no shortcuts, no desktop files created. As requested.${NC}"