Add systemd timers to run the fixes periodically #3
1
PKGBUILD
1
PKGBUILD
|
@ -35,4 +35,5 @@ package() {
|
|||
# copy systemd units
|
||||
install -d ${pkgdir}/usr/lib/systemd/user
|
||||
install -Dm644 ${srcdir}/systemd/services/* ${pkgdir}/usr/lib/systemd/user
|
||||
install -Dm644 ${srcdir}/systemd/timers/* ${pkgdir}/usr/lib/systemd/user
|
||||
}
|
||||
|
|
|
@ -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
|
|
@ -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,7 +19,6 @@ 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
|
||||
|
@ -39,6 +37,3 @@ while :; do
|
|||
theme_prev=$theme_new
|
||||
icon_theme_prev=$icon_theme_new
|
||||
font_prev=$font_new
|
||||
|
||||
sleep 3
|
||||
done
|
||||
|
|
|
@ -66,7 +66,6 @@ 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)
|
||||
|
@ -85,5 +84,3 @@ while :; do
|
|||
pacman_local_old=$pacman_local_new
|
||||
pacman_global_old=$pacman_global_new
|
||||
snap_old=$snap_new
|
||||
sleep 5
|
||||
done
|
|
@ -1,14 +1,14 @@
|
|||
post_install() {
|
||||
find /usr/lib/systemd/user/ -name "fix-*.service" -type f -printf "%f\0" | xargs -0 systemctl --global enable
|
||||
find /usr/lib/systemd/user/ -name "fix-*.timer" -type f -printf "%f\0" | xargs -0 systemctl --global enable
|
||||
echo "Warning: A restart is required to take effect"
|
||||
}
|
||||
|
||||
post_upgrade() {
|
||||
find /usr/lib/systemd/user/ -name "fix-*.service" -type f -printf "%f\0" | xargs -0 systemctl --global enable
|
||||
find /usr/lib/systemd/user/ -name "fix-*.timer" -type f -printf "%f\0" | xargs -0 systemctl --global enable
|
||||
echo "Warning: A restart is required to take effect"
|
||||
}
|
||||
|
||||
pre_remove() {
|
||||
find /usr/lib/systemd/user/ -name "fix-*.service" -type f -printf "%f\0" | xargs -0 systemctl --global disable
|
||||
find /usr/lib/systemd/user/ -name "fix-*.timer" -type f -printf "%f\0" | xargs -0 systemctl --global disable
|
||||
echo "Warning: A restart is required to take effect"
|
||||
}
|
||||
|
|
|
@ -3,12 +3,10 @@
|
|||
|
||||
[Unit]
|
||||
Description=Fix flatpak theming script
|
||||
StartLimitIntervalSec=0
|
||||
Wants=fix-flatpaks-theming.timer
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Restart=always
|
||||
RestartSec=1
|
||||
Type=oneshot
|
||||
ExecStart=/usr/bin/fix-flatpaks-theming
|
||||
|
||||
[Install]
|
||||
|
|
|
@ -3,12 +3,10 @@
|
|||
|
||||
[Unit]
|
||||
Description=Fix theming script
|
||||
StartLimitIntervalSec=0
|
||||
Wants=fix-theming.timer
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Restart=always
|
||||
RestartSec=1
|
||||
Type=oneshot
|
||||
ExecStart=/usr/bin/fix-theming
|
||||
|
||||
[Install]
|
||||
|
|
|
@ -3,12 +3,10 @@
|
|||
|
||||
[Unit]
|
||||
Description=Fix tweaked desktop files script
|
||||
StartLimitIntervalSec=0
|
||||
Wants=fix-tweaked-desktop-files.timer
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Restart=always
|
||||
RestartSec=1
|
||||
Type=oneshot
|
||||
ExecStart=/usr/bin/fix-tweaked-desktop-files
|
||||
|
||||
[Install]
|
||||
|
|
14
systemd/timers/fix-flatpaks-theming.timer
Normal file
14
systemd/timers/fix-flatpaks-theming.timer
Normal file
|
@ -0,0 +1,14 @@
|
|||
# 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
|
15
systemd/timers/fix-theming.timer
Normal file
15
systemd/timers/fix-theming.timer
Normal file
|
@ -0,0 +1,15 @@
|
|||
# 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
|
||||
AccuracySec=1us
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
15
systemd/timers/fix-tweaked-desktop-files.timer
Normal file
15
systemd/timers/fix-tweaked-desktop-files.timer
Normal file
|
@ -0,0 +1,15 @@
|
|||
# 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=fix-tweaked-desktop-files.service
|
||||
OnBootSec=1
|
||||
OnUnitActiveSec=5
|
||||
AccuracySec=1us
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
Loading…
Reference in New Issue
Block a user