Add X-terminal title setting with .bashrc.d/70title from Gentoo's /etc/bash/bashrc.
authorW. Trevor King <wking@drexel.edu>
Thu, 1 Dec 2011 12:06:26 +0000 (07:06 -0500)
committerW. Trevor King <wking@drexel.edu>
Thu, 1 Dec 2011 12:06:26 +0000 (07:06 -0500)
src/.bashrc.d/70title [new file with mode: 0644]

diff --git a/src/.bashrc.d/70title b/src/.bashrc.d/70title
new file mode 100644 (file)
index 0000000..b6f5814
--- /dev/null
@@ -0,0 +1,11 @@
+if [ "${OS}" != 'Gentoo' ] && [ "${OS}" != 'Gentoo Prefix' ]; then
+       # Change the window title of X terminals 
+       case ${TERM} in
+               xterm*|rxvt*|Eterm|aterm|kterm|gnome*|interix)
+                       PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}\007"'
+                       ;;
+               screen)
+                       PROMPT_COMMAND='echo -ne "\033_${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}\033\\"'
+                       ;;
+       esac
+fi