From 34583a789996bba782a09ccb3158b4369883d1d2 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Mon, 8 May 2023 19:51:52 +0800 Subject: update --- auto-update.sh | 13 +++++++++++++ reflector.sh | 6 ------ shutdownsound.sh | 2 ++ startupsound.sh | 2 ++ 4 files changed, 17 insertions(+), 6 deletions(-) create mode 100755 auto-update.sh delete mode 100755 reflector.sh create mode 100755 shutdownsound.sh create mode 100755 startupsound.sh 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 -- cgit v1.2.3