install.sh: quitar los enlaces a archivos borrados del repo

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C5v1qWDwgkaVM5kjVHGGh8
This commit is contained in:
Alejandro Guerrero 2026-09-28 12:18:28 +02:00
parent 1f4a6a8803
commit 0a6281b543
Signed by: alejandrogs73
GPG key ID: 1CFF10953BEE333C
3 changed files with 12 additions and 2 deletions

View file

@ -34,7 +34,8 @@ for example) and repeated safely:
2. `suckless`: builds the programs and installs them in `/usr/local`. 2. `suckless`: builds the programs and installs them in `/usr/local`.
3. `enlaces` (links): symlinks every file in `home/` into `~`. If a different 3. `enlaces` (links): symlinks every file in `home/` into `~`. If a different
file was already there, it is kept as `.bak`. Since they are symlinks, file was already there, it is kept as `.bak`. Since they are symlinks,
editing `~/.bashrc` edits the repo. It also creates the user folders and editing `~/.bashrc` edits the repo. Links to files deleted from the repo
are removed. It also creates the user folders and
sets `~/.ssh` to 700. sets `~/.ssh` to 700.
4. `gtk`: builds the [Everforest GTK](https://github.com/Fausto-Korpsvart/Everforest-GTK-Theme) 4. `gtk`: builds the [Everforest GTK](https://github.com/Fausto-Korpsvart/Everforest-GTK-Theme)
theme (green, dark, medium palette) in `~/.themes` from a pinned commit, theme (green, dark, medium palette) in `~/.themes` from a pinned commit,

View file

@ -30,7 +30,8 @@ Hace siete pasos, que también se pueden lanzar por separado
2. `suckless`: compila e instala los programas en `/usr/local`. 2. `suckless`: compila e instala los programas en `/usr/local`.
3. `enlaces`: enlaza cada archivo de `home/` en `~`. Si ya existía un archivo 3. `enlaces`: enlaza cada archivo de `home/` en `~`. Si ya existía un archivo
distinto, lo guarda como `.bak`. Como son enlaces, editar `~/.bashrc` es distinto, lo guarda como `.bak`. Como son enlaces, editar `~/.bashrc` es
editar el repo. También crea las carpetas del usuario y deja `~/.ssh` en editar el repo. Los enlaces a archivos que se han borrado del repo se
quitan. También crea las carpetas del usuario y deja `~/.ssh` en
700. 700.
4. `gtk`: compila el tema [Everforest GTK](https://github.com/Fausto-Korpsvart/Everforest-GTK-Theme) 4. `gtk`: compila el tema [Everforest GTK](https://github.com/Fausto-Korpsvart/Everforest-GTK-Theme)
(verde, oscuro, paleta medium) en `~/.themes`, en una versión fija, y lo (verde, oscuro, paleta medium) en `~/.themes`, en una versión fija, y lo

View file

@ -104,6 +104,14 @@ enlaces() {
done done
cd "$DIR" cd "$DIR"
# Los enlaces a archivos que ya no están en home/ (borrados del repo)
find "$HOME" -xdev -type l -lname "$DIR/home/*" ! -exec test -e {} \; -print |
while read -r l; do
rm "$l"
rmdir "$(dirname "$l")" 2>/dev/null || true
echo " ${l#"$HOME"/} (ya no está en el repo: quitado)"
done
# Las carpetas de home/.config/user-dirs.dirs (y la de las capturas) # Las carpetas de home/.config/user-dirs.dirs (y la de las capturas)
mkdir -p "$HOME/Documents" "$HOME/Downloads" "$HOME/Images/Screenshots" mkdir -p "$HOME/Documents" "$HOME/Downloads" "$HOME/Images/Screenshots"
# ssh no quiere ~/.ssh accesible para otros # ssh no quiere ~/.ssh accesible para otros