This commit is contained in:
Stephan Raabe 2024-03-17 10:47:38 +01:00
parent b4e291cc74
commit 001527ba1c
4 changed files with 33 additions and 23 deletions

View File

@ -8,7 +8,7 @@ monitorrestored=0
_showRestoreOptions() {
echo "The following configurations can be transferred into the new installation."
echo "(SPACE = select/unselect a profile. RETURN = confirm. No selection = CANCEL)"
echo "(SPACE = select/unselect a profile. RETURN = confirm. ESC/No selection = Skip Restore)"
echo ""
restorelist=""
if [ -f ~/dotfiles/.bashrc ]; then
@ -75,18 +75,18 @@ _showRestoreOptions() {
echo "Selected to restore:"
echo "$restoreselect"
echo ""
confirmrestore=$(gum choose "Start restore" "Change restore" "Cancel restore")
confirmrestore=$(gum choose "Start restore" "Change restore" "Skip restore")
if [ "$confirmrestore" == "Start restore" ] ;then
_startRestore
elif [ "$confirmrestore" == "Change restore" ]; then
_showRestoreOptions
else
echo "Restore skipped."
echo ":: Restore skipped."
return 0
fi
else
echo "No files selected to restore."
confirmrestore=$(gum choose "Change restore" "Cancel restore")
confirmrestore=$(gum choose "Change restore" "Skip restore")
if [ -z "${confirmrestore}" ] ;then
echo "Installation canceled."
exit
@ -95,7 +95,7 @@ _showRestoreOptions() {
echo ""
_showRestoreOptions
else
echo "Restore skipped."
echo ":: Restore skipped."
return 0
fi
fi
@ -110,7 +110,7 @@ _startRestore() {
fi
if [[ $restoreselect == *"~/dotfiles/.settings"* ]] || [[ $restoreselect == *"All"* ]] ; then
if [ -d ~/dotfiles/.settings ]; then
rsync -a -I ~/dotfiles/.settings/ ~/dotfiles-versions/$version/.settings/
rsync -avhp -I ~/dotfiles/.settings/ ~/dotfiles-versions/$version/.settings/
echo ":: .settings restored!"
fi
fi
@ -189,15 +189,14 @@ _startRestore() {
}
if [ -d ~/dotfiles ]; then
echo -e "${GREEN}"
figlet "Restore"
echo -e "${NONE}"
restored=0
echo "The script will try to restore existing configurations."
echo "PLEASE NOTE: Restoring is not possible with version < 2.6 of the dotfiles."
echo "In that case, please use the automated backup or create your own backup manually."
echo ""
_showRestoreOptions
echo ""
echo -e "${GREEN}"
figlet "Restore"
echo -e "${NONE}"
restored=0
echo "The script will try to restore existing configurations."
echo "PLEASE NOTE: Restoring is not possible with version < 2.6 of the dotfiles."
echo "In that case, please use the automated backup or create your own backup manually."
echo ""
_showRestoreOptions
echo ""
fi

View File

@ -1,4 +1,15 @@
echo -e "${GREEN}"
figlet "Restore Settings"
echo -e "${NONE}"
python .install/restore.py
if [ "$restored" == "1" ]; then
echo -e "${GREEN}"
figlet "Restore Settings"
echo -e "${NONE}"
python .install/restore.py
else
if [ -f ~/dotfiles/.settings/settings.json ] ;then
rm ~/dotfiles/.settings/settings.json
echo ":: settings.json removed"
fi
if [ -f ~/.cache/.themestyle.sh ] ;then
rm ~/.cache/.themestyle.sh
echo ":: .themestyle.sh removed"
fi
fi

View File

@ -1 +1 @@
2.8.3RC2
2.8.3

View File

@ -1,4 +1,4 @@
# ML4W dotfiles 2.8.3 RC2
# ML4W dotfiles 2.8.3 RC3
An advanced configuration of Hyprland and Qtile for Arch Linux based distributions. This package includes an installation script to install and setup the required components.