#!/bin/bash
set -e

MOUNT_POINT="/mnt"

echo "Setting up Cosmic Desktop..."

# Enable Cosmic services
systemctl enable cosmic-greeter

# Install additional Cosmic components
pacman -S --noconfirm --needed \
    cosmic-files \
    cosmic-edit \
    cosmic-term \
    cosmic-store \
    cosmic-settings \
    xwayland-satellite

# Configure Cosmic with Kanagawa Dragon theme
if [ -n "$SUDO_USER" ]; then
    USER_HOME="/home/$SUDO_USER"
    mkdir -p "$USER_HOME/.config/cosmic"
    chown -R "$SUDO_USER:$SUDO_USER" "$USER_HOME/.config"
fi

echo "Cosmic Desktop setup complete!"