#!/usr/bin/env bash
set -euo pipefail

echo "=== INXS Shell Reset ==="

USER_HOME="$HOME"

echo "[+] Restoring bash as default shell"
if command -v chsh >/dev/null 2>&1; then
    chsh -s /bin/bash "$USER"
fi

echo "[+] Removing Oh-My-Zsh"
rm -rf "$USER_HOME/.oh-my-zsh"

echo "[+] Removing Zsh config files"
rm -f "$USER_HOME/.zshrc"
rm -f "$USER_HOME/.p10k.zsh"

echo "[+] Removing fzf (GitHub version)"
rm -rf "$USER_HOME/.fzf"

echo "[+] Removing shared config"
rm -f "$USER_HOME/.shell_common"

echo "[+] Removing broken .bashrc (will be recreated)"
rm -f "$USER_HOME/.bashrc"

echo "[+] Removing Debian fzf if still installed"
sudo apt remove --purge -y fzf || true

echo "[+] Cleaning leftover Zsh files"
rm -rf "$USER_HOME/.zsh*" 2>/dev/null || true

echo "=== Reset complete. Open a new terminal (bash should load). ==="
