Added -t flag to sshcolourterm.
[profile.git] / 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+"$@"}