#!/usr/bin/env bash
set -euo pipefail
test "$(id -u)" -eq 0 || { echo 'run as root' >&2; exit 1; }
theme=/usr/share/plymouth/themes/spinner/spinner.plymouth
[ -f /usr/share/plymouth/themes/bgrt/bgrt.plymouth ] && theme=/usr/share/plymouth/themes/bgrt/bgrt.plymouth
update-alternatives --set default.plymouth "$theme"
update-initramfs -u -k all
update-grub
echo "Restored Plymouth theme: $theme"
