From 3c5a85a9a12d5d023c2a93fd4efb56fcaae5f4bf Mon Sep 17 00:00:00 2001 From: Miles Alan Date: Tue, 16 Jun 2020 22:30:14 -0500 Subject: [PATCH] Add windowify toggle to the in call menu --- scripts/modem/sxmo_modemcall.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/scripts/modem/sxmo_modemcall.sh b/scripts/modem/sxmo_modemcall.sh index 4c88be7..0b107d7 100755 --- a/scripts/modem/sxmo_modemcall.sh +++ b/scripts/modem/sxmo_modemcall.sh @@ -109,10 +109,19 @@ hangup() { exit 1 } +togglewindowify() { + if [ "$WINDOWIFIED" = "0" ]; then + WINDOWIFIED=1 + else + WINDOWIFIED=0 + fi +} + incallmenu() { DMENUIDX=0 VID="$1" NUMBER="$(vid_to_number "$VID")" + WINDOWIFIED=0 # E.g. There's some bug with the modem that' requires us to toggle the # DAI a few times before starting the call for it to kick in @@ -135,7 +144,7 @@ incallmenu() { Speakerphone $(echo -- "$FLAGS" | grep -q -- -s && echo ✓) ^ toggleflagset -s DTMF Tones ^ dtmfmenu $VID Hangup ^ hangup $VID - Lock Screen ^ sh -c 'pkill -9 lisgd; sxmo_screenlock; lisgd &' + $([ "$WINDOWIFIED" = 0 ] && echo Windowify || echo Unwindowify) ^ togglewindowify " PICKED="" @@ -145,7 +154,7 @@ incallmenu() { cut -d'^' -f1 | sed '/^[[:space:]]*$/d' | awk '{$1=$1};1' | - dmenu -idx $DMENUIDX -l 14 -c -fn "Terminus-30" -p "$NUMBER" + dmenu -idx $DMENUIDX -l 14 $([ "$WINDOWIFIED" = 0 ] && echo "-c" || echo "-wm") -fn "Terminus-30" -p "$NUMBER" ) # E.g. in modem watcher script we just kill dmenu if the other side hangsup