#!/usr/bin/env bash # Konfiguration DEBUG=true LOGFILE="/tmp/install.log" # Logging-Setup if [ "$DEBUG" = true ]; then echo "🛠 Debugmodus aktiv" set -x else echo "🔒 Starte im Silent-Modus – Logfile: $LOGFILE" exec > >(tee -a "$LOGFILE") 2>&1 fi # Pausieren im Debug-Modus pause_if_debug() { if [ "$DEBUG" = true ]; then printf "🔍 DEBUG: Drücke [Enter] um fortzufahren..." read dummy < /dev/tty fi } log() { echo "$@" } run() { if [ "$DEBUG" = true ]; then "$@" else "$@" >> "$LOGFILE" 2>&1 fi } apt_safe_upgrade() { log "🔁 Führe sicheres System-Upgrade durch..." if [ "$DEBUG" = true ]; then sudo DEBIAN_FRONTEND=noninteractive nala upgrade -y else sudo DEBIAN_FRONTEND=noninteractive nala upgrade -y >> "$LOGFILE" 2>&1 fi if [ $? -eq 0 ]; then log "✅ System-Upgrade erfolgreich abgeschlossen." else log "❌ Fehler beim System-Upgrade. Details siehe $LOGFILE" fi } # ------------------------------------------------------------------------------ log "📦 Installiere Pakete..." log "📦 Versuche nala zu installieren..." if ! sudo apt install -y nala; then log "⚠️ nala konnte nicht direkt installiert werden. Versuche Quelle hinzuzufügen..." # Paketquelle für nala hinzufügen echo "deb [trusted=yes] http://deb.volian.org/volian/ scar main" | sudo tee /etc/apt/sources.list.d/volian-archive-scar.list > /dev/null wget -qO - https://deb.volian.org/volian/scar.key | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/volian-archive-scar.gpg sudo apt update # Erneuter Installationsversuch if ! sudo apt install -y nala; then log "❌ nala konnte auch nach Hinzufügen der Quelle nicht installiert werden. Updates müssen später manuell installiert werden" run sudo apt install alacritty ninja-build gettext libtool-bin cmake g++ pkg-config unzip curl git tmux build-essential manpages-dev clangd python3-jedi zsh -y else apt_safe_upgrade run sudo nala install alacritty ninja-build gettext libtool-bin cmake g++ pkg-config unzip curl git tmux build-essential manpages-dev clangd python3-jedi zsh -y fi else log "✅ nala erfolgreich installiert." apt_safe_upgrade run sudo nala install alacritty ninja-build gettext libtool-bin cmake g++ pkg-config unzip curl git tmux build-essential manpages-dev clangd python3-jedi zsh -y fi pause_if_debug clear log "📥 Lade Daten" run git clone https://git.boergmann.it/klaas/shellskripte cd shellskripte || exit 1 run cp ./configs/zshrc ~/.zshrc run cp .config/tmux.conf ~/.tmux.conf mkdir -p ~/.ssh run cp ./ssh/authorized_keys ~/.ssh/authorized_keys run sudo sh ./ssh/ssh_password -n pause_if_debug clear log "🧪 Installiere Neovim" cd ~ run git clone https://github.com/neovim/neovim cd neovim || exit 1 run git checkout stable run make CMAKE_BUILD_TYPE=RelWithDebInfo run sudo make install cd ~ rm -Rf neovim log "⚙️ Konfiguriere Neovim" mkdir -p ~/.config/nvim run cp ~/shellskripte/configs/init.vim ~/.config/nvim/init.vim sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' nvim --headless +PlugInstall +qa nvim --headless -c 'CocInstall -sync coc-python' -c 'qall' nvim --headless -c 'CocInstall -sync coc-clangd' -c 'qall' pause_if_debug clear log "⬇️ Installiere Node.js via nvm" curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" nvm install v20 log "📦 Installiere Node.js Tools" run npm install -g yarn run npm install -g nodemon log "🔌 Neovim NodeJS-Sprachunterstützung" cd ~/.local/share/nvim/plugged/coc.nvim || exit 1 run yarn install run yarn build log "🧹 Aufräumen" rm -Rf ~/shellskripte log "🔤 Installiere JetBrainsMono Nerd Font..." FONT_DIR="$HOME/.local/share/fonts" mkdir -p "$FONT_DIR" # Lade nur die Mono-Version (komplettes Nerd Font Paket ist riesig) run wget -O "$FONT_DIR/JetBrainsMonoNerdFontMono-Regular.ttf" \ https://github.com/ryanoasis/nerd-fonts/releases/download/v3.1.1/JetBrainsMono.zip # Entpacken TEMP_FONT_ZIP="/tmp/JetBrainsMono.zip" run wget -O "$TEMP_FONT_ZIP" https://github.com/ryanoasis/nerd-fonts/releases/download/v3.1.1/JetBrainsMono.zip run unzip -o "$TEMP_FONT_ZIP" -d "$FONT_DIR/JetBrainsMono" # Optional: Nur *.ttf in den Font-Ordner verschieben find "$FONT_DIR/JetBrainsMono" -type f -name "*.ttf" -exec mv {} "$FONT_DIR/" \; rm -Rf "$FONT_DIR/JetBrainsMono" "$TEMP_FONT_ZIP" # Font-Cache aktualisieren run fc-cache -fv "$FONT_DIR" log "✅ JetBrainsMono Nerd Font installiert." log "🖥️ Setze Alacritty als Standard-Terminal..." if command -v update-alternatives &>/dev/null; then sudo update-alternatives --install /usr/bin/x-terminal-emulator x-terminal-emulator /usr/bin/alacritty 50 sudo update-alternatives --set x-terminal-emulator /usr/bin/alacritty log "✅ Alacritty ist nun das Standard-Terminal (x-terminal-emulator)." else log "⚠️ Konnte update-alternatives nicht finden – bitte Terminal manuell setzen." fi log "⚙️ Konfiguriere Alacritty mit JetBrainsMono Nerd Font..." ALACRITTY_CONFIG_DIR="$HOME/.config/alacritty" mkdir -p "$ALACRITTY_CONFIG_DIR" # Beispielhafte minimale Konfiguration cat > "$ALACRITTY_CONFIG_DIR/alacritty.yml" <