#!/bin/bash


TEXT="Ubuntu Budgie Welcome is now a SNAP package.\n"
TEXT+="To complete the installation the budgie-welcome package\n"
TEXT+="needs to be removed and the ubuntu-budgie-welcome snap package needs to be installed\n\n"

REMIX=$(dpkg -l budgie-remix-desktop | grep "budgie-remix-desktop")
if [ $? -eq 0 ]; then
  TEXT+="In addition, the Budgie Remix packages need to be removed and the greeter switched to Slick\n\n"
fi

TEXT+="An automatic reboot will complete the installation.\n\n"
TEXT+="Clicking Yes will complete the upgrade - continue?"

zenity --question \
       --width=600 \
       --title="Complete the installation" \
	   --text="$TEXT" \
	   --no-wrap


case $? in 
  0)
  zenity --info --width=600 --title="Installing" --text="Installation in progress - reboot will occur automatically." &
  pkexec /usr/lib/budgie-welcome/budgie-letsrun-script
  ;;
  1) echo 'No'
  ;;
  *) echo 'ignore'
  ;;
esac
