3 Commits

Author SHA1 Message Date
bd11ec4837 add icon sync for flatpaks 2023-08-04 00:24:40 +02:00
b6f7ffccba Update PKGBUILD 2023-08-03 23:11:35 +02:00
3c16633482 improvements from roko 2023-08-03 23:09:23 +02:00
2 changed files with 22 additions and 21 deletions

@ -1,7 +1,7 @@
# Maintainer: TROM <contact@tromsite.com>
pkgname=tromjaro-fixes
pkgver=1.6
pkgrel=0
pkgrel=1
pkgdesc="Various fixes for TROMjaro OS"
arch=(any)
url=""

@ -1,30 +1,31 @@
#!/bin/bash
# Set the directories
# Set the directory paths
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"
shared\_themes\_dir=/usr/share/themes/
local\_themes\_dir="$HOME/.themes/"
shared_icons_dir=/usr/share/icons/
home_local_icons_dir="$HOME/.local/share/icons/"
source_icon_dirs=("$shared_icons_dir" "$home_local_icons_dir")
target_icons_dir="$HOME/.icons"
# 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"
# Function to synchronize themes and icons from source to target directory
sync_themes_and_icons() {
rsync -av --delete --progress "${source_theme_dirs[@]}" "$target_themes_dir"
rsync -av --delete --progress "${source_icon_dirs[@]}" "$target_icons_dir"
echo "Directories $target_themes_dir and $target_icons_dir are synchronized with source directories"
}
# Initial synchronization
# Create the target and local directories if they don't exist
mkdir -p "$target_themes_dir" "$home_local_themes_dir" "$target_icons_dir" "$home_local_icons_dir" ||
{ echo "failed to make directories $target_themes_dir & $home_local_themes_dir & $target_icons_dir & $home_local_icons_dir"; exit 1; }
sync\_themes
echo "Set watch for theme directories: ${source_theme_dirs[@]}, and icon directories: ${source_icon_dirs[@]}"
# 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" |
# Start watching for file changes in the source theme and icon directories
inotifywait -qmr -e 'modify,attrib,move,move_self,create,delete,delete_self,unmount' "${source_theme_dirs[@]}" "${source_icon_dirs[@]}" |
while read -r events; do
sync\_themes
sync_themes_and_icons
done
}
# Start monitoring in the background
monitor\_themes