-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap_os.sh
executable file
·152 lines (133 loc) · 3.4 KB
/
bootstrap_os.sh
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
#!/bin/bash
# Define colors and symbols
COLOR_RESET="\033[0m"
COLOR_GREEN="\033[32m"
COLOR_RED="\033[31m"
COLOR_YELLOW="\033[33m"
ARROW="---> "
# Function to print colored messages
print_message() {
local color=$1
local message=$2
echo -e "${color}${ARROW}${message}${COLOR_RESET}"
}
# Install yay if not already installed
if ! command -v yay &>/dev/null; then
print_message "$COLOR_YELLOW" "yay not found, installing yay..."
sudo pacman -S --needed git base-devel || { print_message "$COLOR_RED" "Failed to install required packages for yay."; exit 1; }
git clone https://aur.archlinux.org/yay.git || { print_message "$COLOR_RED" "Failed to clone yay repository."; exit 1; }
cd yay
makepkg -si || { print_message "$COLOR_RED" "Failed to build and install yay."; exit 1; }
cd ..
fi
# Function to check if a package is available in the repositories or AUR
is_package_available() {
local package=$1
# Check if the package is available in the official repositories
pacman -Qi "$package" &>/dev/null || yay -Qi "$package" &>/dev/null
}
# Function to install a package
install_package() {
local package=$1
if is_package_available "$package"; then
print_message "$COLOR_GREEN" "$package is available in the repositories or AUR."
else
print_message "$COLOR_YELLOW" "$package not found. Installing with yay..."
yay -S --noconfirm "$package" || { print_message "$COLOR_RED" "Failed to install $package with yay."; exit 1; }
fi
}
# List of packages to install
packages=(
# Shells
"zsh"
# System utilities
"neovim"
"lazygit"
"tmux"
"neofetch"
"stow"
"blueman"
"systemd-homed"
"gnome-disk-utility"
"gnome-system-monitor"
"catppuccin-gtk-theme-mocha"
"nwg-look"
"nautilus"
"fragments"
# Graphics and display
"hyprland"
"wayland"
"wayland-protocols"
"wlroots"
"xorg-xwayland"
"qt5-wayland"
"qt6-wayland"
"wofi"
"swappy"
"xdg-desktop-portal-gtk"
# Fonts
"ttf-dejavu"
"ttf-freefont"
"fontconfig"
"noto-fonts"
"ttf-hack"
"ttf-material-design-icons"
"ttf-font-awesome"
# Networking
"networkmanager"
"network-manager-applet"
"xorg-server-xwayland"
# Audio and video
"pavucontrol"
"pulseaudio"
"playerctl"
"pipewire"
"pipewire-alsa"
"pipewire-pulse"
"pipewire-jack"
# NVIDIA drivers
'nvidia'
'nvidia-utils'
'nvidia-settings'
# Other
"polkit-gnome"
"wl-clipboard"
"kitty"
"yazi"
"python-pillow"
"xdg-desktop-portal-hyprland-git"
"ripgrep"
# Development tools
"insomnia"
"nodejs"
"npm"
"nvm"
"python"
"python-pip"
"docker"
"docker-compose"
"php"
"sqlite"
"laravel"
"composer"
"datagrip"
"jre-openjdk"
"android-studio"
)
# Install packages
for package in "${packages[@]}"; do
install_package "$package"
done
# Clone and stow dotfiles if not already present
if [ ! -d "dotfiles" ]; then
print_message "$COLOR_YELLOW" "Cloning dotfiles repository..."
git clone https://github.com/felixoakz/dotfiles.git || { print_message "$COLOR_RED" "Failed to clone dotfiles repository."; exit 1; }
fi
print_message "$COLOR_YELLOW" "Stowing dotfiles..."
cd dotfiles
stow . || { print_message "$COLOR_RED" "Failed to stow dotfiles."; exit 1; }
cd ..
# Change default shell to zsh
print_message "$COLOR_YELLOW" "Changing default shell to zsh..."
chsh -s "$(which zsh)" || { print_message "$COLOR_RED" "Failed to change default shell to zsh."; exit 1; }
print_message "$COLOR_GREEN" "Installation complete."