summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlittleblack111 <jerrylam110209@gmail.com>2023-03-13 21:31:41 +0800
committerlittleblack111 <jerrylam110209@gmail.com>2023-03-13 21:31:41 +0800
commita6cc1090eefaa1943101e9623f210ed78846e957 (patch)
treee147e9f41a67860abd6e7b36ad065c0cc157bf6e
parent46ba941d0e3df93c243429551bd5101b0c1c172e (diff)
update
-rwxr-xr-xbackgroundblur5
-rwxr-xr-xinstallplugin7
-rw-r--r--preventsystemfreeze.sh21
-rwxr-xr-xrandomimage.sh3
-rwxr-xr-xrunbgblur.sh11
5 files changed, 39 insertions, 8 deletions
diff --git a/backgroundblur b/backgroundblur
deleted file mode 100755
index b14a566..0000000
--- a/backgroundblur
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-while true; do
- $HOME/.config/bspwm/scripts/backgroundblur -i $(shuf -n 1 -e $(find /home/system/Pictures/wallpapers) | head -n 1) &
- sleep 1800
-done
diff --git a/installplugin b/installplugin
new file mode 100755
index 0000000..56d62e7
--- /dev/null
+++ b/installplugin
@@ -0,0 +1,7 @@
+#!/usr/bin/env bash
+
+if [ -e "$1" ]; then
+ cp $1 "$HOME/Games/Minecraft-Server/MCDReforged/server/plugins/" && rm "$1" && echo "Install Successed!"
+else
+ echo "$1: file does not exist"
+fi
diff --git a/preventsystemfreeze.sh b/preventsystemfreeze.sh
new file mode 100644
index 0000000..d674356
--- /dev/null
+++ b/preventsystemfreeze.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+# Maximum CPU temperature in degrees Celsius
+MAX_TEMP=180
+
+# Maximum time in seconds that the system can be frozen
+MAX_FROZEN_TIME=300
+
+# Check the CPU temperature
+TEMP=$(sensors | grep 'Core 0:' | awk '{print $3}' | cut -c2-3)
+if [ $TEMP -ge $MAX_TEMP ]; then
+ echo "CPU temperature is too high. Rebooting..."
+ /sbin/reboot
+fi
+
+# Check if the system is frozen
+LAST_LOAD=$(uptime | awk '{print $NF}')
+if [ $LAST_LOAD -gt $MAX_FROZEN_TIME ]; then
+ echo "System is frozen. Rebooting..."
+ /sbin/reboot
+fi
diff --git a/randomimage.sh b/randomimage.sh
deleted file mode 100755
index bb18b7e..0000000
--- a/randomimage.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-# Select a random file name from the list
-random_file=$(shuf -n 1 -e $(find /home/system/Pictures/wallpapers) | head -n 1)
-echo $random_file
diff --git a/runbgblur.sh b/runbgblur.sh
new file mode 100755
index 0000000..66b8974
--- /dev/null
+++ b/runbgblur.sh
@@ -0,0 +1,11 @@
+#!/usr/bin/zsh
+
+kill -SIGTERM $(pgrep runbgblur.sh)
+
+while true; do
+ pkill -f backgroundblur
+ 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" &
+ sleep 1800
+done