From 8258eaf1d1618754e91ae14a8bf144c3ee767bcd Mon Sep 17 00:00:00 2001 From: eSh Date: Sun, 18 Sep 2022 17:29:15 +0200 Subject: [PATCH 1/2] add systemd services to run fixes --- PKGBUILD | 9 +++++++-- fixes-package.install | 14 ++++++++++++++ systemd/services/fix-flatpaks-theming.service | 12 ++++++++++++ systemd/services/fix-theming.service | 12 ++++++++++++ systemd/services/fix-tweaked-desktop-files.service | 12 ++++++++++++ 5 files changed, 57 insertions(+), 2 deletions(-) create mode 100644 fixes-package.install create mode 100644 systemd/services/fix-flatpaks-theming.service create mode 100644 systemd/services/fix-theming.service create mode 100644 systemd/services/fix-tweaked-desktop-files.service diff --git a/PKGBUILD b/PKGBUILD index 08e9001..cd9cde6 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,6 +1,6 @@ # Maintainer: TROM pkgname=tromjaro-fixes -pkgver=1.1.1 +pkgver=1.2.0 pkgrel=1 pkgdesc="Various fixes for TROMjaro OS" arch=(any) @@ -12,9 +12,10 @@ depends=('xfce4-appfinder' provides=('tromjaro-fixes') backup=() options=(!strip) +install='fixes-package.install' prepare() { - cp -R ../bin ../flatpak-overrides ../alpm-hooks . + cp -R ../bin ../flatpak-overrides ../alpm-hooks ../systemd . } package() { @@ -30,4 +31,8 @@ package() { # copy flatpak overrides install -d ${pkgdir}/var/lib/flatpak/overrides install -Dm644 ${srcdir}/flatpak-overrides/* ${pkgdir}/var/lib/flatpak/overrides + + # copy systemd units + install -d ${pkgdir}/usr/lib/systemd/user + install -Dm644 ${srcdir}/systemd/services/* ${pkgdir}/usr/lib/systemd/user } diff --git a/fixes-package.install b/fixes-package.install new file mode 100644 index 0000000..b4200c4 --- /dev/null +++ b/fixes-package.install @@ -0,0 +1,14 @@ +post_install() { + find /usr/lib/systemd/user/ -name "fix-*.service" -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 + 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 + echo "Warning: A restart is required to take effect" +} diff --git a/systemd/services/fix-flatpaks-theming.service b/systemd/services/fix-flatpaks-theming.service new file mode 100644 index 0000000..12ec3c8 --- /dev/null +++ b/systemd/services/fix-flatpaks-theming.service @@ -0,0 +1,12 @@ +# This service unit is for fix-flatpaks-theming script +# + +[Unit] +Description=Fix flatpak theming script + +[Service] +Type=simple +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 new file mode 100644 index 0000000..676cfa3 --- /dev/null +++ b/systemd/services/fix-theming.service @@ -0,0 +1,12 @@ +# This service unit is for fix-theming script +# + +[Unit] +Description=Fix theming script + +[Service] +Type=simple +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 new file mode 100644 index 0000000..66a997d --- /dev/null +++ b/systemd/services/fix-tweaked-desktop-files.service @@ -0,0 +1,12 @@ +# This service unit is for fix-tweaked-desktop-files script +# + +[Unit] +Description=Fix tweaked desktop files script + +[Service] +Type=simple +ExecStart=/usr/bin/fix-tweaked-desktop-files + +[Install] +WantedBy=multi-user.target -- 2.30.2 From eadb766da59d78ce032673fc096288119c7390f7 Mon Sep 17 00:00:00 2001 From: eSh Date: Sun, 18 Sep 2022 17:54:56 +0200 Subject: [PATCH 2/2] add default targets to user services --- systemd/services/fix-flatpaks-theming.service | 5 ++++- systemd/services/fix-theming.service | 5 ++++- systemd/services/fix-tweaked-desktop-files.service | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/systemd/services/fix-flatpaks-theming.service b/systemd/services/fix-flatpaks-theming.service index 12ec3c8..703891c 100644 --- a/systemd/services/fix-flatpaks-theming.service +++ b/systemd/services/fix-flatpaks-theming.service @@ -3,10 +3,13 @@ [Unit] Description=Fix flatpak theming script +StartLimitIntervalSec=0 [Service] Type=simple +Restart=always +RestartSec=1 ExecStart=/usr/bin/fix-flatpaks-theming [Install] -WantedBy=multi-user.target +WantedBy=default.target diff --git a/systemd/services/fix-theming.service b/systemd/services/fix-theming.service index 676cfa3..9560510 100644 --- a/systemd/services/fix-theming.service +++ b/systemd/services/fix-theming.service @@ -3,10 +3,13 @@ [Unit] Description=Fix theming script +StartLimitIntervalSec=0 [Service] Type=simple +Restart=always +RestartSec=1 ExecStart=/usr/bin/fix-theming [Install] -WantedBy=multi-user.target +WantedBy=default.target diff --git a/systemd/services/fix-tweaked-desktop-files.service b/systemd/services/fix-tweaked-desktop-files.service index 66a997d..150d057 100644 --- a/systemd/services/fix-tweaked-desktop-files.service +++ b/systemd/services/fix-tweaked-desktop-files.service @@ -3,10 +3,13 @@ [Unit] Description=Fix tweaked desktop files script +StartLimitIntervalSec=0 [Service] Type=simple +Restart=always +RestartSec=1 ExecStart=/usr/bin/fix-tweaked-desktop-files [Install] -WantedBy=multi-user.target +WantedBy=default.target -- 2.30.2