fixes-package/bin/periodic/fix-flatpaks-theming
2023-08-03 23:09:23 +02:00

15 lines
721 B
Bash
Executable File

#!/bin/bash
shared_themes_dir=/usr/share/themes/
home_local_themes_dir="$HOME/.local/share/themes/"
source_theme_dirs=("$shared_themes_dir" "$home_local_themes_dir")
target_themes_dir="$HOME/.themes"
mkdir -p "$target_themes_dir" "$home_local_themes_dir" ||
{ echo "failed to make directoris $target_themes_dir & $home_local_themes_dir"; exit 1; }
echo "Set watch for" "${source_theme_dirs[@]}" "directories ..."
inotifywait -qmr -e 'modify,attrib,move,move_self,create,delete,delete_self,unmount' "${source_theme_dirs[@]}" | while read -r events; do
rsync -av --delete --progress "${source_theme_dirs[@]}" "$target_themes_dir"
echo "Directory $target_themes_dir is synchronized with" "${source_theme_dirs[@]}"
done