Krolyxon
Commit 75735c9

Branches

Refs →

aurora.localbinhyprhypr_shader_menu.sh

31 lines · 708 B · Bourne Again Shell (bash)

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