X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=bin%2Fxtitle;h=9fc678e5b25e8f62ebb8096e0e0bd30028010179;hb=10ed04ab0d9665c425dc9878b46fd47d75b2d50a;hp=f734659d5a4a9ea7d7f7f5e03b7adeeb4cb7068c;hpb=2e129db7ad4c65020d1c7ff56d19bf6c4d7bfcaa;p=dotfiles.git diff --git a/bin/xtitle b/bin/xtitle index f734659..9fc678e 100755 --- a/bin/xtitle +++ b/bin/xtitle @@ -3,15 +3,17 @@ case "$TERM" in *rxvt*|screen*|*term*|vt100) if [ -z "$1" ]; then - TITLE="${USER}@${HOSTNAME}:$(echo ${PWD} | sed -e "s|^${HOME}|~|")" + TITLE="${USER}@`hostname`:$(echo ${PWD} | sed -e "s|^${HOME}|~|")" else TITLE="$@" fi - echo -n "\033]0;${TITLE}\007" # Set xterm title + XTITLE="\033]0;${TITLE}\007" # Set xterm title/icon case "$TERM" in screen*) - echo -n "\033k${TITLE}\033\\" # Set screen/tmux caption + XTITLE="\033P${XTITLE}\033\\\\" # Set xterm title/icon under screen/tmux + XTITLE="${XTITLE}\033k${TITLE}\033\\\\" # Set screen/tmux caption ;; esac + echo -n "$XTITLE" ;; esac