Commit 2.5.1

This commit is contained in:
Stephan Raabe
2023-11-17 13:48:02 +01:00
parent 1dbbe07adf
commit 308e1f70ec
48 changed files with 296 additions and 288 deletions

View File

@@ -3,6 +3,7 @@
# ------------------------------------------------------
if [ -d ~/dotfiles ]; then
echo -e "${GREEN}"
cat <<"EOF"
____ _
| _ \ ___ ___| |_ ___ _ __ ___
@@ -11,102 +12,68 @@ cat <<"EOF"
|_| \_\___||___/\__\___/|_| \___|
EOF
echo -e "${NONE}"
restored=0
echo "The script will try to restore existing configurations."
echo "PLEASE NOTE: Restoring is not possible with version < 2.5 of the dotfiles."
echo "Keyboard layout can be defined manually in the next step."
echo "In that case, please use the autamated backup or create your own backup manually."
echo ""
restored=0
echo "The following configurations can be transferred into the new installation."
if [ -f ~/dotfiles/.bashrc ]; then
while true; do
read -p "Found existing ~/dotfiles/.bashrc Restore? (Yy/Nn): " yn
case $yn in
[Yy]* )
cp ~/dotfiles/.bashrc ~/dotfiles-versions/$version/
echo "Restored!"
restored=1
break;;
[Nn]* )
break;;
* ) echo "Please answer yes or no.";;
esac
done
echo ".bashrc file: ~/dotfiles/.bashrc"
fi
if [ $profile == "Hyprland" ] || [ $profile == "All" ]; then
if [ -f ~/dotfiles/hypr/conf/keyboard.conf ]; then
while true; do
read -p "Found existing ~/dotfiles/hypr/conf/keyboard.conf Restore? (Yy/Nn): " yn
case $yn in
[Yy]* )
cp ~/dotfiles/hypr/conf/keyboard.conf ~/dotfiles-versions/$version/hypr/conf/
echo "Restored!"
restored=1
break;;
[Nn]* )
break;;
* ) echo "Please answer yes or no.";;
esac
done
echo "Hyprland keyboard layout: ~/dotfiles/hypr/conf/keyboard.conf"
fi
fi
if [ $profile = "Hyprland" ] || [ $profile == "All" ]; then
if [ -f ~/dotfiles/hypr/conf/monitor.conf ]; then
while true; do
read -p "Found existing ~/dotfiles/hypr/conf/monitor.conf Restore? (Yy/Nn): " yn
case $yn in
[Yy]* )
cp ~/dotfiles/hypr/conf/monitor.conf ~/dotfiles-versions/$version/hypr/conf/
echo "Restored!"
restored=1
break;;
[Nn]* )
break;;
* ) echo "Please answer yes or no.";;
esac
done
echo "Hyprland monitor setup: ~/dotfiles/hypr/conf/monitor.conf"
fi
fi
if [ $profile == "Hyprland" ] || [ $profile == "All" ]; then
if [ -f ~/dotfiles/hypr/conf/keybindings.conf ]; then
while true; do
read -p "Found existing ~/dotfiles/hypr/conf/keybindings.conf Restore? (Yy/Nn): " yn
case $yn in
[Yy]* )
cp ~/dotfiles/hypr/conf/keybindings.conf ~/dotfiles-versions/$version/hypr/conf/
echo "Restored!"
restored=1
break;;
[Nn]* )
break;;
* ) echo "Please answer yes or no.";;
esac
done
echo "Hyprland keybindings: ~/dotfiles/hypr/conf/keybindings.conf"
fi
fi
if [ $profile == "Qtile" ] || [ $profile == "All" ]; then
if [ -f ~/dotfiles/qtile/conf/keyboard.py ]; then
while true; do
read -p "Found existing ~/dotfiles/qtile/conf/keyboard.py Restore? (Yy/Nn): " yn
case $yn in
[Yy]* )
cp ~/dotfiles/qtile/conf/keyboard.py ~/dotfiles-versions/$version/qtile/conf/
echo "Restored!"
restored=1
break;;
[Nn]* )
break;;
* ) echo "Please answer yes or no.";;
esac
done
echo "Qtile keyboard layout: ~/dotfiles/qtile/conf/keyboard.py"
fi
fi
if [ $restored == 0 ]; then
echo "Restore not possible."
fi
echo ""
while true; do
read -p "Do you want to restore the files now and use it on your new installation (Yy/Nn): " yn
case $yn in
[Yy]* )
if [ -f ~/dotfiles/.bashrc ]; then
cp ~/dotfiles/.bashrc ~/dotfiles-versions/$version/
echo ".bashrc restored!"
fi
if [ $profile == "Hyprland" ] || [ $profile == "All" ]; then
if [ -f ~/dotfiles/hypr/conf/keyboard.conf ]; then
cp ~/dotfiles/hypr/conf/keyboard.conf ~/dotfiles-versions/$version/hypr/conf/
echo "Hyprland keyboard.conf restored!"
fi
if [ -f ~/dotfiles/hypr/conf/monitor.conf ]; then
cp ~/dotfiles/hypr/conf/monitor.conf ~/dotfiles-versions/$version/hypr/conf/
echo "Hyprland monitor.conf restored!"
fi
if [ -f ~/dotfiles/hypr/conf/keybindings.conf ]; then
cp ~/dotfiles/hypr/conf/keybindings.conf ~/dotfiles-versions/$version/hypr/conf/
echo "Hyprland keybindings.conf restored!"
fi
fi
if [ $profile == "Qtile" ] || [ $profile == "All" ]; then
if [ -f ~/dotfiles/qtile/conf/keyboard.py ]; then
cp ~/dotfiles/qtile/conf/keyboard.py ~/dotfiles-versions/$version/qtile/conf/
echo "Qtile keyboard.py restored!"
fi
fi
restored=1
break;;
[Nn]* )
break;;
* ) echo "Please answer yes or no.";;
esac
done
echo ""
fi