diff --git a/system_files/usr/share/ublue-os/just/10-update.just b/system_files/usr/share/ublue-os/just/10-update.just index a3ad345..65b534b 100644 --- a/system_files/usr/share/ublue-os/just/10-update.just +++ b/system_files/usr/share/ublue-os/just/10-update.just @@ -1,2 +1,40 @@ +# vim: set ft=make : + +alias upgrade := update + update: pkexec uupd --log-level debug + +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