add systemd timers for periodic fixes
This commit is contained in:
@ -1,7 +1,4 @@
|
||||
#!/bin/sh
|
||||
while :; do
|
||||
rm -r ~/.themes/* 2> /dev/null
|
||||
rsync -av --progress /usr/share/themes/* ~/.themes/ --exclude Windowck
|
||||
rsync -av --progress ~/.local/share/themes/* ~/.themes/ --exclude Windowck-dark
|
||||
sleep 600
|
||||
done
|
||||
rm -r ~/.themes/* 2> /dev/null
|
||||
rsync -av --progress /usr/share/themes/* ~/.themes/ --exclude Windowck
|
||||
rsync -av --progress ~/.local/share/themes/* ~/.themes/ --exclude Windowck-dark
|
||||
|
@ -11,7 +11,6 @@ sync_theme() {
|
||||
# Apply the current theme with gsettings
|
||||
gsettings set org.gnome.desktop.interface gtk-theme "$theme"
|
||||
}
|
||||
|
||||
sync_icon_theme() {
|
||||
# Get the current icon theme
|
||||
icon_theme=$(xfconf-query -c xsettings -p /Net/IconThemeName)
|
||||
@ -20,25 +19,21 @@ sync_icon_theme() {
|
||||
sed -i "s/^icon_theme=.*$/icon_theme=$icon_theme/" "$HOME"/.config/qt6ct/qt6ct.conf
|
||||
}
|
||||
|
||||
while :; do
|
||||
# Get the current system theme
|
||||
theme_new=$(xfconf-query -c xsettings -p /Net/ThemeName)
|
||||
# Get the current icon theme
|
||||
icon_theme_new=$(xfconf-query -c xsettings -p /Net/IconThemeName)
|
||||
# Get the current font name
|
||||
font_new=$(xfconf-query -c xsettings -p /Gtk/FontName)
|
||||
# Get the current system theme
|
||||
theme_new=$(xfconf-query -c xsettings -p /Net/ThemeName)
|
||||
# Get the current icon theme
|
||||
icon_theme_new=$(xfconf-query -c xsettings -p /Net/IconThemeName)
|
||||
# Get the current font name
|
||||
font_new=$(xfconf-query -c xsettings -p /Gtk/FontName)
|
||||
|
||||
# Run sync_theme if the new system theme doesn't match the previous one
|
||||
[ "$theme_new" != "$theme_prev" ] && sync_theme
|
||||
# Run sync_icon_theme if the new icon theme doesn't match the previous one
|
||||
[ "$icon_theme_new" != "$icon_theme_prev" ] && sync_icon_theme
|
||||
# If the new font doesn't match the previous one, apply the new font for the title of xfce windows
|
||||
[ "$font_new" != "$font_prev" ] && xfconf-query -c xfwm4 -p /general/title_font -n -t string -s "$font_new"
|
||||
# Run sync_theme if the new system theme doesn't match the previous one
|
||||
[ "$theme_new" != "$theme_prev" ] && sync_theme
|
||||
# Run sync_icon_theme if the new icon theme doesn't match the previous one
|
||||
[ "$icon_theme_new" != "$icon_theme_prev" ] && sync_icon_theme
|
||||
# If the new font doesn't match the previous one, apply the new font for the title of xfce windows
|
||||
[ "$font_new" != "$font_prev" ] && xfconf-query -c xfwm4 -p /general/title_font -n -t string -s "$font_new"
|
||||
|
||||
# The new values become the previous values
|
||||
theme_prev=$theme_new
|
||||
icon_theme_prev=$icon_theme_new
|
||||
font_prev=$font_new
|
||||
|
||||
sleep 3
|
||||
done
|
||||
# The new values become the previous values
|
||||
theme_prev=$theme_new
|
||||
icon_theme_prev=$icon_theme_new
|
||||
font_prev=$font_new
|
||||
|
@ -66,24 +66,21 @@ fixfiles() {
|
||||
done
|
||||
}
|
||||
|
||||
while :; do
|
||||
user_new=$(ls -ad "$user"/*.desktop 2>/dev/null)
|
||||
flatpak_local_new=$(ls -ad "$flatpak_local"/*.desktop 2>/dev/null)
|
||||
flatpak_global_new=$(ls -ad "$flatpak_global"/*.desktop 2>/dev/null)
|
||||
pacman_local_new=$(ls -ad "$pacman_local"/*.desktop 2>/dev/null)
|
||||
pacman_global_new=$(ls -ad "$pacman_global"/*.desktop 2>/dev/null)
|
||||
snap_new=$(ls -ad "$snap"/*.desktop 2>/dev/null)
|
||||
[ "$user_new" != "$user_old" ] && detectfiles
|
||||
[ "$flatpak_local_new" != "$flatpak_local_old" ] ||
|
||||
[ "$flatpak_global_new" != "$flatpak_global_old" ] ||
|
||||
[ "$pacman_local_new" != "$pacman_local_old" ] ||
|
||||
[ "$pacman_global_new" != "$pacman_global_old" ] ||
|
||||
[ "$snap_new" != "$snap_old" ] && fixfiles
|
||||
user_old=$user_new
|
||||
flatpak_local_old=$flatpak_local_new
|
||||
flatpak_global_old=$flatpak_global_new
|
||||
pacman_local_old=$pacman_local_new
|
||||
pacman_global_old=$pacman_global_new
|
||||
snap_old=$snap_new
|
||||
sleep 5
|
||||
done
|
||||
user_new=$(ls -ad "$user"/*.desktop 2>/dev/null)
|
||||
flatpak_local_new=$(ls -ad "$flatpak_local"/*.desktop 2>/dev/null)
|
||||
flatpak_global_new=$(ls -ad "$flatpak_global"/*.desktop 2>/dev/null)
|
||||
pacman_local_new=$(ls -ad "$pacman_local"/*.desktop 2>/dev/null)
|
||||
pacman_global_new=$(ls -ad "$pacman_global"/*.desktop 2>/dev/null)
|
||||
snap_new=$(ls -ad "$snap"/*.desktop 2>/dev/null)
|
||||
[ "$user_new" != "$user_old" ] && detectfiles
|
||||
[ "$flatpak_local_new" != "$flatpak_local_old" ] ||
|
||||
[ "$flatpak_global_new" != "$flatpak_global_old" ] ||
|
||||
[ "$pacman_local_new" != "$pacman_local_old" ] ||
|
||||
[ "$pacman_global_new" != "$pacman_global_old" ] ||
|
||||
[ "$snap_new" != "$snap_old" ] && fixfiles
|
||||
user_old=$user_new
|
||||
flatpak_local_old=$flatpak_local_new
|
||||
flatpak_global_old=$flatpak_global_new
|
||||
pacman_local_old=$pacman_local_new
|
||||
pacman_global_old=$pacman_global_new
|
||||
snap_old=$snap_new
|
||||
|
Reference in New Issue
Block a user