2.3 KiB
2.3 KiB
Kurz gesagt: Nein – GNU Stow führt keine Skripte aus. Und das ist auch Absicht 🙂
GNU Stow macht nur eine Sache:
Es erzeugt und entfernt Symlinks.
Keine Hooks. Keine Post-Deploy-Skripte. Keine Automatik.
🧠 Warum ist das so?
Stow ist bewusst:
- minimalistisch
- deterministisch
- side-effect-frei
Dadurch bleibt dein Setup transparent und reproduzierbar.
✅ Aber: Man kann es kombinieren
Wenn du beim „Deploy“ zusätzlich Dinge tun willst (z. B. Monitor-Symlink setzen, Pakete installieren, Cache leeren, etc.), gibt es saubere Lösungen:
🔹 Lösung 1: Bootstrap-Script (empfohlen)
Du schreibst dir ein Script wie:
#!/bin/bash
set -e
cd ~/dotfiles
echo "→ Stowing configs"
stow hypr
stow waybar
stow zsh
echo "→ Setting monitor config"
ln -sf desktop.conf hypr/.config/hypr/monitors/current.conf
echo "→ Reloading Hyprland"
hyprctl reload
Dann einfach:
./install.sh
💡 Das ist die professionellste Lösung.
🔹 Lösung 2: Hostname-basierte Logik im Script
HOST=$(hostname)
if [[ "$HOST" == "desktop" ]]; then
ln -sf desktop.conf hypr/.config/hypr/monitors/current.conf
elif [[ "$HOST" == "laptop" ]]; then
ln -sf laptop.conf hypr/.config/hypr/monitors/current.conf
fi
Dann musst du nichts manuell wählen.
🔹 Lösung 3: Makefile (sehr elegant)
Beispiel:
install:
stow hypr
stow waybar
./scripts/select-monitor.sh
Dann:
make install
Sehr beliebt in Dotfile-Repos.
🔹 Lösung 4: „echte“ Dotfile-Manager
Wenn du wirklich Logik + Templates willst:
- chezmoi
- yadm
Diese können:
- Hostname erkennen
- Variablen verwenden
- Templates generieren
- Skripte ausführen
Aber sie sind komplexer als Stow.
🎯 Empfehlung für dich (Hyprland + mehrere Systeme)
Da du:
- Monitor-Configs pro System brauchst
- wahrscheinlich Arch nutzt
- modular arbeiten willst
👉 Stow + Bootstrap-Script ist die perfekte Balance.
💬 Kurzantwort auf deine Frage
| Frage | Antwort |
|---|---|
| Führt Stow Skripte aus? | ❌ Nein |
| Kann man es kombinieren? | ✅ Ja |
| Beste Praxis? | Stow + install.sh |