modified the heading.
[feisty_meow.git] / scripts / tty / label_terminal_with_infos.sh
1 #!/bin/bash
2
3 # this script makes a new title for the terminal window that matches the
4 # hostname and some other details.
5
6 source $FEISTY_MEOW_SCRIPTS/core/functions.sh
7
8 pruned_host=$(echo $HOSTNAME | sed -e 's/^\([^\.]*\)\..*$/\1/')
9 date_string=$(date +"%Y %b %e @ %T")
10
11 user=$USER
12 if [ -z "$user" ]; then
13   # try snagging the windoze name.
14   user=$USERNAME
15 fi
16
17 new_title="-- $user@$pruned_host -- [$date_string]"
18
19 bash "$FEISTY_MEOW_SCRIPTS/tty/set_term_title.sh" "$new_title"