first check-in of feisty meow codebase. many things broken still due to recent
[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 pruned_host=$(echo $HOSTNAME | sed -e 's/^\([^\.]*\)\..*$/\1/')
7 date_string=$(date +"%Y %b %e @ %T")
8
9 user=$USER
10 if [ -z "$user" ]; then
11   # try snagging the windoze name.
12   user=$USERNAME
13 fi
14
15 new_title="-- $user@$pruned_host -- [$date_string]"
16
17 bash "$SHELLDIR/tty/set_term_title.sh" "$new_title"