From c086caa833f0a51a2897a45284c592af1013f064 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Sun, 28 May 2023 14:48:54 +0800 Subject: update --- auto-update.sh | 14 -------------- auto-update.sh.old | 13 +++++++++++++ idle.sh | 13 +++++++++++++ logs/backgroundblur.log | 15 +++++++++++++++ logs/wallpapertrans.log | 8 ++++++++ runbgblur.sh | 5 +++-- runtransani.sh | 2 +- update.sh | 3 +++ 8 files changed, 56 insertions(+), 17 deletions(-) delete mode 100755 auto-update.sh create mode 100755 auto-update.sh.old create mode 100755 idle.sh create mode 100644 logs/backgroundblur.log create mode 100644 logs/wallpapertrans.log create mode 100755 update.sh diff --git a/auto-update.sh b/auto-update.sh deleted file mode 100755 index a2b6581..0000000 --- a/auto-update.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/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 & - touch /home/system/updated-via-auto-update - 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 diff --git a/auto-update.sh.old b/auto-update.sh.old new file mode 100755 index 0000000..1a8e240 --- /dev/null +++ b/auto-update.sh.old @@ -0,0 +1,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 diff --git a/idle.sh b/idle.sh new file mode 100755 index 0000000..7202fd7 --- /dev/null +++ b/idle.sh @@ -0,0 +1,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) + exec $HOME/scripts/auto-update.sh & + killall picom; bspcomp & + else + sleep 60 + fi + fi +done diff --git a/logs/backgroundblur.log b/logs/backgroundblur.log new file mode 100644 index 0000000..6117c4c --- /dev/null +++ b/logs/backgroundblur.log @@ -0,0 +1,15 @@ +脚本启动于 2023-05-28 13:57:19+08:00 [COMMAND="/home/system/.config/bspwm/scripts/backgroundblur -i '/home/system/Pictures/wallpapers/jrajala_steam_fog.jpg' " TERM="alacritty" TTY="/dev/pts/1" COLUMNS="88" LINES="24"] +[2023-05-28T13:57:19+0800]: /home/system/Pictures/wallpapers/jrajala_steam_fog.jpg +[2023-05-28T13:57:19+0800]: /home/system/.cache/wallblur +[2023-05-28T13:57:20+0800]: Display resolution is: 1920x1080 +[2023-05-28T13:57:20+0800]: Wallpaper resolution is: 7952x5304 +[2023-05-28T13:57:20+0800]: Scaling wallpaper to match resolution +[2023-05-28T13:57:20+0800]: > Generating jrajala_steam_fog0.jpg +[2023-05-28T13:57:20+0800]: > Generating jrajala_steam_fog1.jpg +[2023-05-28T13:57:21+0800]: > Generating jrajala_steam_fog2.jpg +[2023-05-28T13:57:21+0800]: > Generating jrajala_steam_fog3.jpg +[2023-05-28T13:57:21+0800]: > Generating jrajala_steam_fog4.jpg +[2023-05-28T13:57:21+0800]: > Generating jrajala_steam_fog5.jpg +[2023-05-28T13:57:21+0800]: ! Blurring +^C +脚本完成于 2023-05-28 13:57:23+08:00 [COMMAND_EXIT_CODE="130"] diff --git a/logs/wallpapertrans.log b/logs/wallpapertrans.log new file mode 100644 index 0000000..aee5143 --- /dev/null +++ b/logs/wallpapertrans.log @@ -0,0 +1,8 @@ +脚本启动于 2023-05-28 13:57:43+08:00 [COMMAND="/home/system/.config/bspwm/scripts/wallpapertrans.sh" ] +0 + +脚本完成于 2023-05-28 13:57:46+08:00 [COMMAND_EXIT_CODE="0"] +脚本启动于 2023-05-28 14:27:46+08:00 [COMMAND="/home/system/.config/bspwm/scripts/wallpapertrans.sh" ] +0 + +脚本完成于 2023-05-28 14:27:50+08:00 [COMMAND_EXIT_CODE="0"] diff --git a/runbgblur.sh b/runbgblur.sh index 26ad5bd..8671c24 100755 --- a/runbgblur.sh +++ b/runbgblur.sh @@ -2,8 +2,9 @@ while true; do pkill -f backgroundblur - wallpaper="$(find /home/system/Pictures/wallpapers -type f -name '*.jpg' -o -name '*.png' | shuf -n 1)" + wallpaper="$(find /home/system/Pictures/wallpapers -type f -name '*.jpg' -o -name '*.png' | shuf -n 1)" feh --bg-fill "$wallpaper" & - $HOME/.config/bspwm/scripts/backgroundblur -i "$wallpaper" & + #script -c "$HOME/.config/bspwm/scripts/backgroundblur -i '$wallpaper' " -a ~/scripts/logs/backgroundblur.log --force & + $HOME/.config/bspwm/scripts/backgroundblur -i '$wallpaper' sleep 1800 done diff --git a/runtransani.sh b/runtransani.sh index 2420580..b803641 100755 --- a/runtransani.sh +++ b/runtransani.sh @@ -3,7 +3,7 @@ while true; do #wallpaper="$(find /home/system/Pictures/wallpapers -type f -name '*.jpg' -o -name '*.png' | shuf -n 1)" #cp $wallpaper $HOME/.wallpaper/old.jpg - $HOME/.config/bspwm/scripts/wallpapertrans.sh + script -c "$HOME/.config/bspwm/scripts/wallpapertrans.sh" $HOME/scripts/logs/wallpapertrans.log -a --force #feh --bg-fill $wallpaper # restart sleep 1800 diff --git a/update.sh b/update.sh new file mode 100755 index 0000000..7100644 --- /dev/null +++ b/update.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +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 -- cgit v1.2.3