From 56a963ca572c5949d7ce2fcc84b320f6a8987355 Mon Sep 17 00:00:00 2001 From: HikariKnight <2557889+HikariKnight@users.noreply.github.com> Date: Sun, 11 Feb 2024 18:30:56 +0100 Subject: [PATCH] fix: add back ujust toggle-updates (#759) * fix: add back toggle-updates switching to topgrade removed it * chore: remove flatpak-system-update.timer section of the recipe dont think it is needed when we use topgrade --- .../usr/share/ublue-os/just/10-update.just | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/system_files/desktop/shared/usr/share/ublue-os/just/10-update.just b/system_files/desktop/shared/usr/share/ublue-os/just/10-update.just index 4285503b..85483dcb 100644 --- a/system_files/desktop/shared/usr/share/ublue-os/just/10-update.just +++ b/system_files/desktop/shared/usr/share/ublue-os/just/10-update.just @@ -6,3 +6,31 @@ alias upgrade := update update: #!/usr/bin/bash /usr/bin/topgrade --config /usr/share/ublue-os/topgrade.toml --keep + +alias auto-update := toggle-updates + +# Turn automatic updates on or off +toggle-updates ACTION="prompt": + #!/usr/bin/bash + source /usr/lib/ujust/ujust.sh + CURRENT_STATE="Disabled" + if systemctl is-enabled ublue-update.timer | grep -q enabled; then + CURRENT_STATE="Enabled" + fi + OPTION={{ ACTION }} + if [ "$OPTION" == "prompt" ]; then + echo "Automatic updates are currently: ${bold}${CURRENT_STATE}${normal}" + echo "Enable or Disable automatic updates?" + OPTION=$(ugum choose Enable Disable) + elif [ "$OPTION" == "help" ]; then + echo "Usage: ujust toggle-updates