From f5d369f6798b8c12857451c9883bdd487c922449 Mon Sep 17 00:00:00 2001 From: Paulo Eduardo Date: Fri, 7 Feb 2014 01:46:09 -0200 Subject: [PATCH] Add New Theme: Psyco --- themes/psyco/base.psyco.bash | 31 ++++++++++++++++++ themes/psyco/colors.psyco.bash | 59 ++++++++++++++++++++++++++++++++++ themes/psyco/psyco.theme.bash | 19 +++++++++++ 3 files changed, 109 insertions(+) create mode 100644 themes/psyco/base.psyco.bash create mode 100644 themes/psyco/colors.psyco.bash create mode 100644 themes/psyco/psyco.theme.bash diff --git a/themes/psyco/base.psyco.bash b/themes/psyco/base.psyco.bash new file mode 100644 index 00000000..48d6c6fd --- /dev/null +++ b/themes/psyco/base.psyco.bash @@ -0,0 +1,31 @@ +#!/usr/bin/env bash + +THEME_PROMPT_HOST='\H' +SCM_THEME_PROMPT_DIRTY='*' +SCM_THEME_PROMPT_CLEAN='' +SCM_THEME_PROMPT_PREFIX="${reset}${bold}${light_gray}[${reset}${bold}${purple}" +SCM_THEME_PROMPT_SUFFIX="${reset}${bold}${light_gray}]${reset}${bold}${purple}" + +SCM_GIT='git' +SCM_GIT_CHAR='' + +SCM_HG='hg' +SCM_HG_CHAR='' + +SCM_SVN='svn' +SCM_SVN_CHAR='' + +SCM_NONE='NONE' +SCM_NONE_CHAR='' + +RVM_THEME_PROMPT_PREFIX="${reset}${bold}${light_gray}[${reset}${bold}${purple}" +RVM_THEME_PROMPT_SUFFIX="${reset}${bold}${light_gray}]${reset}${bold}${purple}" + +VIRTUALENV_THEME_PROMPT_PREFIX="${reset}${bold}${light_gray}[${reset}${bold}${purple}" +VIRTUALENV_THEME_PROMPT_SUFFIX="${reset}${bold}${light_gray}]${reset}${bold}${purple}" + +RBENV_THEME_PROMPT_PREFIX="${reset}${bold}${light_gray}[${reset}${bold}${purple}" +RBENV_THEME_PROMPT_SUFFIX="${reset}${bold}${light_gray}]${reset}${bold}${purple}" + +RBFU_THEME_PROMPT_PREFIX="${reset}${bold}${light_gray}[${reset}${bold}${purple}" +RBFU_THEME_PROMPT_SUFFIX="${reset}${bold}${light_gray}]${reset}${bold}${purple}" diff --git a/themes/psyco/colors.psyco.bash b/themes/psyco/colors.psyco.bash new file mode 100644 index 00000000..0aaf8dda --- /dev/null +++ b/themes/psyco/colors.psyco.bash @@ -0,0 +1,59 @@ +#!/usr/bin/env bash + +if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color >/dev/null 2>&1; then + export TERM=gnome-256color +elif [[ $TERM != dumb ]] && infocmp xterm-256color >/dev/null 2>&1; then + export TERM=xterm-256color +fi + +if tput setaf 1 &> /dev/null; then + tput sgr0 + if [[ $(tput colors) -ge 256 ]] 2>/dev/null; then + red=$(tput setaf 9) + magenta=$(tput setaf 198) + orange=$(tput setaf 202) + green=$(tput setaf 28) + purple=$(tput setaf 13) + yellow=$(tput setaf 226) + cyan=$(tput setaf 39) + white=$(tput setaf 7) + black=$(tput setaf 0) + light_gray=$(tput setaf 240) + dark_gray=$(tput setaf 235) + else + red=$(tput setaf 1) + magenta=$(tput setaf 5) + orange=$(tput setaf 4) + green=$(tput setaf 2) + purple=$(tput setaf 5) + yellow=$(tput setaf 3) + cyan=$(tput setaf 6) + white=$(tput setaf 7) + black=$(tput setaf 0) + light_gray=$(tput setaf 0 && tput dim) + dark_gray=$(tput setaf 0 && tput dim) + fi + bold=$(tput bold) + dim=$(tput dim) + underline=$(tput smul) + reverse=$(tput rev) + reset=$(tput sgr0) +else + red="\033[31m" + magenta="\033[95m" + orange="\033[33m" + green="\033[32m" + purple="\033[35m" + yellow="\033[93m" + cyan="\033[36m" + white="\033[97m" + black="\033[30m" + light_gray="\033[37m" + dark_gray="\033[90m" + bold="\033[1m" + dim="\033[2m" + underline="\033[4m" + reverse="\033[7m" + reset="\033[m" +fi + diff --git a/themes/psyco/psyco.theme.bash b/themes/psyco/psyco.theme.bash new file mode 100644 index 00000000..60497cf9 --- /dev/null +++ b/themes/psyco/psyco.theme.bash @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +source "${BASH_IT}/themes/psyco/colors.psyco.bash" +source "${BASH_IT}/themes/psyco/base.psyco.bash" + +ruby_format="${reset}${yellow}" +user_name="${reset}${bold}${red}\u" +at_symbol="${reset}${bold}${light_gray}@" +machine_name="${reset}${bold}${orange}\h" +location_word="${reset}${bold}${light_gray} in " +location_path="${reset}${bold}${yellow}\w" +user_privilege="${reset}${bold}${white}\n\$" +input_style="${reset}${normal}" + +function prompt_command() { + PS1="${ruby_format}$(ruby_version_prompt)${user_name}${at_symbol}${machine_name}${location_word}${location_path}$(scm_char)$(scm_prompt_info)${user_privilege}${input_style} " +} + +PROMPT_COMMAND=prompt_command;