diff --git a/.config/blacklayer/event-driven.sh b/.config/blacklayer/event-driven.sh deleted file mode 100644 index 9cec962..0000000 --- a/.config/blacklayer/event-driven.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env bash -# Kullanım: event-driven.sh -MONITOR="$1" -POLL_INTERVAL="${2:-3}" # default 3s -[ -z "$MONITOR" ] && { echo "Monitor arg missing"; exit 1; } - -BLACKLAYER_BIN="$HOME/blacklayer" -STATE_DIR="$HOME/.blacklayer_state" -STATE_FILE="$STATE_DIR/$MONITOR" - -while true; do - sleep "$POLL_INTERVAL" - - JSON="$(hyprctl -j monitors 2>/dev/null)" - echo "$JSON" | jq empty >/dev/null 2>&1 || continue - - FOCUSED=$(echo "$JSON" | jq -r ".[] | select(.name==\"$MONITOR\") | .focused") - if [ "$FOCUSED" = "true" ]; then - pkill -f "$BLACKLAYER_BIN $MONITOR" >/dev/null 2>&1 - echo "false" > "$STATE_FILE" - exit 0 - fi -done