From d1c62cacf4a74005f23d5fe33bf8292904906fe6 Mon Sep 17 00:00:00 2001 From: Calvin Giles Date: Wed, 28 Aug 2013 23:46:47 +0100 Subject: [PATCH 01/10] Added calvin theme --- themes/calvin/calvin.theme.bash | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 themes/calvin/calvin.theme.bash diff --git a/themes/calvin/calvin.theme.bash b/themes/calvin/calvin.theme.bash new file mode 100644 index 00000000..d2399509 --- /dev/null +++ b/themes/calvin/calvin.theme.bash @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +SCM_NONE_CHAR='' +SCM_THEME_PROMPT_DIRTY=" ${red}✗" +SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓" +SCM_THEME_PROMPT_PREFIX=" ${reset_color}|$(scm_char) " +SCM_THEME_PROMPT_SUFFIX="${reset_color}|" + + +RVM_THEME_PROMPT_PREFIX="|" +RVM_THEME_PROMPT_SUFFIX="|" + +function prompt_command() { + #PS1="${bold_cyan}$(scm_char)${green}$(scm_prompt_info)${purple}$(ruby_version_prompt) ${yellow}\h ${reset_color}in ${green}\w ${reset_color}\n${green}→${reset_color} " + PS1="${yellow}$(ruby_version_prompt) ${purple}\u@\h${reset_color}:\W${bold_cyan}${green}$(scm_prompt_info)${reset_color}\$ " +} + +PROMPT_COMMAND=prompt_command; From 89738ffa3015ca6702cd78ad691f057b939318bc Mon Sep 17 00:00:00 2001 From: Calvin Giles Date: Wed, 28 Aug 2013 23:47:53 +0100 Subject: [PATCH 02/10] Added reset_color --- themes/calvin/calvin.theme.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/calvin/calvin.theme.bash b/themes/calvin/calvin.theme.bash index d2399509..80df0bfb 100644 --- a/themes/calvin/calvin.theme.bash +++ b/themes/calvin/calvin.theme.bash @@ -11,7 +11,7 @@ RVM_THEME_PROMPT_SUFFIX="|" function prompt_command() { #PS1="${bold_cyan}$(scm_char)${green}$(scm_prompt_info)${purple}$(ruby_version_prompt) ${yellow}\h ${reset_color}in ${green}\w ${reset_color}\n${green}→${reset_color} " - PS1="${yellow}$(ruby_version_prompt) ${purple}\u@\h${reset_color}:\W${bold_cyan}${green}$(scm_prompt_info)${reset_color}\$ " + PS1="${yellow}$(ruby_version_prompt) ${purple}\u@\h${reset_color}:\W${bold_cyan}${green}$(scm_prompt_info)${reset_color}${reset_color}\$ " } PROMPT_COMMAND=prompt_command; From c8d59b08c32d8462c270a417bc7b5a669604b6b6 Mon Sep 17 00:00:00 2001 From: Calvin Giles Date: Wed, 28 Aug 2013 23:49:00 +0100 Subject: [PATCH 03/10] Added reset_color --- themes/calvin/calvin.theme.bash | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/themes/calvin/calvin.theme.bash b/themes/calvin/calvin.theme.bash index 80df0bfb..fdb8c647 100644 --- a/themes/calvin/calvin.theme.bash +++ b/themes/calvin/calvin.theme.bash @@ -1,9 +1,9 @@ #!/usr/bin/env bash SCM_NONE_CHAR='' -SCM_THEME_PROMPT_DIRTY=" ${red}✗" -SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓" +SCM_THEME_PROMPT_DIRTY=" ${red}✗${reset_color}" +SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓${reset_color}" SCM_THEME_PROMPT_PREFIX=" ${reset_color}|$(scm_char) " -SCM_THEME_PROMPT_SUFFIX="${reset_color}|" +SCM_THEME_PROMPT_SUFFIX="${reset_color}|${reset_color}" RVM_THEME_PROMPT_PREFIX="|" From 85ed37ceaf6a47db76b3f7e7f3a6a6fc66c96c8d Mon Sep 17 00:00:00 2001 From: Calvin Giles Date: Wed, 28 Aug 2013 23:51:02 +0100 Subject: [PATCH 04/10] Added reset_color --- themes/calvin/calvin.theme.bash | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/themes/calvin/calvin.theme.bash b/themes/calvin/calvin.theme.bash index fdb8c647..cc809eeb 100644 --- a/themes/calvin/calvin.theme.bash +++ b/themes/calvin/calvin.theme.bash @@ -5,6 +5,10 @@ SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓${reset_color}" SCM_THEME_PROMPT_PREFIX=" ${reset_color}|$(scm_char) " SCM_THEME_PROMPT_SUFFIX="${reset_color}|${reset_color}" +GIT_THEME_PROMPT_DIRTY=" ${red}✗" +GIT_THEME_PROMPT_CLEAN=" ${bold_green}✓" +GIT_THEME_PROMPT_PREFIX=" ${green}|" +GIT_THEME_PROMPT_SUFFIX="${reset_color}|${reset_color}" RVM_THEME_PROMPT_PREFIX="|" RVM_THEME_PROMPT_SUFFIX="|" From 53c2f447a26226301a93d7e80d5ef9b14423f198 Mon Sep 17 00:00:00 2001 From: Calvin Giles Date: Wed, 28 Aug 2013 23:51:35 +0100 Subject: [PATCH 05/10] Added reset_color --- themes/calvin/calvin.theme.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/calvin/calvin.theme.bash b/themes/calvin/calvin.theme.bash index cc809eeb..64170d60 100644 --- a/themes/calvin/calvin.theme.bash +++ b/themes/calvin/calvin.theme.bash @@ -7,7 +7,7 @@ SCM_THEME_PROMPT_SUFFIX="${reset_color}|${reset_color}" GIT_THEME_PROMPT_DIRTY=" ${red}✗" GIT_THEME_PROMPT_CLEAN=" ${bold_green}✓" -GIT_THEME_PROMPT_PREFIX=" ${green}|" +GIT_THEME_PROMPT_PREFIX=" ${reset_color}|$(scm_char) " GIT_THEME_PROMPT_SUFFIX="${reset_color}|${reset_color}" RVM_THEME_PROMPT_PREFIX="|" From 8045c4cc155024528752b3ce79009d3dc02c1eba Mon Sep 17 00:00:00 2001 From: Calvin Giles Date: Wed, 28 Aug 2013 23:52:18 +0100 Subject: [PATCH 06/10] Removed scm_info --- themes/calvin/calvin.theme.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/calvin/calvin.theme.bash b/themes/calvin/calvin.theme.bash index 64170d60..fc6bdc3d 100644 --- a/themes/calvin/calvin.theme.bash +++ b/themes/calvin/calvin.theme.bash @@ -15,7 +15,7 @@ RVM_THEME_PROMPT_SUFFIX="|" function prompt_command() { #PS1="${bold_cyan}$(scm_char)${green}$(scm_prompt_info)${purple}$(ruby_version_prompt) ${yellow}\h ${reset_color}in ${green}\w ${reset_color}\n${green}→${reset_color} " - PS1="${yellow}$(ruby_version_prompt) ${purple}\u@\h${reset_color}:\W${bold_cyan}${green}$(scm_prompt_info)${reset_color}${reset_color}\$ " + PS1="${yellow}$(ruby_version_prompt) ${purple}\u@\h${reset_color}:\W${bold_cyan}${green}${reset_color}${reset_color}\$ " } PROMPT_COMMAND=prompt_command; From 587fd1a1effdf266b113333a778a6a7ff987d0c9 Mon Sep 17 00:00:00 2001 From: Calvin Giles Date: Wed, 28 Aug 2013 23:53:13 +0100 Subject: [PATCH 07/10] Temporrily switched back to bobby theme --- themes/calvin/calvin.theme.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/calvin/calvin.theme.bash b/themes/calvin/calvin.theme.bash index fc6bdc3d..64170d60 100644 --- a/themes/calvin/calvin.theme.bash +++ b/themes/calvin/calvin.theme.bash @@ -15,7 +15,7 @@ RVM_THEME_PROMPT_SUFFIX="|" function prompt_command() { #PS1="${bold_cyan}$(scm_char)${green}$(scm_prompt_info)${purple}$(ruby_version_prompt) ${yellow}\h ${reset_color}in ${green}\w ${reset_color}\n${green}→${reset_color} " - PS1="${yellow}$(ruby_version_prompt) ${purple}\u@\h${reset_color}:\W${bold_cyan}${green}${reset_color}${reset_color}\$ " + PS1="${yellow}$(ruby_version_prompt) ${purple}\u@\h${reset_color}:\W${bold_cyan}${green}$(scm_prompt_info)${reset_color}${reset_color}\$ " } PROMPT_COMMAND=prompt_command; From c3a061599fdce0db5b793f29cb84cfda6ecddddc Mon Sep 17 00:00:00 2001 From: Calvin Giles Date: Thu, 29 Aug 2013 00:16:29 +0100 Subject: [PATCH 08/10] Fixed weird color bug that happens when git is clean. --- themes/calvin/calvin.theme.bash | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/themes/calvin/calvin.theme.bash b/themes/calvin/calvin.theme.bash index 64170d60..e5d076fd 100644 --- a/themes/calvin/calvin.theme.bash +++ b/themes/calvin/calvin.theme.bash @@ -1,21 +1,20 @@ #!/usr/bin/env bash -SCM_NONE_CHAR='' -SCM_THEME_PROMPT_DIRTY=" ${red}✗${reset_color}" -SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓${reset_color}" -SCM_THEME_PROMPT_PREFIX=" ${reset_color}|$(scm_char) " -SCM_THEME_PROMPT_SUFFIX="${reset_color}|${reset_color}" +SCM_THEME_PROMPT_DIRTY=" ${red}✗" +SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓" +SCM_THEME_PROMPT_PREFIX=" |" +SCM_THEME_PROMPT_SUFFIX="${green}|" GIT_THEME_PROMPT_DIRTY=" ${red}✗" GIT_THEME_PROMPT_CLEAN=" ${bold_green}✓" -GIT_THEME_PROMPT_PREFIX=" ${reset_color}|$(scm_char) " -GIT_THEME_PROMPT_SUFFIX="${reset_color}|${reset_color}" +GIT_THEME_PROMPT_PREFIX=" ${green}|$(scm_char) " +GIT_THEME_PROMPT_SUFFIX="${green}|" RVM_THEME_PROMPT_PREFIX="|" RVM_THEME_PROMPT_SUFFIX="|" function prompt_command() { #PS1="${bold_cyan}$(scm_char)${green}$(scm_prompt_info)${purple}$(ruby_version_prompt) ${yellow}\h ${reset_color}in ${green}\w ${reset_color}\n${green}→${reset_color} " - PS1="${yellow}$(ruby_version_prompt) ${purple}\u@\h${reset_color}:\W${bold_cyan}${green}$(scm_prompt_info)${reset_color}${reset_color}\$ " + PS1="${yellow}$(ruby_version_prompt) ${purple}\u@\h${reset_color}:\W${green}${bold_cyan}${green}$(scm_prompt_info) ${green}${reset_color}\$ " } -PROMPT_COMMAND=prompt_command; +PROMPT_COMMAND=prompt_command; \ No newline at end of file From 60f4e4b9b0ca7998d22ef51c3599e407b65347b8 Mon Sep 17 00:00:00 2001 From: Calvin Giles Date: Thu, 29 Aug 2013 10:17:49 +0100 Subject: [PATCH 09/10] No strange color effects now. --- themes/calvin/calvin.theme.bash | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/themes/calvin/calvin.theme.bash b/themes/calvin/calvin.theme.bash index e5d076fd..b09c47e3 100644 --- a/themes/calvin/calvin.theme.bash +++ b/themes/calvin/calvin.theme.bash @@ -1,9 +1,12 @@ #!/usr/bin/env bash +SCM_NONE_CHAR='' + SCM_THEME_PROMPT_DIRTY=" ${red}✗" SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓" SCM_THEME_PROMPT_PREFIX=" |" SCM_THEME_PROMPT_SUFFIX="${green}|" + GIT_THEME_PROMPT_DIRTY=" ${red}✗" GIT_THEME_PROMPT_CLEAN=" ${bold_green}✓" GIT_THEME_PROMPT_PREFIX=" ${green}|$(scm_char) " @@ -12,9 +15,21 @@ GIT_THEME_PROMPT_SUFFIX="${green}|" RVM_THEME_PROMPT_PREFIX="|" RVM_THEME_PROMPT_SUFFIX="|" +PROMPT_CHAR_CLEAN="${reset_color}\$" +PROMPT_CHAR_DIRTY="${red}\$${reset_color}" + +function prompt_char() { + if [ $? -eq 0 ]; then PROMPT_CHAR=$PROMPT_CHAR_CLEAN + else PROMPT_CHAR=$PROMPT_CHAR_DIRTY + fi + echo -e "$? \$" +} + function prompt_command() { - #PS1="${bold_cyan}$(scm_char)${green}$(scm_prompt_info)${purple}$(ruby_version_prompt) ${yellow}\h ${reset_color}in ${green}\w ${reset_color}\n${green}→${reset_color} " - PS1="${yellow}$(ruby_version_prompt) ${purple}\u@\h${reset_color}:\W${green}${bold_cyan}${green}$(scm_prompt_info) ${green}${reset_color}\$ " + + PS1="${yellow}$(ruby_version_prompt)${purple}\u@\h${reset_color}:\W${green}${bold_cyan}${green}$(scm_prompt_info) ${green}${reset_color}$? \$ " + + #PS1="${yellow}$(ruby_version_prompt)${purple}\u@\h${reset_color}:\W${green}${bold_cyan}${green}$(scm_prompt_info) ${green}${reset_color}\$ " } PROMPT_COMMAND=prompt_command; \ No newline at end of file From d32dc4002f4300a9dbe3abc65daf0bfcda3d74fa Mon Sep 17 00:00:00 2001 From: Calvin Giles Date: Thu, 29 Aug 2013 10:45:11 +0100 Subject: [PATCH 10/10] Fixed. Prompt dollar now turns red on error and clears on success. --- themes/calvin/calvin.theme.bash | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/themes/calvin/calvin.theme.bash b/themes/calvin/calvin.theme.bash index b09c47e3..9ab3857d 100644 --- a/themes/calvin/calvin.theme.bash +++ b/themes/calvin/calvin.theme.bash @@ -15,21 +15,18 @@ GIT_THEME_PROMPT_SUFFIX="${green}|" RVM_THEME_PROMPT_PREFIX="|" RVM_THEME_PROMPT_SUFFIX="|" -PROMPT_CHAR_CLEAN="${reset_color}\$" -PROMPT_CHAR_DIRTY="${red}\$${reset_color}" +PROMPT_END_CLEAN="\$" +PROMPT_END_DIRTY="${red}\$${reset_color}" -function prompt_char() { - if [ $? -eq 0 ]; then PROMPT_CHAR=$PROMPT_CHAR_CLEAN - else PROMPT_CHAR=$PROMPT_CHAR_DIRTY - fi - echo -e "$? \$" +function prompt_end(){ + echo -e "$PROMPT_END" } function prompt_command() { - - PS1="${yellow}$(ruby_version_prompt)${purple}\u@\h${reset_color}:\W${green}${bold_cyan}${green}$(scm_prompt_info) ${green}${reset_color}$? \$ " - - #PS1="${yellow}$(ruby_version_prompt)${purple}\u@\h${reset_color}:\W${green}${bold_cyan}${green}$(scm_prompt_info) ${green}${reset_color}\$ " + if [[ $? -eq 0 ]]; then PROMPT_END=$PROMPT_END_CLEAN + else PROMPT_END=$PROMPT_END_DIRTY + fi + PS1="${yellow}$(ruby_version_prompt)${purple}\u@\h${reset_color}:\W${green}${bold_cyan}${green}$(scm_prompt_info) ${reset_color}$(prompt_end) " } PROMPT_COMMAND=prompt_command; \ No newline at end of file