add close wofi when loose focus

This commit is contained in:
Hadi
2025-03-05 13:28:01 +01:00
parent 2ec4583391
commit 87c6166bf7

View File

@@ -14,13 +14,18 @@ let
if pgrep wofi; then
pkill wofi
else
wofi -p " Apps" --show drun
wofi -p " Apps" --show drun &
# Quit when not focused anymore
sleep 0.2
while true; do
window=$(hyprctl activewindow | grep "wofi")
if [[ ! $window ]]; then
pkill wofi
break
fi
sleep 0.2
done
fi
# if pgrep tofi; then
# pkill tofi
# else
# tofi-drun --drun-launch=true
# fi
'';
powermenu = pkgs.writeShellScriptBin "powermenu"