-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·86 lines (72 loc) · 2.57 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·86 lines (72 loc) · 2.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/usr/bin/env bash
set -euo pipefail
# Trdo Linux — Installer for Ubuntu 24.04 LTS
# Installs system dependencies and sets up the application
APP_NAME="trdo"
INSTALL_DIR="/opt/trdo"
BIN_LINK="/usr/local/bin/trdo"
DESKTOP_FILE="/usr/share/applications/trdo.desktop"
ICON_DIR="/usr/share/icons/hicolor/scalable/apps"
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m'
info() { echo -e "${GREEN}[INFO]${NC} $*"; }
warn() { echo -e "${YELLOW}[WARN]${NC} $*"; }
error() { echo -e "${RED}[ERROR]${NC} $*"; exit 1; }
# ── Check we're on Ubuntu 24.04+ ──
if [[ ! -f /etc/os-release ]]; then
error "Cannot detect OS. This installer targets Ubuntu 24.04 LTS."
fi
source /etc/os-release
if [[ "$ID" != "ubuntu" ]]; then
warn "Detected $PRETTY_NAME — this installer is built for Ubuntu 24.04 LTS."
warn "Proceeding anyway; some packages may differ."
fi
# ── Root check ──
if [[ $EUID -ne 0 ]]; then
error "Please run with sudo: sudo bash install.sh"
fi
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
info "Installing system dependencies..."
apt-get update -qq
apt-get install -y -qq \
python3 \
python3-gi \
python3-gi-cairo \
python3-requests \
gir1.2-gtk-4.0 \
gir1.2-adw-1 \
gir1.2-gstreamer-1.0 \
gir1.2-gst-plugins-base-1.0 \
gstreamer1.0-plugins-good \
gstreamer1.0-plugins-bad \
gstreamer1.0-plugins-ugly \
gstreamer1.0-libav \
2>/dev/null || {
warn "Some packages may not be available. Trying minimal set..."
apt-get install -y -qq \
python3 python3-gi python3-requests \
gir1.2-gtk-4.0 gir1.2-gstreamer-1.0 \
gir1.2-gst-plugins-base-1.0 \
gstreamer1.0-plugins-good gstreamer1.0-plugins-bad
}
info "Installing application to ${INSTALL_DIR}..."
mkdir -p "${INSTALL_DIR}"
cp -r "${SCRIPT_DIR}"/trdo_*.py "${INSTALL_DIR}/"
cp -r "${SCRIPT_DIR}"/trdo "${INSTALL_DIR}/"
cp -r "${SCRIPT_DIR}"/icons "${INSTALL_DIR}/"
cp -r "${SCRIPT_DIR}"/data "${INSTALL_DIR}/"
chmod +x "${INSTALL_DIR}/trdo"
# ── Symlink into PATH ──
ln -sf "${INSTALL_DIR}/trdo" "${BIN_LINK}"
# ── Install icons ──
mkdir -p "${ICON_DIR}"
cp "${SCRIPT_DIR}/icons/trdo.svg" "${ICON_DIR}/trdo.svg"
# ── Install .desktop file ──
sed "s|@INSTALL_DIR@|${INSTALL_DIR}|g" "${SCRIPT_DIR}/trdo.desktop.in" > "${DESKTOP_FILE}"
update-desktop-database /usr/share/applications/ 2>/dev/null || true
gtk-update-icon-cache /usr/share/icons/hicolor/ 2>/dev/null || true
info "Installation complete!"
info "Launch Trdo from your application menu or run: trdo"
echo ""