Files
omarchy-sc/install.sh
T
2026-08-31 22:20:17 +02:00

43 lines
1.8 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
set -euo pipefail
ROOT="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
BIN_SRC="$ROOT/backend/bin/citizen-launcher"
BIN_DIR="$HOME/.local/bin"
APP_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/applications"
ICON_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/icons/hicolor/scalable/apps"
[[ -x "$BIN_SRC" ]] || { echo "Backend fehlt. Zuerst ./build.sh ausführen." >&2; exit 1; }
mkdir -p "$BIN_DIR" "$APP_DIR" "$ICON_DIR"
install -m755 "$BIN_SRC" "$BIN_DIR/citizen-launcher"
install -m644 "$ROOT/packaging/icons/citizen-launcher.svg" "$ICON_DIR/citizen-launcher.svg"
cat > "$APP_DIR/io.github.citizenlauncher.CitizenLauncher.desktop" <<EOF2
[Desktop Entry]
Name=Citizen Launcher
Comment=Star Citizen für Linux – Setup, Start, Updates und Reparatur
Exec=$BIN_DIR/citizen-launcher gui
TryExec=$BIN_DIR/citizen-launcher
Icon=citizen-launcher
Terminal=false
Type=Application
Categories=Game;
StartupNotify=true
StartupWMClass=CitizenLauncher
Keywords=Star Citizen;RSI;Wine;Gaming;
EOF2
warnings=()
if ! "$BIN_DIR/citizen-launcher" prepare-system; then
warnings+=("Linux-Systemlimits konnten nicht sofort gesetzt werden. Citizen Launcher bietet die Vorbereitung beim Setup erneut an.")
fi
if ! "$BIN_DIR/citizen-launcher" autopilot enable; then
warnings+=("Autopilot konnte nicht automatisch aktiviert werden; der Launcher funktioniert trotzdem und kann ihn später aktivieren.")
fi
if command -v update-desktop-database >/dev/null 2>&1; then update-desktop-database "$APP_DIR" >/dev/null 2>&1 || true; fi
if command -v gtk-update-icon-cache >/dev/null 2>&1; then gtk-update-icon-cache -f "${XDG_DATA_HOME:-$HOME/.local/share}/icons/hicolor" >/dev/null 2>&1 || true; fi
echo "Citizen Launcher installiert. Starte ihn über das App-Menü oder: citizen-launcher gui"
if ((${#warnings[@]})); then
printf '\nHinweise:\n'
printf ' - %s\n' "${warnings[@]}"
fi