bash <(cat << 'EOF'
#!/bin/bash
set -e
TMP_DIR="/tmp/miku-installer"
mkdir -p "$TMP_DIR"
cd "$TMP_DIR"
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m'
echo -e "${GREEN}=== Miku Theme Installer for Arch ===${NC}"
download_file() { wget --user-agent="Mozilla/5.0 (X11; Linux x86_64)" -q --show-progress -O "$2" "$1"; }
echo -e "${GREEN}[1/5] GRUB theme...${NC}"
download_file "https://store.kde.org/s/Opendesktop/p/2350075/download" "omokage.zip"
unzip -q omokage.zip
cd Omokage*
chmod +x install.sh
sudo ./install.sh
cd "$TMP_DIR"
sudo update-grub 2>/dev/null || sudo grub-mkconfig -o /boot/grub/grub.cfg
echo -e "${GREEN}[2/5] Plymouth DIY...${NC}"
if [ -f "$HOME/Pictures/miku-plymouth.png" ]; then
sudo mkdir -p /usr/share/plymouth/themes/miku-diy/
sudo cp "$HOME/Pictures/miku-plymouth.png" /usr/share/plymouth/themes/miku-diy/bg.png
echo -e '[Plymouth Theme]\nName=Miku DIY\nModuleName=script\n[script]\nImageDir=/usr/share/plymouth/themes/miku-diy\nScriptFile=/usr/share/plymouth/themes/miku-diy/miku.script' | sudo tee /usr/share/plymouth/themes/miku-diy/miku.plymouth >/dev/null
echo 'wallpaper_image = Image("bg.png"); my_front = wallpaper_image.Scale(screen.width, screen.height); my_front.sprite = [my_front];' | sudo tee /usr/share/plymouth/themes/miku-diy/miku.script >/dev/null
sudo plymouth-set-default-theme -R miku-diy
else echo -e "${YELLOW}⚠ No ~/Pictures/miku-plymouth.png${NC}"; fi
echo -e "${GREEN}[3/5] Miku cursors...${NC}"
download_file "https://github.com/supermariofps/hatsune-miku-windows-linux-cursors/archive/refs/heads/main.zip" "cursors.zip"
unzip -q cursors.zip
sudo cp -r hatsune-miku-windows-linux-cursors-main/miku-cursor-linux /usr/share/icons/
echo -e "${GREEN}[4/5] Opening systemsettings for splash screen...${NC}"
echo -e "${YELLOW}Manual: Workspace Behavior → Splash Screen → Get New → search 'Snowy Night Miku'${NC}"
systemsettings5 &
sleep 2
echo -e "${GREEN}[5/5] Wallpaper...${NC}"
[ -f "$HOME/Pictures/miku-wallpaper.png" ] && plasma-apply-wallpaperimage "$HOME/Pictures/miku-wallpaper.png" 2>/dev/null || echo -e "${YELLOW}⚠ No wallpaper image${NC}"
cd / && rm -rf "$TMP_DIR"
echo -e "${GREEN}Done! Reboot to see changes.${NC}"
EOF
)