From d6eb521e0e43de7c198b167d05126946c9b56a72 Mon Sep 17 00:00:00 2001 From: Michael Vorburger Date: Sat, 14 Dec 2024 13:00:37 +0100 Subject: [PATCH] Flatpack Auto Update with systemd Timer --- dnf-install.sh | 2 ++ flatpack-install.sh | 6 ++++++ systemd/flatpak-update.service | 6 ++++++ systemd/flatpak-update.timer | 10 ++++++++++ 4 files changed, 24 insertions(+) create mode 100755 flatpack-install.sh create mode 100644 systemd/flatpak-update.service create mode 100644 systemd/flatpak-update.timer diff --git a/dnf-install.sh b/dnf-install.sh index d6b70d6..d723ff7 100755 --- a/dnf-install.sh +++ b/dnf-install.sh @@ -61,6 +61,8 @@ else echo "Not enabling dnf-automatic-install.timer, because no systemd" fi +./flatpack-install.sh + sudo dnf update -y sudo dnf remove -y "libreoffice*" diff --git a/flatpack-install.sh b/flatpack-install.sh new file mode 100755 index 0000000..e4de075 --- /dev/null +++ b/flatpack-install.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +set -euxo pipefail + +cp systemd/flatpak-update.service systemd/flatpak-update.timer ~/.config/systemd/user/ +systemctl --user enable flatpak-update.timer +systemctl --user start flatpak-update.timer diff --git a/systemd/flatpak-update.service b/systemd/flatpak-update.service new file mode 100644 index 0000000..598bbd7 --- /dev/null +++ b/systemd/flatpak-update.service @@ -0,0 +1,6 @@ +[Unit] +Description=Update Flatpak applications + +[Service] +Type=oneshot +ExecStart=/usr/bin/flatpak update -y diff --git a/systemd/flatpak-update.timer b/systemd/flatpak-update.timer new file mode 100644 index 0000000..7a24523 --- /dev/null +++ b/systemd/flatpak-update.timer @@ -0,0 +1,10 @@ +[Unit] +Description=Daily Flatpak application update + +[Timer] +# Or for a specific time: OnCalendar=*-*-* 03:00:00 +OnCalendar=daily +Persistent=true + +[Install] +WantedBy=timers.target