#! /bin/bash

#this script was written by the MX Linux Dev Team in January 2020
#its function is to restore the default settings for init, startup and menu-mx

TEXTDOMAINDIR=/usr/share/locale
export TEXTDOMAIN="mx-fluxbox"

TITLE1=$"OK to proceed?"
MSG=$"This will restore the default settings for init, startup and menu-mx. That will overwrite what is currently in your fluxbox folder."
TITLE2=$"All done!"
END_MSG=$"Log out and back in to complete the change."

##begin msg box
yad --text="


<b>$MSG</b>" --title="$TITLE1" --window-icon=/usr/share/icons/mxflux.png --geometry=400x30 --text-align=center --button=gtk-cancel:1 --button=gtk-yes:0

##end message box
 
case $? in

             0)     ;;

             1)     exit 0    ;;

	  252)     exit 0    ;;

             
esac

#restore default files
cd /etc/skel/.fluxbox/
cp startup init menu-mx  "$HOME/.fluxbox/"

##start end_msg box
yad --text="


<b>$END_MSG</b>" --title="$TITLE2" --window-icon=/usr/share/icons/mxflux.png --geometry=400x40 --text-align=center 
##end end_msg box

exit
