aboutsummaryrefslogtreecommitdiffstats
path: root/config/hypr/scripts/Refresh.sh
diff options
context:
space:
mode:
Diffstat (limited to 'config/hypr/scripts/Refresh.sh')
-rwxr-xr-xconfig/hypr/scripts/Refresh.sh17
1 files changed, 14 insertions, 3 deletions
diff --git a/config/hypr/scripts/Refresh.sh b/config/hypr/scripts/Refresh.sh
index 311d0a8c..a35b735a 100755
--- a/config/hypr/scripts/Refresh.sh
+++ b/config/hypr/scripts/Refresh.sh
@@ -84,10 +84,21 @@ swaync >/dev/null 2>&1 &
# reload swaync
swaync-client --reload-config
-# Relaunching rainbow borders if the script exists
+# Relaunching rainbow borders based on selected mode
sleep 1
-if file_exists "${UserScripts}/RainbowBorders.sh"; then
- ${UserScripts}/RainbowBorders.sh &
+rainbow_mode_file="${UserScripts}/rainbow-borders.mode"
+rainbow_mode=""
+if [[ -f "$rainbow_mode_file" ]]; then
+ rainbow_mode="$(tr -d '[:space:]' <"$rainbow_mode_file")"
+fi
+if [[ "$rainbow_mode" == "low_cpu" ]]; then
+ pkill -f 'RainbowBorders-low-cpu\.sh' >/dev/null 2>&1 || true
+ rm -f /tmp/hypr-rainbowborders.lock >/dev/null 2>&1 || true
+ if file_exists "${UserScripts}/RainbowBorders-low-cpu.sh"; then
+ "${UserScripts}/RainbowBorders-low-cpu.sh" >/dev/null 2>&1 &
+ fi
+elif file_exists "${UserScripts}/RainbowBorders.sh"; then
+ "${UserScripts}/RainbowBorders.sh" &
fi
exit 0
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage