From c5c5537873c7ba6c8a8af0169c8f875f6140fc5e Mon Sep 17 00:00:00 2001 From: Stacy Harper Date: Sun, 6 Jun 2021 09:20:50 +0200 Subject: [PATCH] Do not enforce -e TERMCMD args and fix TERMMODE Enforcing -e break some possibilities to use TERMCMD that dont use it. TERMCMD should be setup in xinit. This way, in ssh mode, the value still is empty. This way, some custom bash or tmux config could use it, configuring it. --- configs/appcfg/xinit_template | 2 ++ scripts/core/sxmo_terminal.sh | 14 ++------------ 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/configs/appcfg/xinit_template b/configs/appcfg/xinit_template index c497864..9694094 100644 --- a/configs/appcfg/xinit_template +++ b/configs/appcfg/xinit_template @@ -52,6 +52,8 @@ command -v firefox && export BROWSER=firefox #(useful for getting notifications) #export SXMO_RTCWAKEINTERVAL=300 +export TERMCMD="st -e" + # Immediately turn the screen off when locking the device export SXMO_LOCK_SCREEN_OFF=1 diff --git a/scripts/core/sxmo_terminal.sh b/scripts/core/sxmo_terminal.sh index b169ead..bba64a8 100755 --- a/scripts/core/sxmo_terminal.sh +++ b/scripts/core/sxmo_terminal.sh @@ -1,17 +1,7 @@ #!/usr/bin/env sh -# You can export a different terminal in your xinit -TERMCMD="${TERMCMD:-st}" -TERMMODE=$([ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ] && echo "true") - -if [ "$TERMMODE" = "true" ]; then - while [ "-e" != "$1" ] || [ 0 -eq $# ]; do - shift - done - shift -else - set -- "$TERMCMD" -e "$@" -fi +# shellcheck disable=SC2086 +set -- $TERMCMD "$@" if [ -z "$*" ]; then echo "sxmo_terminal.sh called in TERMMODE without any arguments (returning, nothing to do)" >&2