19 lines
407 B
Bash
Executable File
19 lines
407 B
Bash
Executable File
#!/usr/bin/env bash
|
|
if [ "$1" == "" ] ; then
|
|
if [ "$STY" != "" ] ; then
|
|
item=$(echo $STY | sed -e 's/^[0-9]*\.//')
|
|
elif [ "$TMUX" != "" ] ; then
|
|
item=$(tmux display-message -p "#S")
|
|
else
|
|
item="${USER}@$(hostname -s)"
|
|
fi
|
|
else
|
|
if [ "$1" == "-d" ] ; then
|
|
item="$(basename $(pwd))"
|
|
else
|
|
item=$1
|
|
shift
|
|
fi
|
|
fi
|
|
echo -ne "\033]0;$item\007"
|