From 798d51d4a8fedfdaf55305f64c97ce0aa31c5ad3 Mon Sep 17 00:00:00 2001 From: Chris Koeritz Date: Mon, 23 Mar 2015 10:57:12 -0400 Subject: [PATCH] improvement for the setting back to previous window title, where we now check that DISPLAY is set, since xprop will not have any answers for us otherwise. might should check that this is running in an xterm too, but for my usage it's always the case... --- customizing/fred/scripts/ssh.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/customizing/fred/scripts/ssh.sh b/customizing/fred/scripts/ssh.sh index 90b0a567..660071ec 100755 --- a/customizing/fred/scripts/ssh.sh +++ b/customizing/fred/scripts/ssh.sh @@ -5,7 +5,10 @@ source "$FEISTY_MEOW_GENERATED/custom/scripts/pick_credentials.sh" # save the former terminal title if we're running in X. -prior_title="$(xprop -id $WINDOWID | perl -nle 'print $1 if /^WM_NAME.+= \"(.*)\"$/')" +prior_title= +if [ ! -z "$DISPLAY" ]; then + prior_title="$(xprop -id $WINDOWID | perl -nle 'print $1 if /^WM_NAME.+= \"(.*)\"$/')" +fi if [ ! -z "$keyfile" ]; then \ssh -i "$keyfile" -X -C -c blowfish-cbc $* -- 2.34.1