-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·79 lines (60 loc) · 2.3 KB
/
setup.sh
File metadata and controls
executable file
·79 lines (60 loc) · 2.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
#!/bin/bash
# ZSH Configuration Setup Script
# This script installs all dependencies required for the zsh configuration
echo "🚀 Setting up ZSH configuration..."
# Check if running as root
if [[ $EUID -eq 0 ]]; then
echo "❌ This script should not be run as root"
exit 1
fi
# Function to check if command exists
command_exists() {
command -v "$1" >/dev/null 2>&1
}
# Function to install package based on distribution
install_package() {
local package=$1
if command_exists apt; then
sudo apt install -y "$package"
elif command_exists pacman; then
sudo pacman -S --noconfirm "$package"
elif command_exists dnf; then
sudo dnf install -y "$package"
elif command_exists brew; then
brew install "$package"
else
echo "❌ Unsupported package manager. Please install $package manually."
fi
}
echo "📦 Installing ZSH dependencies..."
# Install ZSH if not present
if ! command_exists zsh; then
echo "Installing ZSH..."
install_package zsh
fi
# Install Oh My Zsh
if [ ! -d "$HOME/.oh-my-zsh" ]; then
echo "Installing Oh My Zsh..."
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended
fi
# Install ZSH plugins
echo "Installing ZSH plugins..."
# zsh-autosuggestions
if [ ! -d "$HOME/.oh-my-zsh/custom/plugins/zsh-autosuggestions" ]; then
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
fi
# zsh-syntax-highlighting
if [ ! -d "$HOME/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting" ]; then
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
fi
# fast-syntax-highlighting
if [ ! -d "$HOME/.oh-my-zsh/custom/plugins/fast-syntax-highlighting" ]; then
git clone https://github.com/zdharma-continuum/fast-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/fast-syntax-highlighting
fi
# zsh-autocomplete
if [ ! -d "$HOME/.oh-my-zsh/custom/plugins/zsh-autocomplete" ]; then
git clone https://github.com/marlonrichert/zsh-autocomplete.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autocomplete
fi
echo "✅ ZSH setup complete!"
echo "🔧 Next steps:"
echo "1. Restart your terminal or run: source ~/.zshrc"