-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·254 lines (212 loc) · 5.75 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·254 lines (212 loc) · 5.75 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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
#!/bin/bash
# ===========================
# Instalador de apps Arch
# ===========================
# Colores
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No color
# ===========================
# Paquetes a instalar
# Añade o quita los que quieras
# ===========================
PACMAN_PACKAGES=(
# Sistema
base-devel
xorg
xorg-apps
ly
bash-completion
starship
pkgfile
numlockx
# i3 y entorno
i3-wm
i3blocks
picom
dunst
rofi
feh
lxsession # polkit agent
# Terminal
alacritty
# Audio
pulseaudio
pulseaudio-alsa
pavucontrol
# Red
networkmanager
network-manager-applet
# Fuentes
ttf-jetbrains-mono-nerd
ttf-nerd-fonts-symbols
# Herramientas
git
curl
wget
htop
fastfetch
acpi
wireless_tools
dosfstools
ntfs-3g
# Editores
neovim
# Utilidades
gdb
valgrind
clang
# Navegador
firefox
)
AUR_PACKAGES=(
zen_browser_bin
betterlockscreen
fusuma
)
# ===========================
# Funciones
# ===========================
print_banner() {
echo -e "${BLUE}"
echo "╔══════════════════════════════════╗"
echo "║ Instalador Arch Linux ║"
echo "╚══════════════════════════════════╝"
echo -e "${NC}"
}
check_root() {
if [ "$EUID" -eq 0 ]; then
echo -e "${RED}No ejecutes este script como root.${NC}"
exit 1
fi
}
install_yay() {
if ! command -v yay &>/dev/null; then
echo -e "${YELLOW}Instalando yay (AUR helper)...${NC}"
git clone https://aur.archlinux.org/yay.git /tmp/yay
cd /tmp/yay && makepkg -si --noconfirm
cd - && rm -rf /tmp/yay
echo -e "${GREEN}yay instalado.${NC}"
else
echo -e "${GREEN}yay ya está instalado.${NC}"
fi
}
install_pacman() {
echo -e "${BLUE}Actualizando sistema...${NC}"
sudo pacman -Syu --noconfirm
echo -e "${BLUE}Instalando paquetes de pacman...${NC}"
for pkg in "${PACMAN_PACKAGES[@]}"; do
if pacman -Qi "$pkg" &>/dev/null; then
echo -e " ${GREEN}✔ $pkg ya instalado${NC}"
else
echo -e " ${YELLOW}➜ Instalando $pkg...${NC}"
sudo pacman -S --noconfirm "$pkg" 2>/dev/null \
&& echo -e " ${GREEN}✔ $pkg instalado${NC}" \
|| echo -e " ${RED}✘ Error instalando $pkg${NC}"
fi
done
}
install_aur() {
if [ ${#AUR_PACKAGES[@]} -eq 0 ]; then
echo -e "${YELLOW}No hay paquetes AUR configurados.${NC}"
return
fi
echo -e "${BLUE}Instalando paquetes de AUR...${NC}"
for pkg in "${AUR_PACKAGES[@]}"; do
if pacman -Qi "$pkg" &>/dev/null; then
echo -e " ${GREEN}✔ $pkg ya instalado${NC}"
else
echo -e " ${YELLOW}➜ Instalando $pkg...${NC}"
yay -S --noconfirm "$pkg" 2>/dev/null \
&& echo -e " ${GREEN}✔ $pkg instalado${NC}" \
|| echo -e " ${RED}✘ Error instalando $pkg${NC}"
fi
done
}
summary() {
echo -e "${BLUE}"
echo "╔══════════════════════════════════╗"
echo "║ Instalación completa ║"
echo "╚══════════════════════════════════╝"
echo -e "${NC}"
}
configure_ly() {
if pacman -Qi ly &>/dev/null && systemctl is-active --quiet ly*;then
sudo systemctl enable --now ly@tty1.service
fi
}
configure_fusuma() {
echo -e "${BLUE}Configurando fusuma...${NC}"
sudo pacman -S --noconfirm ruby libinput xdotool
sudo gpasswd -a "$USER" input
mkdir -p ~/.config/fusuma
cat <<EOF > ~/.config/fusuma/config.yml
swipe:
3:
left:
command: "i3-msg workspace next"
right:
command: "i3-msg workspace prev"
up:
command: "i3-msg focus up"
down:
command: "i3-msg focus down"
pinch:
in:
command: "i3-msg fullscreen enable"
out:
command: "i3-msg fullscreen disable"
EOF
echo -e "${GREEN}Fusuma configurado.${NC}"
}
# ===========================
# Main
# ===========================
print_banner
check_root
install_pacman
install_yay
install_aur
summary
# Ruta donde está el script
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
CONFIG_DIR="$HOME/.config"
HOME_DIR="$HOME"
echo "📁 Dotfiles desde: $SCRIPT_DIR"
echo "🔗 Enlazando a: $CONFIG_DIR y $HOME_DIR"
# Asegura que ~/.config existe
mkdir -p "$CONFIG_DIR"
# Enlazar directorios en .config
for dir in "$SCRIPT_DIR"/*/; do
name=$( "$dir")
# Evitar carpetas que no deben enlazarse
[[ "$name" == ".git" ]] && continue
[[ "$name" == "install.sh" ]] && continue
echo "📂 Enlazando directorio $name → $CONFIG_DIR/$name"
ln -sfn "$dir" "$CONFIG_DIR/$name"
done
# Enlazar archivos individuales
for file in "$SCRIPT_DIR"/.* "$SCRIPT_DIR"/*.conf; do
filename=$(basename "$file")
# Saltar si no es un archivo regular
[[ ! -f "$file" ]] && continue
case "$filename" in
.bashrc | .zshrc | .bash_profile | .bash_logout )
echo "📄 Enlazando $filename → $HOME_DIR/$filename"
ln -sfn "$file" "$HOME_DIR/$filename"
;;
*.conf )
echo "📄 Enlazando $filename → $CONFIG_DIR/$filename"
ln -sfn "$file" "$CONFIG_DIR/$filename"
;;
* )
# Saltar otros archivos ocultos o temporales
;;
esac
done
echo "✅ Todos los enlaces han sido creados."
echo "ARRANCANDO EL SISTEMA................................"
configure_ly
configure_fusuma