forked from bjarneo/aether
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·177 lines (146 loc) · 6.42 KB
/
install.sh
File metadata and controls
executable file
·177 lines (146 loc) · 6.42 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
#!/bin/bash
#
# Aether Installer
# Installs Aether from the AUR
#
# Usage:
# curl -fsSL https://raw.githubusercontent.com/bjarneo/aether/main/install.sh | bash
#
set -euo pipefail
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
CYAN='\033[0;36m'
NC='\033[0m' # No Color
BOLD='\033[1m'
# AUR package details
AUR_PACKAGE="aether"
AUR_GIT_URL="https://aur.archlinux.org/${AUR_PACKAGE}.git"
print_header() {
echo -e "${CYAN}"
echo "╔══════════════════════════════════════════════════════════════╗"
echo "║ ║"
echo "║ ░█████╗░███████╗████████╗██╗░░██╗███████╗██████╗░ ║"
echo "║ ██╔══██╗██╔════╝╚══██╔══╝██║░░██║██╔════╝██╔══██╗ ║"
echo "║ ███████║█████╗░░░░░██║░░░███████║█████╗░░██████╔╝ ║"
echo "║ ██╔══██║██╔══╝░░░░░██║░░░██╔══██║██╔══╝░░██╔══██╗ ║"
echo "║ ██║░░██║███████╗░░░██║░░░██║░░██║███████╗██║░░██║ ║"
echo "║ ╚═╝░░╚═╝╚══════╝░░░╚═╝░░░╚═╝░░╚═╝╚══════╝╚═╝░░╚═╝ ║"
echo "║ ║"
echo "║ Desktop Theming Application ║"
echo "║ ║"
echo "╚══════════════════════════════════════════════════════════════╝"
echo -e "${NC}"
}
log_info() {
echo -e "${BLUE}[INFO]${NC} $1"
}
log_success() {
echo -e "${GREEN}[✓]${NC} $1"
}
log_warning() {
echo -e "${YELLOW}[!]${NC} $1"
}
log_error() {
echo -e "${RED}[✗]${NC} $1"
}
check_arch() {
if ! command -v pacman &> /dev/null; then
log_error "This installer requires Arch Linux (pacman not found)"
exit 1
fi
log_success "Arch Linux detected"
}
check_dependencies() {
log_info "Checking build dependencies..."
local missing_deps=()
if ! command -v git &> /dev/null; then
missing_deps+=("git")
fi
if ! command -v makepkg &> /dev/null; then
missing_deps+=("base-devel")
fi
if [ ${#missing_deps[@]} -gt 0 ]; then
log_warning "Missing dependencies: ${missing_deps[*]}"
log_info "Installing missing dependencies..."
if ! sudo pacman -S --needed --noconfirm "${missing_deps[@]}"; then
log_error "Failed to install dependencies"
exit 1
fi
log_success "Dependencies installed"
else
log_success "All build dependencies present"
fi
}
install_from_aur() {
local temp_dir
temp_dir=$(mktemp -d)
log_info "Created temporary directory: ${temp_dir}"
# Cleanup on exit
trap "rm -rf ${temp_dir}" EXIT
log_info "Cloning AUR package: ${AUR_PACKAGE}..."
if ! git clone --depth=1 "${AUR_GIT_URL}" "${temp_dir}/${AUR_PACKAGE}" 2>&1; then
log_error "Failed to clone AUR package"
exit 1
fi
log_success "AUR package cloned"
cd "${temp_dir}/${AUR_PACKAGE}"
# Show PKGBUILD info
if [ -f "PKGBUILD" ]; then
echo ""
log_info "PKGBUILD contents:"
echo -e "${CYAN}────────────────────────────────────────────────────────────────${NC}"
cat PKGBUILD
echo -e "${CYAN}────────────────────────────────────────────────────────────────${NC}"
echo ""
# Extract version info
local pkgver
pkgver=$(grep -E "^pkgver=" PKGBUILD | cut -d'=' -f2 | tr -d '"' | tr -d "'")
if [ -n "$pkgver" ]; then
log_info "Package version: ${BOLD}${pkgver}${NC}"
fi
fi
echo ""
log_info "Building and installing Aether..."
echo -e "${YELLOW}This will prompt for your sudo password to install${NC}"
echo ""
# Build and install
if ! makepkg -si --noconfirm; then
log_error "Build failed"
exit 1
fi
log_success "Aether installed successfully!"
}
print_post_install() {
echo ""
echo -e "${GREEN}╔══════════════════════════════════════════════════════════════╗${NC}"
echo -e "${GREEN}║ Installation Complete! ║${NC}"
echo -e "${GREEN}╚══════════════════════════════════════════════════════════════╝${NC}"
echo ""
echo -e "${BOLD}Quick Start:${NC}"
echo -e " ${CYAN}aether${NC} # Launch GUI"
echo -e " ${CYAN}aether --generate wallpaper.jpg${NC} # CLI theme generation"
echo -e " ${CYAN}aether --widget-blueprint${NC} # Floating widget mode"
echo -e " ${CYAN}aether --list-blueprints${NC} # List saved themes"
echo -e " ${CYAN}aether --help${NC} # Show all commands"
echo ""
echo -e "${BOLD}Desktop Entry:${NC}"
echo -e " Search for 'Aether' in your application launcher."
echo ""
echo -e "${BOLD}Documentation:${NC}"
echo -e " ${CYAN}https://github.com/bjarneo/aether${NC}"
echo ""
}
main() {
print_header
log_info "Starting Aether installation from AUR..."
echo ""
check_arch
check_dependencies
echo ""
install_from_aur
print_post_install
}
main "$@"