#! /bin/bash

#this script was written by the MX Linux Dev Team in January 2020
#its function is to restore the toolbar settings that were in place
#before the user selected the legacy look

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

TITLE1=$"OK to proceed?"
MSG=$"This will restore the settings that were in place when you selected a legacy toolbar layout."
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 the archived files, clearing out the folder
cd $HOME/.restore/fluxbox
mv init startup apps $HOME/.fluxbox/

##begin 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
