summaryrefslogtreecommitdiff
path: root/auto-update.sh.old
blob: 1a8e24073f2a07e056eead447d350d8389c4b743 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/env bash


while true; do
    if [[ "$(systemctl is-system-running)" == "running" || "$(systemctl is-system-running)" == "degraded" ]]; then
        if [[ "$(xprintidle)" -gt 600000 ]]; then  # Changed from 600000 (10 minutes) to 3600000 (1 hour)
            #sudo #exec sudo /usr/bin/reflector @/etc/xdg/reflector/reflector.conf &
            notify-send "Auto-Updater" "Update in progress, please don't poweroff the computer" && sudo npm update -g & nix-env -u & brew update & yay -Sl > /tmp/yaySl & yay -Syu --noconfirm --disable-download-timeout && flatpak update -y && notify-send -u low "Auto-Updater" "Update Successfully!" && echo \#sleep 3600 || notify-send -u critical "Auto-Updater" "Update Faild!" # pipx upgrade-all
        else
            sleep 60
        fi
    fi
done