X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=bin%2Fxtitle;h=9fc678e5b25e8f62ebb8096e0e0bd30028010179;hb=8eb93b531d2772fcaefd3deb830a73a24f90ee45;hp=4c1cefc987e92d09ebefa7fda5670ccac1ddc971;hpb=b0e4766f74b0e2213eadc6871f6ff8c79ed7dc07;p=dotfiles.git diff --git a/bin/xtitle b/bin/xtitle index 4c1cefc..9fc678e 100755 --- a/bin/xtitle +++ b/bin/xtitle @@ -1,17 +1,19 @@ -#! /usr/bin/env bash +#! /bin/sh 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 -ne "\033]0;${TITLE}\007" # Set xterm title + XTITLE="\033]0;${TITLE}\007" # Set xterm title/icon case "$TERM" in screen*) - echo -ne "\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