sxmo-utils/scripts/core/sxmo_terminal.sh
Stacy Harper 60dd08fa27 Fix sxmo_modemtext in terminal mode
As we rely on the terminal name to use the contextual menu, we used the
st target directly, preventing to use the taillog command in terminal
mode.

Add an optional TERMNAME env variable to manage this smoothly.

Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2021-06-21 22:59:55 +02:00

21 lines
419 B
Bash
Executable file

#!/usr/bin/env sh
# shellcheck disable=SC2086
if [ -n "$TERMNAME" ]; then
case "$TERMCMD" in
"st -e")
set -- st -T "$TERMNAME" -e "$@"
;;
*)
printf "%s: '%s'\n" "Not implemented for TERMCMD" "$TERMCMD" >&2
set -- $TERMCMD "$@"
esac
else
set -- $TERMCMD "$@"
fi
if [ -z "$*" ]; then
echo "sxmo_terminal.sh called in TERMMODE without any arguments (returning, nothing to do)" >&2
else
exec "$@"
fi