2022-09-19 12:09:49 +00:00
|
|
|
#!/bin/bash
|
2022-09-18 21:44:59 +00:00
|
|
|
shared_themes_dir=/usr/share/themes/
|
|
|
|
home_local_themes_dir="$HOME/.local/share/themes/"
|
2022-09-19 12:09:49 +00:00
|
|
|
source_theme_dirs=("$shared_themes_dir" "$home_local_themes_dir")
|
2022-09-18 21:44:59 +00:00
|
|
|
target_themes_dir="$HOME/.themes"
|
|
|
|
|
2022-10-01 16:30:00 +00:00
|
|
|
mkdir -p "$target_themes_dir" "$home_local_themes_dir" ||
|
|
|
|
{ echo "failed to make directoris $target_themes_dir & $home_local_themes_dir"; exit 1; }
|
2022-09-30 23:46:59 +00:00
|
|
|
|
2022-09-19 12:09:49 +00:00
|
|
|
echo "Set watch for" "${source_theme_dirs[@]}" "directories ..."
|
2023-08-03 21:09:23 +00:00
|
|
|
inotifywait -qmr -e 'modify,attrib,move,move_self,create,delete,delete_self,unmount' "${source_theme_dirs[@]}" | while read -r events; do
|
2022-10-01 16:30:00 +00:00
|
|
|
rsync -av --delete --progress "${source_theme_dirs[@]}" "$target_themes_dir"
|
|
|
|
echo "Directory $target_themes_dir is synchronized with" "${source_theme_dirs[@]}"
|
|
|
|
done
|