summaryrefslogtreecommitdiff
path: root/auto-update.sh
diff options
context:
space:
mode:
authorlittleblack111 <jerrylam110209@gmail.com>2023-05-08 19:51:52 +0800
committerlittleblack111 <jerrylam110209@gmail.com>2023-05-08 19:51:52 +0800
commit34583a789996bba782a09ccb3158b4369883d1d2 (patch)
tree91d1a5c9aa683f63e2213f39c4fc1fed68208a94 /auto-update.sh
parent07f25053110f57c176c97b78c426071a74533c91 (diff)
update
Diffstat (limited to 'auto-update.sh')
-rwxr-xr-xauto-update.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/auto-update.sh b/auto-update.sh
new file mode 100755
index 0000000..f4afce1
--- /dev/null
+++ b/auto-update.sh
@@ -0,0 +1,13 @@
+#!/usr/bin/env bash
+
+
+while true; do
+ if [[ "$(systemctl is-system-running)" == "running" ]]; 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 & 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