fixes-package/bin/periodic/fix-flatpaks-theming

31 lines
709 B
Plaintext
Raw Normal View History

#!/bin/bash
# Set the directories
shared\_themes\_dir=/usr/share/themes/
local\_themes\_dir="$HOME/.themes/"
# Function to synchronize themes from shared to local directory
sync\_themes() {
rsync -av --delete --progress "$shared\_themes\_dir" "$local\_themes\_dir"
echo "Directory $local\_themes\_dir is synchronized with $shared\_themes\_dir"
}
# Initial synchronization
sync\_themes
# Function to monitor both shared and local themes directories
monitor\_themes() {
inotifywait -m -r -e modify,attrib,move,move\_self,create,delete,delete\_self,unmount "$shared\_themes\_dir" "$local\_themes\_dir" |
while read -r events; do
sync\_themes
2022-10-01 16:30:00 +00:00
done
}
# Start monitoring in the background
monitor\_themes