Skip to content

Commit

Permalink
fix: add back ujust toggle-updates (#759)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
HikariKnight authored Feb 11, 2024
1 parent 9533c50 commit 56a963c
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions system_files/desktop/shared/usr/share/ublue-os/just/10-update.just
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 56a963c

Please sign in to comment.