dotfiles/eggs/utility/util-scripts/kill-on-unfocus.sh
2025-05-19 16:47:38 +02:00

14 lines
254 B
Bash
Executable File

#!/usr/bin/env bash
"$@" &
pid=$!
sleep 0.5
window_title="$(hyprctl activewindow -j | jq ".title")"
sleep 0.5
while true; do
if [ "$(hyprctl activewindow -j | jq ".title")" != "$window_title" ]; then
kill $pid
break
fi
sleep 1;
done