summaryrefslogtreecommitdiff
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
parent07f25053110f57c176c97b78c426071a74533c91 (diff)
update
-rwxr-xr-xauto-update.sh13
-rwxr-xr-xreflector.sh6
-rwxr-xr-xshutdownsound.sh2
-rwxr-xr-xstartupsound.sh2
4 files changed, 17 insertions, 6 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
diff --git a/reflector.sh b/reflector.sh
deleted file mode 100755
index c99ab8c..0000000
--- a/reflector.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/usr/bin/bash
-while true; do
- #sudo #exec sudo /usr/bin/reflector @/etc/xdg/reflector/reflector.conf &
- sudo npm update -g & pipx upgrade-all & nix-env -u & yay -Syu --noconfirm --disable-download-timeout && flatpak update -y
- sleep 1080
-done
diff --git a/shutdownsound.sh b/shutdownsound.sh
new file mode 100755
index 0000000..d57c391
--- /dev/null
+++ b/shutdownsound.sh
@@ -0,0 +1,2 @@
+#!/bin/bash
+/usr/bin/mpg123 /home/system/.local/share/sounds/win11shutdown.mp3
diff --git a/startupsound.sh b/startupsound.sh
new file mode 100755
index 0000000..26bfa94
--- /dev/null
+++ b/startupsound.sh
@@ -0,0 +1,2 @@
+#!/bin/bash
+/usr/bin/mpg123 /home/system/.local/share/sounds/win11startup.mp3