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
This commit is contained in:
HikariKnight 2024-02-11 18:30:56 +01:00 committed by GitHub
parent 9533c50809
commit 56a963ca57
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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 <option>"
echo " <option>: Specify the quick option - 'enable' or 'disable'"
echo " Use 'enable' to Enable automatic updates."
echo " Use 'disable' to Disable automatic updates."
exit 0
fi
if [ "${OPTION,,}" == "enable" ]; then
sudo systemctl enable ublue-update.timer
elif [ "${OPTION,,}" == "disable" ]; then
sudo systemctl disable ublue-update.timer
fi