-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbackup.sh
executable file
·64 lines (45 loc) · 1.47 KB
/
backup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
script_dir="$(pwd)"
copy_item() {
if [ -e "$1" ]; then
rsync -a --delete "$1" "$2"
echo "Updated: $1"
else
echo "Not found: $1"
fi
}
# Step 1: Backup Dotfiles
echo "Backing up dotfiles..."
echo "Backup zsh configs"
copy_item "$HOME/.zshrc" "$script_dir/"
copy_item "$HOME/.zprofile" "$script_dir/"
copy_item "$HOME/.zshenv" "$script_dir/"
copy_item "$HOME/.zsh" "$script_dir/"
copy_item "$HOME/.config/zshrc.d" "$script_dir/.config/"
echo
echo "Backup Kitty config"
copy_item "$HOME/.config/kitty" "$script_dir/.config/"
echo
echo "Backup neovim"
copy_item "$HOME/.config/nvim" "$script_dir/.config/"
# Backup fastfetch conf
echo
echo "Backup fastfetch conf"
copy_item "$HOME/.fastfetch_conf.jsonc" "$script_dir/"
# Backup p10k and oh-my-zsh
copy_item "$HOME/.oh-my-zsh" "$script_dir/"
copy_item "$HOME/.p10k.zsh" "$script_dir/"
echo "Backing up yazi configs..."
copy_item "$HOME/.config/yazi" "$script_dir/.config/"
# Step 2: Backup GNOME Extensions
echo "Backing up GNOME extensions..."
gnome-extensions list > "$script_dir/gnome_extensions_list.txt"
# Step 4: Backup Fonts
echo "Backing up fonts..."
# Backup user-specific fonts
copy_item "$HOME/.local/share/fonts" "$script_dir/.local/share/"
copy_item "$HOME/.fonts" "$script_dir/"
# Step 5: Backup GNOME Tweaks Settings
echo "Backing up GNOME Tweaks settings..."
dconf dump / > "$script_dir/gnome_tweaks_settings_backup.dconf"
echo "Backup complete! Files are saved in $script_dir"