forked from basecamp/omarchy
-
-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathsetup.sh
More file actions
128 lines (105 loc) · 4.42 KB
/
setup.sh
File metadata and controls
128 lines (105 loc) · 4.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
#!/bin/bash
# =============================================================================
# Omarchy Mac Bootstrap Setup Script
# =============================================================================
# This script downloads the omarchy-mac repository to the correct location
# and guides the user to run the actual bootstrap script locally.
#
# Usage (as root after first boot):
# curl -fsSL https://raw.githubusercontent.com/malik-na/omarchy-mac/main/bootstrap.sh | bash
# OR
# wget -qO- https://raw.githubusercontent.com/malik-na/omarchy-mac/main/bootstrap.sh | bash
# =============================================================================
set -e
# 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'
# ASCII Art Banner
print_banner() {
echo -e "${CYAN}"
cat << 'EOF'
▄▄▄
▄█████▄ ▄███████████▄ ▄███████ ▄███████ ▄███████ ▄█ █▄ ▄█ █▄
████ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███
████ ███ ███ ███ ███ ███ ███ ███ ███ ███ █▀ ███ ███ ███ ███
████ ███ ███ ███ ███ ▄███▄▄▄███ ▄███▄▄▄██▀ ███ ▄███▄▄▄███▄ ███▄▄▄███
████ ███ ███ ███ ███ ▀███▀▀▀███ ▀███▀▀▀▀ ███ ▀▀███▀▀▀███ ▀▀▀▀▀▀███
████ ███ ███ ███ ███ ███ ███ ██████████ ███ █▄ ███ ███ ▄██ ███
████ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███
▀█████▀ ▀█ ███ █▀ ███ █▀ ███ ███ ███████▀ ███ █▀ ▀█████▀
███ █▀
MAC BOOTSTRAP INSTALLER
EOF
echo -e "${NC}"
}
print_step() {
echo -e "\n${BLUE}${BOLD}==>${NC}${BOLD} $1${NC}"
}
print_success() {
echo -e "${GREEN}✓${NC} $1"
}
print_warning() {
echo -e "${YELLOW}⚠${NC} $1"
}
print_error() {
echo -e "${RED}✗${NC} $1"
}
print_info() {
echo -e "${CYAN}ℹ${NC} $1"
}
# Check if running as root
check_root() {
if [[ $EUID -ne 0 ]]; then
print_error "This script must be run as root for initial setup."
print_info "Please log in as root and run this script again."
exit 1
fi
}
# Clone repository and setup
clone_repository() {
local repo_url="https://github.com/malik-na/omarchy-mac.git"
local target_dir="/root/.local/share/omarchy"
print_step "Downloading Omarchy Mac repository..."
# Install git if not available
if ! command -v git &>/dev/null; then
print_info "Installing git..."
pacman -Sy --noconfirm git
fi
# Create target directory
mkdir -p "$(dirname "$target_dir")"
# Remove existing directory if it exists
if [[ -d "$target_dir" ]]; then
rm -rf "$target_dir"
fi
# Clone the repository
git clone "$repo_url" "$target_dir"
print_success "Repository cloned to $target_dir"
echo ""
print_step "Next Steps:"
echo ""
print_info "The Omarchy Mac repository has been downloaded."
print_info "Now run the actual bootstrap script:"
echo ""
echo -e " ${CYAN}cd ~/.local/share/omarchy${NC}"
echo -e " ${CYAN}bash bootstrap.sh${NC}"
echo ""
print_warning "Make sure you're running as root when you execute the bootstrap script."
echo ""
}
# Main execution
main() {
print_banner
echo -e "${BOLD}Omarchy Mac Setup${NC}"
echo -e "Downloading the repository to your system...\n"
# Pre-flight checks
check_root
# Clone repository
clone_repository
}
# Run main function
main "$@"