bin: add title
This commit is contained in:
18
bin/title
Executable file
18
bin/title
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
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"
|
||||
Reference in New Issue
Block a user