-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·133 lines (113 loc) · 4.79 KB
/
install.sh
File metadata and controls
executable file
·133 lines (113 loc) · 4.79 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
#!/bin/bash
# 🐺 LupineOS Master Installer
# Version: 1.0 (WolfPack)
# Purpose: Single-command setup for configs, assets, and containers.
set -e # Exit immediately if a command exits with a non-zero status
# --- Variables ---
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
CONFIGS_DIR="$REPO_ROOT/configs"
SCRIPTS_DIR="$REPO_ROOT/scripts"
BACKUP_DIR="$HOME/dotfiles_backup_$(date +%s)"
# --- Visuals ---
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
echo -e "${BLUE}
██╗ ██╗ ██╗██████╗ ██╗███╗ ██╗███████╗ ██████╗ ███████╗
██║ ██║ ██║██╔══██╗██║████╗ ██║██╔════╝██╔═══██╗██╔════╝
██║ ██║ ██║██████╔╝██║██╔██╗ ██║█████╗ ██║ ██║███████╗
██║ ██║ ██║██╔═══╝ ██║██║╚██╗██║██╔══╝ ██║ ██║╚════██║
███████╗╚██████╔╝██║ ██║██║ ╚████║███████╗╚██████╔╝███████║
╚══════╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚══════╝
${NC}"
echo "Welcome to the LupineOS Installer."
echo "Source: $REPO_ROOT"
echo "---------------------------------------------------"
# --- Function: Link Configs (Stow) ---
link_configs() {
echo -e "\n${YELLOW}[1/4] Linking Configurations...${NC}"
# Check if configs directory exists
if [ ! -d "$CONFIGS_DIR" ]; then
echo "❌ Error: Configs directory not found at $CONFIGS_DIR"
return
fi
# Determine Method: Host vs Container
if command -v stow &> /dev/null; then
METHOD="host"
echo " -> Using Host 'stow'..."
elif command -v distrobox &> /dev/null; then
METHOD="container"
echo " -> Host 'stow' missing. Delegating to 'admin' container..."
# Ensure admin exists
if ! distrobox list | grep -q "admin"; then
echo " ⚠️ 'admin' container not found. Building it now..."
$SCRIPTS_DIR/setup_admin.sh
fi
# Ensure stow is installed in admin
distrobox enter admin -- sudo apt-get install -y stow &> /dev/null
else
echo "❌ Error: Neither 'stow' nor 'distrobox' found."
exit 1
fi
# Execute Stow
cd "$CONFIGS_DIR"
for app in */; do
app_name=$(basename "$app")
echo " -> Stowing: $app_name"
# Clean up existing default files if they block stow (Optional safety)
# rm -rf "$HOME/.config/$app_name"
if [ "$METHOD" == "host" ]; then
stow -R -t "$HOME" "$app_name"
else
# Run inside container (Paths are shared via $HOME)
distrobox enter admin -- sh -c "cd $CONFIGS_DIR && stow -R -t $HOME $app_name"
fi
done
echo -e "${GREEN}✅ Configs Linked.${NC}"
}
# --- Function: Install Fonts ---
install_fonts() {
echo -e "\n${YELLOW}[2/4] Installing Nerd Fonts...${NC}"
if [ -f "$SCRIPTS_DIR/install_fonts.sh" ]; then
$SCRIPTS_DIR/install_fonts.sh
else
echo " ⚠️ Font script missing."
fi
}
# --- Function: Apply Branding ---
apply_branding() {
echo -e "\n${YELLOW}[3/4] Applying Branding (Wallpapers)...${NC}"
if [ -f "$SCRIPTS_DIR/setup_branding.sh" ]; then
$SCRIPTS_DIR/setup_branding.sh
else
echo " ⚠️ Branding script missing."
fi
}
# --- Function: Build Containers ---
setup_containers() {
echo -e "\n${YELLOW}[4/4] Container Ecosystem (The Pack)${NC}"
echo "Do you want to build/update the containers? (y/n)"
read -r -p "Select: " response
if [[ "$response" =~ ^[yY]$ ]]; then
echo " 🐺 unleashing the pack..."
# Admin
[ -f "$SCRIPTS_DIR/setup_admin.sh" ] && $SCRIPTS_DIR/setup_admin.sh
# Security
[ -f "$SCRIPTS_DIR/setup_sec.sh" ] && $SCRIPTS_DIR/setup_sec.sh
# Data/Lab
[ -f "$SCRIPTS_DIR/setup_data.sh" ] && $SCRIPTS_DIR/setup_data.sh
# Rust Tools
[ -f "$SCRIPTS_DIR/install_rust_tools.sh" ] && $SCRIPTS_DIR/install_rust_tools.sh
echo -e "${GREEN}✅ All containers ready.${NC}"
else
echo " -> Skipping container setup."
fi
}
# --- Execution ---
link_configs
install_fonts
apply_branding
setup_containers
echo -e "\n${GREEN}🎉 LupineOS Installation Complete!${NC}"
echo " Please reboot your system to finalize font and UI changes."