suspend: block if Dino is in a call

this is technically overbroad, in that it blocks whenever Dino is
outputting audio, but in practice that's precise enough & Dino doesn't
expose any API to detect calls specifically.

Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
This commit is contained in:
2023-10-08 01:30:34 +00:00
committed by Maarten van Gompel
parent 05fd5112d5
commit b579015748

View File

@@ -47,6 +47,10 @@ in_call() {
pgrep -f sxmo_modemcall.sh
}
in_call_dino() {
command -v pw-link && [ -n "$(pw-link -o Dino)" ]
}
hotspot_active() {
nmcli -t c show --active | grep -q ^Hotspot
}
@@ -82,6 +86,7 @@ while [ "$waited" != "0" ]; do
waited=0
wait_item suspend_disabled
wait_item in_call
wait_item in_call_dino
wait_item hotspot_active
wait_item ssh_connected
wait_item active_mosh