diff options
Diffstat (limited to 'config/hypr/scripts/Refresh.sh')
| -rwxr-xr-x | config/hypr/scripts/Refresh.sh | 17 |
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 |
