Merge pull request 'Create symlink instead of copying directory' (#25) from rokosun-patch-1 into main

Reviewed-on: #25
This commit is contained in:
Tio TROM 2023-10-15 23:44:19 +02:00
commit de69301c82
1 changed files with 4 additions and 6 deletions

View File

@ -162,8 +162,8 @@ sync_theme() {
[ "$current_window_scaling" -eq '2' ] && use_hdpi_theme_variant 'disable_notification' [ "$current_window_scaling" -eq '2' ] && use_hdpi_theme_variant 'disable_notification'
fi fi
# Cleanup flatpak_themes_dir and ~/.config/gtk-4.0 # Cleanup flatpak_themes_dir and remove ~/.config/gtk-4.0
rm -rf "${flatpak_themes_dir:?}"/{*,.*} "$config_dir/gtk-4.0"/{*,.*} rm -rf "${flatpak_themes_dir:?}"/{*,.*} "$config_dir/gtk-4.0"
# Find the directory where the current theme is stored # Find the directory where the current theme is stored
local -r current_theme_dir=$(xdg_directory_lookup "themes/$current_theme") local -r current_theme_dir=$(xdg_directory_lookup "themes/$current_theme")
@ -171,10 +171,8 @@ sync_theme() {
if [ -d "$current_theme_dir" ]; then if [ -d "$current_theme_dir" ]; then
# Copy/sync current_theme_dir to flatpak_themes_dir # Copy/sync current_theme_dir to flatpak_themes_dir
rsync -av --delete --progress "$current_theme_dir" "$flatpak_themes_dir" rsync -av --delete --progress "$current_theme_dir" "$flatpak_themes_dir"
local -r current_theme_gtk4_dir="$current_theme_dir/gtk-4.0" # Create symlink for gtk-4.0 directory
[ -d "$current_theme_gtk4_dir" ] && ln -s "$current_theme_dir/gtk-4.0" "$config_dir"
# Copy/sync current_theme_gtk4_dir to config_dir
rsync -av --delete --progress "$current_theme_gtk4_dir" "$config_dir"
fi fi
} }