-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall-eggshell.sh
More file actions
512 lines (439 loc) · 17.3 KB
/
Copy pathinstall-eggshell.sh
File metadata and controls
512 lines (439 loc) · 17.3 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
#!/bin/bash
#############################################################################
# EGGSHELL Desktop Environment - Universal Installer
# Modern educational desktop with VR/AR integration and accessibility features
#############################################################################
set -e
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
PURPLE='\033[0;35m'
CYAN='\033[0;36m'
WHITE='\033[1;37m'
NC='\033[0m' # No Color
# ASCII Art Banner
show_banner() {
echo -e "${CYAN}"
cat << 'EOF'
╔═══════════════════════════════════════════════════════════════╗
║ ║
║ ███████╗ ██████╗ ██████╗ ███████╗██╗ ██╗███████╗██╗ ██╗ ║
║ ██╔════╝██╔════╝ ██╔════╝ ██╔════╝██║ ██║██╔════╝██║ ██║ ║
║ █████╗ ██║ ███╗██║ ███╗███████╗███████║█████╗ ██║ ██║ ║
║ ██╔══╝ ██║ ██║██║ ██║╚════██║██╔══██║██╔══╝ ██║ ██║ ║
║ ███████╗╚██████╔╝╚██████╔╝███████║██║ ██║███████╗███████╗███████╗ ║
║ ╚══════╝ ╚═════╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝╚══════╝╚══════╝╚══════╝ ║
║ ║
║ 🥚 Where Young Minds Hatch New Ideas 🌟 ║
║ ║
╚═══════════════════════════════════════════════════════════════╝
EOF
echo -e "${NC}"
echo -e "${WHITE}EGGSHELL Desktop Environment v2.0.0${NC}"
echo -e "${BLUE}Modern educational desktop with VR/AR integration${NC}"
echo -e "${GREEN}✨ Android-inspired • 🎤 Voice Control • ♿ Accessible • 🥽 VR Ready${NC}"
echo ""
}
# Variables
EGGSHELL_VERSION="2.0.0"
INSTALL_DIR="/opt/eggshell"
BINARY_DIR="/usr/local/bin"
DESKTOP_DIR="/usr/share/applications"
ICON_DIR="/usr/share/icons/hicolor/256x256/apps"
SERVICE_DIR="/lib/systemd/user"
TEMP_DIR="/tmp/eggshell-install"
DOWNLOAD_URL="https://github.com/eggshell-project/eggshell/releases/download/v${EGGSHELL_VERSION}"
# System detection
detect_system() {
echo -e "${BLUE}🔍 Detecting system...${NC}"
if [[ -f /etc/os-release ]]; then
source /etc/os-release
OS_ID="$ID"
OS_VERSION="$VERSION_ID"
OS_NAME="$PRETTY_NAME"
else
echo -e "${RED}❌ Cannot detect operating system${NC}"
exit 1
fi
echo -e "${GREEN}✅ Detected: ${OS_NAME}${NC}"
# Check architecture
ARCH=$(uname -m)
case "$ARCH" in
x86_64|amd64)
ARCH="x86_64"
;;
aarch64|arm64)
ARCH="aarch64"
;;
*)
echo -e "${RED}❌ Unsupported architecture: $ARCH${NC}"
echo -e "${YELLOW}Supported: x86_64, aarch64${NC}"
exit 1
;;
esac
echo -e "${GREEN}✅ Architecture: ${ARCH}${NC}"
}
# Check if running as root
check_privileges() {
if [[ $EUID -eq 0 ]]; then
echo -e "${YELLOW}⚠️ Running as root. This is fine for system installation.${NC}"
SUDO=""
else
echo -e "${BLUE}🔐 Checking sudo privileges...${NC}"
if ! sudo -n true 2>/dev/null; then
echo -e "${YELLOW}🔑 Please enter your password for system installation:${NC}"
sudo -v
fi
SUDO="sudo"
fi
}
# Install dependencies based on distribution
install_dependencies() {
echo -e "${BLUE}📦 Installing system dependencies...${NC}"
case "$OS_ID" in
opensuse*|suse)
echo -e "${BLUE}Installing openSUSE dependencies...${NC}"
$SUDO zypper refresh
$SUDO zypper install -y \
qt6-base \
qt6-declarative \
qt6-multimedia \
qt6-speech \
qt6-websockets \
python3 \
python3-pip \
python3-PyQt6 \
python3-requests \
python3-websockets \
pulseaudio \
espeak-ng \
cmake \
gcc-c++ \
libudev-devel \
git
;;
ubuntu|debian)
echo -e "${BLUE}Installing Ubuntu/Debian dependencies...${NC}"
$SUDO apt update
$SUDO apt install -y \
qt6-base-dev \
qt6-declarative-dev \
qt6-multimedia-dev \
qt6-speech-dev \
qt6-websockets-dev \
python3 \
python3-pip \
python3-pyqt6 \
python3-requests \
python3-websockets \
pulseaudio \
espeak-ng \
cmake \
g++ \
libudev-dev \
git \
desktop-file-utils \
hicolor-icon-theme
;;
fedora|centos|rhel)
echo -e "${BLUE}Installing Fedora/RHEL dependencies...${NC}"
$SUDO dnf install -y \
qt6-qtbase-devel \
qt6-qtdeclarative-devel \
qt6-qtmultimedia-devel \
qt6-qtspeech-devel \
qt6-qtwebsockets-devel \
python3 \
python3-pip \
python3-PyQt6 \
python3-requests \
python3-websockets \
pulseaudio \
espeak-ng \
cmake \
gcc-c++ \
systemd-udev-devel \
git
;;
arch|manjaro)
echo -e "${BLUE}Installing Arch Linux dependencies...${NC}"
$SUDO pacman -Syu --noconfirm \
qt6-base \
qt6-declarative \
qt6-multimedia \
qt6-speech \
qt6-websockets \
python \
python-pip \
python-pyqt6 \
python-requests \
python-websockets \
pulseaudio \
espeak-ng \
cmake \
gcc \
git
;;
*)
echo -e "${YELLOW}⚠️ Unknown distribution. Attempting generic installation...${NC}"
echo -e "${BLUE}Please ensure you have Qt6, Python3, and build tools installed.${NC}"
;;
esac
echo -e "${GREEN}✅ System dependencies installed${NC}"
}
# Install Python dependencies
install_python_deps() {
echo -e "${BLUE}🐍 Installing Python VR dependencies...${NC}"
# Install Helyxium VR dependencies
python3 -m pip install --user --upgrade pip
python3 -m pip install --user \
openvr \
pyusb \
websockets \
PyQt6 \
requests || true
echo -e "${GREEN}✅ Python dependencies installed${NC}"
}
# Download and install EGGSHELL
download_and_install() {
echo -e "${BLUE}⬇️ Downloading EGGSHELL v${EGGSHELL_VERSION}...${NC}"
# Create temporary directory
mkdir -p "$TEMP_DIR"
cd "$TEMP_DIR"
# Determine package type based on distribution
case "$OS_ID" in
opensuse*|suse)
PACKAGE_FILE="eggshell-${EGGSHELL_VERSION}-1.${ARCH}.rpm"
;;
ubuntu|debian)
PACKAGE_FILE="eggshell_${EGGSHELL_VERSION}-1_${ARCH}.deb"
;;
*)
PACKAGE_FILE="eggshell-${EGGSHELL_VERSION}-Linux-${ARCH}.tar.gz"
;;
esac
# Try to download pre-built package
if curl -fsSL "${DOWNLOAD_URL}/${PACKAGE_FILE}" -o "$PACKAGE_FILE" 2>/dev/null; then
echo -e "${GREEN}✅ Downloaded pre-built package${NC}"
install_package "$PACKAGE_FILE"
else
echo -e "${YELLOW}⚠️ Pre-built package not available. Building from source...${NC}"
build_from_source
fi
}
# Install package based on type
install_package() {
local package_file="$1"
echo -e "${BLUE}📦 Installing package: $package_file${NC}"
case "$package_file" in
*.rpm)
if command -v zypper >/dev/null; then
$SUDO zypper install -y --allow-unsigned-rpm "$package_file"
elif command -v dnf >/dev/null; then
$SUDO dnf install -y "$package_file"
else
$SUDO rpm -i "$package_file"
fi
;;
*.deb)
$SUDO dpkg -i "$package_file" || true
$SUDO apt-get install -f -y # Fix broken dependencies
;;
*.tar.gz)
extract_and_install_tarball "$package_file"
;;
esac
echo -e "${GREEN}✅ Package installed${NC}"
}
# Extract and install from tarball
extract_and_install_tarball() {
local tarball="$1"
echo -e "${BLUE}📂 Extracting and installing from tarball...${NC}"
tar -xzf "$tarball"
cd eggshell-*
# Install files
$SUDO mkdir -p "$INSTALL_DIR" "$BINARY_DIR" "$DESKTOP_DIR" "$ICON_DIR" "$SERVICE_DIR"
$SUDO cp -r * "$INSTALL_DIR/"
$SUDO ln -sf "$INSTALL_DIR/bin/eggshell" "$BINARY_DIR/eggshell"
$SUDO cp "$INSTALL_DIR/share/applications/eggshell.desktop" "$DESKTOP_DIR/"
$SUDO cp "$INSTALL_DIR/share/icons/eggshell.png" "$ICON_DIR/"
$SUDO cp "$INSTALL_DIR/share/systemd/user/eggshell.service" "$SERVICE_DIR/"
}
# Build from source as fallback
build_from_source() {
echo -e "${BLUE}🔨 Building EGGSHELL from source...${NC}"
# Clone repository
git clone --depth=1 --branch=v${EGGSHELL_VERSION} https://github.com/eggshell-project/eggshell.git
cd eggshell
# Build
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local
make -j$(nproc)
# Install
$SUDO make install
echo -e "${GREEN}✅ Built and installed from source${NC}"
}
# Install Helyxium VR platform
install_helyxium() {
echo -e "${BLUE}🥽 Installing Helyxium VR platform...${NC}"
# Clone Helyxium
if [[ ! -d "../helyxium" ]]; then
cd "$TEMP_DIR"
git clone --depth=1 https://github.com/helyxium-project/helyxium.git
else
cp -r "../helyxium" "$TEMP_DIR/"
fi
cd "$TEMP_DIR/helyxium"
# Install Helyxium system-wide
$SUDO mkdir -p /opt/helyxium
$SUDO cp -r * /opt/helyxium/
$SUDO chmod +x /opt/helyxium/main.py
$SUDO ln -sf /opt/helyxium/main.py /usr/local/bin/helyxium
# Install Python dependencies
python3 -m pip install --user -r requirements.txt || true
echo -e "${GREEN}✅ Helyxium VR platform installed${NC}"
}
# Setup desktop integration
setup_desktop_integration() {
echo -e "${BLUE}🖥️ Setting up desktop integration...${NC}"
# Update desktop database
if command -v update-desktop-database >/dev/null; then
$SUDO update-desktop-database /usr/share/applications
fi
# Update icon cache
if command -v gtk-update-icon-cache >/dev/null; then
$SUDO gtk-update-icon-cache -q /usr/share/icons/hicolor
fi
# Enable systemd user service
if [[ -f "$SERVICE_DIR/eggshell.service" ]]; then
systemctl --user enable eggshell.service 2>/dev/null || true
fi
echo -e "${GREEN}✅ Desktop integration setup complete${NC}"
}
# Post-installation configuration
post_install_config() {
echo -e "${BLUE}⚙️ Performing post-installation configuration...${NC}"
# Create user config directory
mkdir -p "$HOME/.config/eggshell"
mkdir -p "$HOME/.local/share/eggshell"
# Set permissions for VR device access
if [[ -d /etc/udev/rules.d ]]; then
$SUDO tee /etc/udev/rules.d/99-eggshell-vr.rules > /dev/null << 'EOF'
# Meta Quest devices
SUBSYSTEM=="usb", ATTR{idVendor}=="2833", ATTR{idProduct}=="0186", MODE="0664", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="2833", ATTR{idProduct}=="0183", MODE="0664", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="2833", ATTR{idProduct}=="0204", MODE="0664", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="2833", ATTR{idProduct}=="0182", MODE="0664", GROUP="plugdev"
# HTC Vive devices
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", ATTR{idProduct}=="2c87", MODE="0664", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", ATTR{idProduct}=="0306", MODE="0664", GROUP="plugdev"
# Valve Index
SUBSYSTEM=="usb", ATTR{idVendor}=="28de", ATTR{idProduct}=="2000", MODE="0664", GROUP="plugdev"
# PlayStation VR
SUBSYSTEM=="usb", ATTR{idVendor}=="054c", ATTR{idProduct}=="09af", MODE="0664", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="054c", ATTR{idProduct}=="0cde", MODE="0664", GROUP="plugdev"
EOF
$SUDO udevadm control --reload-rules
$SUDO udevadm trigger
fi
# Add user to plugdev group for VR device access
$SUDO usermod -a -G plugdev "$USER" 2>/dev/null || true
echo -e "${GREEN}✅ Post-installation configuration complete${NC}"
}
# Create uninstaller
create_uninstaller() {
echo -e "${BLUE}🗑️ Creating uninstaller...${NC}"
$SUDO tee /usr/local/bin/uninstall-eggshell > /dev/null << 'EOF'
#!/bin/bash
echo "Uninstalling EGGSHELL Desktop Environment..."
# Stop services
systemctl --user stop eggshell.service 2>/dev/null || true
systemctl --user disable eggshell.service 2>/dev/null || true
# Remove files
sudo rm -rf /opt/eggshell
sudo rm -rf /opt/helyxium
sudo rm -f /usr/local/bin/eggshell
sudo rm -f /usr/local/bin/helyxium
sudo rm -f /usr/local/bin/uninstall-eggshell
sudo rm -f /usr/share/applications/eggshell.desktop
sudo rm -f /usr/share/icons/hicolor/256x256/apps/eggshell.png
sudo rm -f /lib/systemd/user/eggshell.service
sudo rm -f /etc/udev/rules.d/99-eggshell-vr.rules
# Update caches
sudo update-desktop-database /usr/share/applications 2>/dev/null || true
sudo gtk-update-icon-cache -q /usr/share/icons/hicolor 2>/dev/null || true
sudo udevadm control --reload-rules 2>/dev/null || true
# Remove user data (ask first)
echo -n "Remove user data? (y/N): "
read -r response
if [[ "$response" =~ ^[Yy]$ ]]; then
rm -rf "$HOME/.config/eggshell"
rm -rf "$HOME/.local/share/eggshell"
echo "User data removed."
fi
echo "EGGSHELL has been uninstalled successfully."
EOF
$SUDO chmod +x /usr/local/bin/uninstall-eggshell
echo -e "${GREEN}✅ Uninstaller created at: /usr/local/bin/uninstall-eggshell${NC}"
}
# Cleanup temporary files
cleanup() {
echo -e "${BLUE}🧹 Cleaning up temporary files...${NC}"
rm -rf "$TEMP_DIR"
echo -e "${GREEN}✅ Cleanup complete${NC}"
}
# Main installation function
main() {
show_banner
# Check if already installed
if command -v eggshell >/dev/null 2>&1; then
echo -e "${YELLOW}⚠️ EGGSHELL is already installed.${NC}"
echo -e "${BLUE}Current version: $(eggshell --version 2>/dev/null || echo 'Unknown')${NC}"
echo -n "Continue with upgrade/reinstall? (y/N): "
read -r response
if [[ ! "$response" =~ ^[Yy]$ ]]; then
echo -e "${CYAN}Installation cancelled.${NC}"
exit 0
fi
fi
# Installation steps
echo -e "${WHITE}🚀 Starting EGGSHELL installation...${NC}"
echo ""
detect_system
check_privileges
install_dependencies
install_python_deps
download_and_install
install_helyxium
setup_desktop_integration
post_install_config
create_uninstaller
cleanup
echo ""
echo -e "${GREEN}🎉 EGGSHELL Desktop Environment installed successfully!${NC}"
echo ""
echo -e "${WHITE}📋 What's installed:${NC}"
echo -e "${CYAN} • EGGSHELL Desktop Environment v${EGGSHELL_VERSION}${NC}"
echo -e "${CYAN} • Helyxium VR Platform integration${NC}"
echo -e "${CYAN} • Voice control and accessibility features${NC}"
echo -e "${CYAN} • Dynamic wallpapers and modern UI effects${NC}"
echo -e "${CYAN} • Educational VR sessions and content${NC}"
echo ""
echo -e "${WHITE}🚀 Getting started:${NC}"
echo -e "${GREEN} 1. Logout and select 'EGGSHELL' from your login manager${NC}"
echo -e "${GREEN} 2. Or run directly: ${WHITE}eggshell${NC}"
echo -e "${GREEN} 3. For VR: Connect your VR headset and launch VR sessions${NC}"
echo -e "${GREEN} 4. For help: Visit https://eggshell-desktop.org/docs${NC}"
echo ""
echo -e "${WHITE}🗑️ To uninstall: ${BLUE}sudo uninstall-eggshell${NC}"
echo ""
echo -e "${PURPLE}Thank you for choosing EGGSHELL! 🥚✨${NC}"
echo -e "${BLUE}Where Young Minds Hatch New Ideas${NC}"
}
# Handle interruption
trap cleanup EXIT INT TERM
# Run main function
main "$@"