From f44f9dbc00814b996431512b2b0b1046cccb3989 Mon Sep 17 00:00:00 2001 From: eSh Date: Fri, 16 Sep 2022 03:31:21 +0200 Subject: [PATCH] initial commit --- PKGBUILD | 8 +--- bin/periodic/fix-flatpaks-theming | 9 +++-- bin/periodic/fix-theming | 27 +++++++------ bin/periodic/fix-tweaked-desktop-files | 39 ++++++++++--------- fixes-package.install | 3 -- systemd/services/fix-flatpaks-theming.service | 13 ------- systemd/services/fix-theming.service | 13 ------- .../fix-tweaked-desktop-files.service | 13 ------- systemd/timers/fix-flatpaks-theming.timer | 14 ------- systemd/timers/fix-theming.timer | 14 ------- .../timers/fix-tweaked-desktop-files.timer | 14 ------- 11 files changed, 44 insertions(+), 123 deletions(-) delete mode 100644 fixes-package.install delete mode 100644 systemd/services/fix-flatpaks-theming.service delete mode 100644 systemd/services/fix-theming.service delete mode 100644 systemd/services/fix-tweaked-desktop-files.service delete mode 100644 systemd/timers/fix-flatpaks-theming.timer delete mode 100644 systemd/timers/fix-theming.timer delete mode 100644 systemd/timers/fix-tweaked-desktop-files.timer diff --git a/PKGBUILD b/PKGBUILD index 329b393..fa22def 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -10,10 +10,9 @@ depends=() provides=('tromjaro-fixes') backup=() options=(!strip) -install='fixes-package.install' prepare() { - cp -R ../bin ../flatpak-overrides ../alpm-hooks ../systemd . + cp -R ../bin ../flatpak-overrides ../alpm-hooks . } package() { @@ -22,11 +21,6 @@ package() { install -Dm755 ${srcdir}/bin/standalone/* ${pkgdir}/usr/bin install -Dm755 ${srcdir}/bin/periodic/* ${pkgdir}/usr/bin - # copy systemd units - install -d ${pkgdir}/usr/lib/systemd/system - install -Dm644 ${srcdir}/systemd/services/* ${pkgdir}/usr/lib/systemd/system - install -Dm644 ${srcdir}/systemd/timers/* ${pkgdir}/usr/lib/systemd/system - # copy alpm hooks install -d ${pkgdir}/usr/share/libalpm/hooks install -Dm644 ${srcdir}/alpm-hooks/* ${pkgdir}/usr/share/libalpm/hooks diff --git a/bin/periodic/fix-flatpaks-theming b/bin/periodic/fix-flatpaks-theming index d0e973c..c4ab141 100755 --- a/bin/periodic/fix-flatpaks-theming +++ b/bin/periodic/fix-flatpaks-theming @@ -1,4 +1,7 @@ #!/bin/sh -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 +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 \ No newline at end of file diff --git a/bin/periodic/fix-theming b/bin/periodic/fix-theming index 6ca6ff0..bed9078 100755 --- a/bin/periodic/fix-theming +++ b/bin/periodic/fix-theming @@ -11,6 +11,7 @@ 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) @@ -19,16 +20,20 @@ sync_icon_theme() { sed -i "s/^icon_theme=.*$/icon_theme=$icon_theme/" "$HOME"/.config/qt6ct/qt6ct.conf } -# 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) +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) -# 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 + # 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 -# The new values become the previous values -theme_prev=$theme_new -icon_theme_prev=$icon_theme_new + # The new values become the previous values + theme_prev=$theme_new + icon_theme_prev=$icon_theme_new + + sleep 3 +done diff --git a/bin/periodic/fix-tweaked-desktop-files b/bin/periodic/fix-tweaked-desktop-files index 9ebc42f..f9bc687 100755 --- a/bin/periodic/fix-tweaked-desktop-files +++ b/bin/periodic/fix-tweaked-desktop-files @@ -66,21 +66,24 @@ fixfiles() { 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 +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 \ No newline at end of file diff --git a/fixes-package.install b/fixes-package.install deleted file mode 100644 index 5febd7f..0000000 --- a/fixes-package.install +++ /dev/null @@ -1,3 +0,0 @@ -post_install() { - systemctl enable fix-*.timer -} diff --git a/systemd/services/fix-flatpaks-theming.service b/systemd/services/fix-flatpaks-theming.service deleted file mode 100644 index e144dc8..0000000 --- a/systemd/services/fix-flatpaks-theming.service +++ /dev/null @@ -1,13 +0,0 @@ -# This service unit is for fix-flatpaks-theming script -# - -[Unit] -Description=Fix flatpak theming script -Wants=fix-flatpaks-theming.timer - -[Service] -Type=oneshot -ExecStart=/usr/bin/fix-flatpaks-theming - -[Install] -WantedBy=multi-user.target diff --git a/systemd/services/fix-theming.service b/systemd/services/fix-theming.service deleted file mode 100644 index c82d37a..0000000 --- a/systemd/services/fix-theming.service +++ /dev/null @@ -1,13 +0,0 @@ -# This service unit is for fix-theming script -# - -[Unit] -Description=Fix theming script -Wants=fix-theming.timer - -[Service] -Type=oneshot -ExecStart=/usr/bin/fix-theming - -[Install] -WantedBy=multi-user.target diff --git a/systemd/services/fix-tweaked-desktop-files.service b/systemd/services/fix-tweaked-desktop-files.service deleted file mode 100644 index 5fc7195..0000000 --- a/systemd/services/fix-tweaked-desktop-files.service +++ /dev/null @@ -1,13 +0,0 @@ -# This service unit is for fix-tweaked-desktop-files script -# - -[Unit] -Description=Fix tweaked desktop files script -Wants=fix-tweaked-desktop-files.timer - -[Service] -Type=oneshot -ExecStart=/usr/bin/fix-tweaked-desktop-files - -[Install] -WantedBy=multi-user.target diff --git a/systemd/timers/fix-flatpaks-theming.timer b/systemd/timers/fix-flatpaks-theming.timer deleted file mode 100644 index 614059c..0000000 --- a/systemd/timers/fix-flatpaks-theming.timer +++ /dev/null @@ -1,14 +0,0 @@ -# This timer unit is for fix-flatpaks-theming service unit -# - -[Unit] -Description=Run fix flatpaks theming script every 600 seconds -Requires=fix-flatpaks-theming.service - -[Timer] -Unit=fix-flatpaks-theming.service -OnBootSec=1 -OnUnitActiveSec=600 - -[Install] -WantedBy=timers.target \ No newline at end of file diff --git a/systemd/timers/fix-theming.timer b/systemd/timers/fix-theming.timer deleted file mode 100644 index 7dd921f..0000000 --- a/systemd/timers/fix-theming.timer +++ /dev/null @@ -1,14 +0,0 @@ -# This timer unit is for fix-theming service unit -# - -[Unit] -Description=Run fix theming script every 3 seconds -Requires=fix-theming.service - -[Timer] -Unit=fix-theming.service -OnBootSec=1 -OnUnitActiveSec=3 - -[Install] -WantedBy=timers.target \ No newline at end of file diff --git a/systemd/timers/fix-tweaked-desktop-files.timer b/systemd/timers/fix-tweaked-desktop-files.timer deleted file mode 100644 index 675a196..0000000 --- a/systemd/timers/fix-tweaked-desktop-files.timer +++ /dev/null @@ -1,14 +0,0 @@ -# This timer unit is for fix-tweaked-desktop-files service unit -# - -[Unit] -Description=Run fix tweaked desktop files script every 5 seconds -Requires=fix-tweaked-desktop-files.service - -[Timer] -Unit=ffix-tweaked-desktop-files.service -OnBootSec=1 -OnUnitActiveSec=5 - -[Install] -WantedBy=timers.target \ No newline at end of file