wrapped use of xprop with a check that it exists.
authorChris Koeritz <fred@gruntose.com>
Wed, 31 Aug 2016 12:57:15 +0000 (08:57 -0400)
committerChris Koeritz <fred@gruntose.com>
Wed, 31 Aug 2016 12:57:15 +0000 (08:57 -0400)
customizing/fred/scripts/ssh.sh

index 13d57fa3cfceea4126362bc2ef8bdec961fcc7df..4d006037ecf7dc91e89e80cc270681e0b9873c76 100644 (file)
@@ -6,8 +6,11 @@ source "$FEISTY_MEOW_LOADING_DOCK/custom/scripts/pick_credentials.sh"
 
 # save the former terminal title if we're running in X with xterm.
 prior_title=
-if [ "$TERM" == "xterm" ]; then
-  prior_title="$(xprop -id $WINDOWID | perl -nle 'print $1 if /^WM_NAME.+= \"(.*)\"$/')"
+which xprop &>/dev/null
+if [ $? -eq 0 ]; then
+  if [ "$TERM" == "xterm" ]; then
+    prior_title="$(xprop -id $WINDOWID | perl -nle 'print $1 if /^WM_NAME.+= \"(.*)\"$/')"
+  fi
 fi
 
 # force the TERM variable to a more generic version for other side.