| 1 | #!/usr/bin/env bash |
| 2 | set -euo pipefail |
| 3 | |
| 4 | # Check deps |
| 5 | command -v aurora-run >/dev/null || { echo "aurora-run not found"; exit 1; } |
| 6 | command -v hyprshade >/dev/null || { echo "hyprshade not found"; exit 1; } |
| 7 | |
| 8 | # Get shader list |
| 9 | mapfile -t SHADERS < <(hyprshade ls) |
| 10 | |
| 11 | # Add "off" at top |
| 12 | SHADERS=("off" "${SHADERS[@]}") |
| 13 | |
| 14 | # Show in aurora's runner (|| true: cancelling must not trip set -e) |
| 15 | CHOICE=$(printf "%s\n" "${SHADERS[@]}" \ |
| 16 | | { aurora-run --dmenu --prompt "Hyprshade > " || true; } \ |
| 17 | | sed 's/^[[:space:]]*//;s/[[:space:]]*$//') |
| 18 | |
| 19 | # User cancelled |
| 20 | [[ -z "$CHOICE" ]] && exit 0 |
| 21 | |
| 22 | # Apply |
| 23 | if [[ "$CHOICE" == "off" ]]; then |
| 24 | hyprshade off |
| 25 | else |
| 26 | hyprshade on "$CHOICE" |
| 27 | fi |
| 28 | |
| 29 | # Optional notification |
| 30 | command -v notify-send >/dev/null && notify-send "Hyprshade" "Applied: $CHOICE" |
| 31 | |