fix: shader-cycle nutzt .active-Datei statt fragiler hyprctl-Erkennung

This commit is contained in:
2026-04-23 21:11:49 +02:00
parent d3c70b0f84
commit 0beb72ab15
2 changed files with 5 additions and 9 deletions
+4 -9
View File
@@ -1,5 +1,6 @@
#!/bin/bash
SHADER_DIR="$HOME/.config/hypr/shaders"
ACTIVE_FILE="$SHADER_DIR/.active"
mapfile -t SHADERS < <(find "$SHADER_DIR" -name "*.glsl" | sort)
@@ -7,15 +8,9 @@ if [[ ${#SHADERS[@]} -eq 0 ]]; then
exit 0
fi
CURRENT=$(hyprctl getoption decoration:screen_shader | grep "str:" | awk '{print $2}' | tr -d '"')
INDEX=-1
for i in "${!SHADERS[@]}"; do
if [[ "${SHADERS[$i]}" == "$CURRENT" ]]; then
INDEX=$i
break
fi
done
INDEX=$(cat "$ACTIVE_FILE" 2>/dev/null)
[[ "$INDEX" =~ ^[0-9]+$ ]] || INDEX=-1
NEXT=$(( (INDEX + 1) % ${#SHADERS[@]} ))
echo "$NEXT" > "$ACTIVE_FILE"
hyprshade on "${SHADERS[$NEXT]}"