#!/bin/bash # Text modifiers bold=$(tput bold) # ${bold} normal=$(tput sgr0) # ${normal} yellow=$(tput setaf 3) # ${yellow} zenity --info --title='Please pick a folder!' --text='Choose a folder!' --width='300' --height='100' # Folder variable FOLDER=$(zenity --file-selection --title="Choose a backup directory" --directory) if [[ $? -eq 1 ]]; then echo You did not pick a ${bold}${yellow}folder.${normal} Exiting! exit 1 else echo Backups will be saved into: ${bold}${yellow}$FOLDER${normal} fi # Options input user_choice=$(zenity --list --checklist --width='600' --height='400' \ --title="Backup script by RavePriest1" \ --text="Select from the options below" \ --column="Select" --column="Name" \ FALSE "BACKUP All of My Data and Settings" \ FALSE "RESTORE All of My Data and Settings") if [[ $? -eq 1 ]]; then echo You did not pick an ${bold}${yellow}option.${normal} Exiting! exit 1 fi if [[ $user_choice = *"BACKUP All of My Data and Settings"* ]]; then cd echo echo ----------------------------------------------------- echo Copying ${bold}${yellow}$USER Settings and Files${normal} into ${bold}${yellow}$FOLDER/${normal} # GNOME SECTION dconf dump / > $USER-ui # HU lang #rsync -ap --info=progress2 /home/$USER/Asztal/ $FOLDER/ #rsync -ap --info=progress2 /home/$USER/Dokumentumok/ $FOLDER/ #rsync -ap --info=progress2 /home/$USER/Letöltések/ $FOLDER/ #rsync -ap --info=progress2 /home/$USER/Zenék/ $FOLDER/ #rsync -ap --info=progress2 /home/$USER/Képek/ $FOLDER/ #rsync -ap --info=progress2 /home/$USER/Videók/ $FOLDER/ # EN lang rsync -ap --info=progress2 Desktop $FOLDER 2>/dev/null rsync -ap --info=progress2 Documents $FOLDER 2>/dev/null rsync -ap --info=progress2 Downloads $FOLDER 2>/dev/null rsync -ap --info=progress2 Music $FOLDER 2>/dev/null rsync -ap --info=progress2 Pictures $FOLDER 2>/dev/null rsync -ap --info=progress2 Videos $FOLDER 2>/dev/null rsync -ap --info=progress2 /home/$USER/Games/ $FOLDER rsync -ap --info=progress2 /home/$USER/.librewolf $FOLDER mkdir -p $FOLDER/.config rsync -ap --info=progress2 /home/$USER/.config/Bitwarden $FOLDER rsync -ap --info=progress2 /home/$USER/.config/heroic $FOLDER rsync -ap --info=progress2 /home/$USER/.config/input-remapper-2 $FOLDER rsync -ap --info=progress2 /home/$USER/.config/Mumble $FOLDER rsync -ap --info=progress2 /home/$USER/.config/libvirt $FOLDER sudo rsync -ap --info=progress2 /etc/libvirt $FOLDER rsync -ap --info=progress2 /home/$USER/.config/corectrl $FOLDER rsync -ap --info=progress2 /home/$USER/.config/corectrl.ini $FOLDER rsync -ap --info=progress2 /home/$USER/.config/vivaldi $FOLDER rsync -ap --info=progress2 /home/$USER/.config/BraveSoftware $FOLDER rsync -ap --info=progress2 /home/$USER/.config/FreeTube $FOLDER rsync -ap --info=progress2 /home/$USER/.config/dosbox-x $FOLDER rsync -ap --info=progress2 /home/$USER/.config/pavucontrol.ini $FOLDER rsync -ap --info=progress2 /home/$USER/.config/keepassxc $FOLDER rsync -ap --info=progress2 /home/$USER/.config/spotify $FOLDER rsync -ap --info=progress2 /home/$USER/.config/spotube $FOLDER rsync -ap --info=progress2 /home/$USER/.config/qBittorrent $FOLDER rsync -ap --info=progress2 /home/$USER/.config/kdeglobals $FOLDER rsync -ap --info=progress2 /home/$USER/.config/kdenliverc $FOLDER rsync -ap --info=progress2 /home/$USER/.config/kdenlive-layoutsrc $FOLDER rsync -ap --info=progress2 /home/$USER/.config/Signal $FOLDER rsync -ap --info=progress2 /home/$USER/.config/discord $FOLDER rsync -ap --info=progress2 /home/$USER/.config/Vencord $FOLDER rsync -ap --info=progress2 /home/$USER/.config/goverlay $FOLDER rsync -ap --info=progress2 /home/$USER/.config/MangoHud $FOLDER rsync -ap --info=progress2 /home/$USER/.config/easyeffects $FOLDER rsync -ap --info=progress2 /home/$USER/.config/mc $FOLDER rsync -ap --info=progress2 /home/$USER/.config/doublecmd $FOLDER rsync -ap --info=progress2 /home/$USER/.config/monophony $FOLDER rsync -ap --info=progress2 /home/$USER/.config/pamac $FOLDER rsync -ap --info=progress2 /home/$USER/.config/kdeconnect $FOLDER rsync -ap --info=progress2 /home/$USER/.config/Helvum $FOLDER rsync -ap --info=progress2 /home/$USER/.config/calibre $FOLDER rsync -ap --info=progress2 /home/$USER/.config/ $FOLDER sudo rsync -ap --info=progress2 /home/$USER/.local/share/gnome-shell $FOLDER sudo rsync -ap --info=progress2 /home/$USER/.local/share/flatpak/overrides/ $FOLDER/.local/share/flatpak/ sudo rsync -ap --info=progress2 /home/$USER/.local/share/lutris $FOLDER/.local/share/ sudo rsync -ap --info=progress2 /home/$USER/.local/share/TelegramDesktop $FOLDER/.local/share/ rsync -ap --info=progress2 /home/$USER/.steam/ $FOLDER/ rsync -ap --info=progress2 /home/$USER/.var/app/ $FOLDER/.var/app/ sudo rsync -ap --info=progress2 /usr/share/jellyfin/web/config.json $FOLDER/ konsave -s raveui-kde -f rsync -ap --info=progress2 /home/$USER/.config/konsave $FOLDER/.config/ rsync -ap --info=progress2 /home/$USER/.local/state/dolphinstaterc $FOLDER/.local/state/ echo ${bold}${yellow}$USER settings copied. ${normal} echo ----------------------------------------------------- sudo chown -R $USER:$GROUP $FOLDER echo fi if [[ $user_choice = *"Restore all of my data and settings"* ]]; then echo echo ----------------------------------------------------- echo Copying ${bold}${yellow}Restoring $USER Settings and Files ${normal} into ${bold}${yellow}$FOLDER/${normal} rsync -ap --info=progress2 $FOLDER /home/$USER/ sudo rsync -ap --info=progress2 $FOLDER/etc/libvirt /etc/ sudo rsync -ap --info=progress2 $FOLDER/usr/share/jellyfin/web/config.json /usr/share/jellyfin/web/ dconf load / < $FOLDER/$USER-ui konsave -a raveui-kde echo ----------------------------------------------------- sudo chown -R $USER:$GROUP /home/$USER/ echo echo ${bold}${yellow}$USER settings RESTORED! ${normal} fi exit