sxmo-utils/scripts/core/sxmo_dmenu_with_kb.sh
Stacy Harper 7ac78f8272 sxmo_dmenu_with_kb should exit the dmenu exit code
Some script could behave differently if the dmenu has been killed with a
swipe up gesture. We have to return the dmenu exit code.

Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2021-04-23 19:16:32 +02:00

15 lines
339 B
Bash
Executable file

#!/usr/bin/env sh
TERMMODE=$([ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ] && echo "true")
if [ "$TERMMODE" = "true" ]; then
exec vis-menu -i -l 10
fi
wasopen="$(sxmo_keyboard.sh isopen && echo "yes")"
sxmo_keyboard.sh open
OUTPUT="$(cat | dmenu "$@")"
exitcode=$?
[ -z "$wasopen" ] && sxmo_keyboard.sh close
echo "$OUTPUT"
exit $exitcode