nixos-configs/sway/scripts/lose-focus.sh

17 lines
355 B
Bash
Raw Normal View History

2023-05-28 19:35:37 -04:00
#!/bin/bash
while true
do
while killall -0 blueman-manager
do
2023-05-29 13:55:08 -04:00
if [[ $(bluetoothctl show | grep Powered | grep yes) ]]; then
if [[ $(swaymsg -t get_tree | grep -B 39 blueman | grep "focused.: false") != "" ]]; then
killall blueman-manager
break
fi
sleep 0.1
2023-05-28 19:35:37 -04:00
fi
done
sleep 0.1
done