Skip to content

Commit

Permalink
Flatpack Auto Update with systemd Timer
Browse files Browse the repository at this point in the history
  • Loading branch information
vorburger committed Dec 14, 2024
1 parent 61d24ff commit d6eb521
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dnf-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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*"
Expand Down
6 changes: 6 additions & 0 deletions flatpack-install.sh
Original file line number Diff line number Diff line change
@@ -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
6 changes: 6 additions & 0 deletions systemd/flatpak-update.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[Unit]
Description=Update Flatpak applications

[Service]
Type=oneshot
ExecStart=/usr/bin/flatpak update -y
10 changes: 10 additions & 0 deletions systemd/flatpak-update.timer
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit d6eb521

Please sign in to comment.