From 468475dc49e3185b3f2de75f970e0bbf7106f107 Mon Sep 17 00:00:00 2001 From: wxf Date: Fri, 1 Jan 2016 15:36:50 +0800 Subject: [PATCH 1/3] add personal theme --- themes/morris/morris.theme.bash | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 themes/morris/morris.theme.bash diff --git a/themes/morris/morris.theme.bash b/themes/morris/morris.theme.bash new file mode 100644 index 00000000..27571bde --- /dev/null +++ b/themes/morris/morris.theme.bash @@ -0,0 +1,25 @@ + +# prompt theming + +# added TITLEBAR for updating the tab and window titles with the pwd +case $TERM in + xterm*) + TITLEBAR="\[\033]0;\w\007\]" + ;; + *) + TITLEBAR="" + ;; +esac + +function prompt_command() { + PS1="${TITLEBAR}[\u@\h \W $(scm_prompt_info)]\$ " +} + +# scm theming +SCM_THEME_PROMPT_DIRTY=" ${red}✗" +SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓" +SCM_THEME_PROMPT_PREFIX="${green}(" +SCM_THEME_PROMPT_SUFFIX="${green})${reset_color}" + + +PROMPT_COMMAND=prompt_command; From 56fdb6333c513ebb836c3ad0e9256396efa4822c Mon Sep 17 00:00:00 2001 From: wxf Date: Fri, 1 Jan 2016 15:46:53 +0800 Subject: [PATCH 2/3] support system completion --- completion/available/system.completion.bash | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 completion/available/system.completion.bash diff --git a/completion/available/system.completion.bash b/completion/available/system.completion.bash new file mode 100644 index 00000000..b13121d7 --- /dev/null +++ b/completion/available/system.completion.bash @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +if [ -f /etc/bash_completion ]; + . /etc/bash_completion +fi From 9cb4ae0650441c844ec4408578ad36b1028cb4a7 Mon Sep 17 00:00:00 2001 From: wxf Date: Fri, 1 Jan 2016 16:29:26 +0800 Subject: [PATCH 3/3] add host info in titlebar --- themes/morris/morris.theme.bash | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/themes/morris/morris.theme.bash b/themes/morris/morris.theme.bash index 27571bde..da51e55a 100644 --- a/themes/morris/morris.theme.bash +++ b/themes/morris/morris.theme.bash @@ -4,11 +4,14 @@ # added TITLEBAR for updating the tab and window titles with the pwd case $TERM in xterm*) - TITLEBAR="\[\033]0;\w\007\]" - ;; + TITLEBAR=$(printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}") + ;; + screen) + TITLEBAR=$(printf "\033]0;%s@%s:%s\033\\" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}") + ;; *) - TITLEBAR="" - ;; + TITLEBAR="" + ;; esac function prompt_command() {