17 lines
388 B
Bash
Executable File
17 lines
388 B
Bash
Executable File
#!/bin/bash
|
|
SHADER_DIR="$HOME/.config/hypr/shaders"
|
|
ACTIVE_FILE="$SHADER_DIR/.active"
|
|
|
|
mapfile -t SHADERS < <(find "$SHADER_DIR" -name "*.glsl" | sort)
|
|
|
|
if [[ ${#SHADERS[@]} -eq 0 ]]; then
|
|
exit 0
|
|
fi
|
|
|
|
INDEX=$(cat "$ACTIVE_FILE" 2>/dev/null)
|
|
[[ "$INDEX" =~ ^[0-9]+$ ]] || INDEX=-1
|
|
|
|
NEXT=$(( (INDEX + 1) % ${#SHADERS[@]} ))
|
|
echo "$NEXT" > "$ACTIVE_FILE"
|
|
hyprshade on "${SHADERS[$NEXT]}"
|