Added -t flag to sshcolourterm.
authorIain Patterson <me@iain.cx>
Wed, 26 Aug 2009 10:02:26 +0000 (11:02 +0100)
committerIain Patterson <me@iain.cx>
Wed, 16 Sep 2009 15:38:21 +0000 (16:38 +0100)
Use -t to set the initial title of the terminal window.

opt/bin/sshcolourterm

index 8bae4b0..e143a75 100755 (executable)
@@ -2,6 +2,15 @@
 
 SSHCOLOURS=~/.ssh/colours
 
+while getopts ":t:" opt; do
+  case "$opt" in
+    t) title="$OPTARG";;
+  esac
+done
+shift $((OPTIND-1))
+
+[ -z "$title" ] && title="$1"
+
 fqdn=${1##*@}
 colour=
 
@@ -31,5 +40,5 @@ if [ ! -z "$colour" ]; then
 fi
 
 [ -n "$colour" ] && colour="-bg $colour"
-exec ${SSHTERM:-xterm} ${SSHTERM_TITLE:--title} "$1" \
+exec ${SSHTERM:-xterm} ${SSHTERM_TITLE:--title} "$title" \
      $colour ${SSHTERM_EXEC:--e} ${SSHTERM_SSH:-ssh} ${1+"$@"}