-
Notifications
You must be signed in to change notification settings - Fork 0
/
refresh_config
executable file
·70 lines (57 loc) · 1.19 KB
/
refresh_config
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
65
66
67
68
69
#!/bin/bash
declare -a configs=(
"alacritty"
"dunst"
"flashfocus"
"nvim"
"ranger"
"rofi"
"sway"
"swaylock"
"waybar"
"zathura"
"fusuma"
"mpd"
"workstyle"
"starship.toml"
"fish"
"mythemes"
"myscripts"
"mimeapps.list"
"xournalpp"
"melonDS"
"gammastep"
)
path2="$HOME/Documents/projets/dotfiles/myconfig"
if [[ ! -e "$path2" ]]
then
echo "Le chemin "$path2" n'existe pas!!!"
exit 2
fi
echo -e "\nMise à jour des données…\n"
for config in "${configs[@]}"
do
path1="$HOME/.config/${config}"
if [[ ! -e "$path1" ]]
then
echo -e "\033[31mERREUR\033[0m Le chemin "$path1" n'existe pas!!!"
exit 1
fi
{
rsync -a --delete --exclude='.cache' "${path1}" "${path2}" &> /dev/null
echo -e "\033[32mOK\033[0m $config"
} &
done
wait
echo -e "\nVérification des contenus…\n"
for config in "${configs[@]}"
do
diff -qr "$HOME/.config/$config" "$path2/$config"
if [[ "$?" = "0" ]]
then
echo -e "\033[32mOK\033[0m ${config}"
else
echo -e "\033[31mERREUR\033[0m $config n'a pas été copié!"
fi
done
notify-send "Le refresh est terminé!"