mirror of
https://github.com/ohmybash/oh-my-bash.git
synced 2024-05-11 05:55:37 +00:00
Merge pull request #297 from akinomyoga/color
Resolve variable name conflicts in `lib/utils.sh` and `themes/colours.theme.sh`
This commit is contained in:
24
lib/base.sh
24
lib/base.sh
@@ -208,20 +208,20 @@ bigfind() {
|
||||
# -------------------------------------------------------------------
|
||||
myip () {
|
||||
res=$(curl -s checkip.dyndns.org | grep -Eo '[0-9\.]+')
|
||||
echo -e "Your public IP is: ${echo_bold_green} $res ${echo_normal}"
|
||||
echo -e "Your public IP is: ${_omb_term_bold_green} $res ${_omb_term_normal}"
|
||||
}
|
||||
|
||||
# ii: display useful host related informaton
|
||||
# -------------------------------------------------------------------
|
||||
ii() {
|
||||
echo -e "\\nYou are logged on ${red}$HOST"
|
||||
echo -e "\\nYou are logged on ${_omb_term_brown}$HOST"
|
||||
echo -e "\\nAdditionnal information:$NC " ; uname -a
|
||||
echo -e "\\n${red}Users logged on:$NC " ; w -h
|
||||
echo -e "\\n${red}Current date :$NC " ; date
|
||||
echo -e "\\n${red}Machine stats :$NC " ; uptime
|
||||
[[ "$OSTYPE" == darwin* ]] && echo -e "\\n${red}Current network location :$NC " ; scselect
|
||||
echo -e "\\n${red}Public facing IP Address :$NC " ;myip
|
||||
[[ "$OSTYPE" == darwin* ]] && echo -e "\\n${red}DNS Configuration:$NC " ; scutil --dns
|
||||
echo -e "\\n${_omb_term_brown}Users logged on:$NC " ; w -h
|
||||
echo -e "\\n${_omb_term_brown}Current date :$NC " ; date
|
||||
echo -e "\\n${_omb_term_brown}Machine stats :$NC " ; uptime
|
||||
[[ "$OSTYPE" == darwin* ]] && echo -e "\\n${_omb_term_brown}Current network location :$NC " ; scselect
|
||||
echo -e "\\n${_omb_term_brown}Public facing IP Address :$NC " ;myip
|
||||
[[ "$OSTYPE" == darwin* ]] && echo -e "\\n${_omb_term_brown}DNS Configuration:$NC " ; scutil --dns
|
||||
echo
|
||||
}
|
||||
|
||||
@@ -233,15 +233,15 @@ bigfind() {
|
||||
# batch_chmod: Batch chmod for all files & sub-directories in the current one
|
||||
# -------------------------------------------------------------------
|
||||
batch_chmod() {
|
||||
echo -ne "${echo_bold_blue}Applying 0755 permission for all directories..."
|
||||
echo -ne "${_omb_term_bold_navy}Applying 0755 permission for all directories..."
|
||||
(find . -type d -print0 | xargs -0 chmod 0755) &
|
||||
spinner
|
||||
echo -ne "${echo_normal}"
|
||||
echo -ne "${_omb_term_normal}"
|
||||
|
||||
echo -ne "${echo_bold_blue}Applying 0644 permission for all files..."
|
||||
echo -ne "${_omb_term_bold_navy}Applying 0644 permission for all files..."
|
||||
(find . -type f -print0 | xargs -0 chmod 0644) &
|
||||
spinner
|
||||
echo -ne "${echo_normal}"
|
||||
echo -ne "${_omb_term_normal}"
|
||||
}
|
||||
|
||||
# usage: disk usage per directory, in Mac OS X and Linux
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
#! bash oh-my-bash.module
|
||||
# Outputs current branch info in prompt format
|
||||
|
||||
_omb_module_require lib:omb-prompt-colors
|
||||
|
||||
function git_prompt_info() {
|
||||
local ref
|
||||
if [[ "$(command git config --get oh-my-bash.hide-status 2>/dev/null)" != "1" ]]; then
|
||||
@@ -43,13 +46,13 @@ function git_remote_status() {
|
||||
git_remote_status="$OSH_THEME_GIT_PROMPT_EQUAL_REMOTE"
|
||||
elif [[ $ahead -gt 0 ]] && [[ $behind -eq 0 ]]; then
|
||||
git_remote_status="$OSH_THEME_GIT_PROMPT_AHEAD_REMOTE"
|
||||
git_remote_status_detailed="$OSH_THEME_GIT_PROMPT_AHEAD_REMOTE_COLOR$OSH_THEME_GIT_PROMPT_AHEAD_REMOTE$((ahead))%{$reset_color%}"
|
||||
git_remote_status_detailed="$OSH_THEME_GIT_PROMPT_AHEAD_REMOTE_COLOR$OSH_THEME_GIT_PROMPT_AHEAD_REMOTE$((ahead))%{$_omb_prompt_reset_color%}"
|
||||
elif [[ $behind -gt 0 ]] && [[ $ahead -eq 0 ]]; then
|
||||
git_remote_status="$OSH_THEME_GIT_PROMPT_BEHIND_REMOTE"
|
||||
git_remote_status_detailed="$OSH_THEME_GIT_PROMPT_BEHIND_REMOTE_COLOR$OSH_THEME_GIT_PROMPT_BEHIND_REMOTE$((behind))%{$reset_color%}"
|
||||
git_remote_status_detailed="$OSH_THEME_GIT_PROMPT_BEHIND_REMOTE_COLOR$OSH_THEME_GIT_PROMPT_BEHIND_REMOTE$((behind))%{$_omb_prompt_reset_color%}"
|
||||
elif [[ $ahead -gt 0 ]] && [[ $behind -gt 0 ]]; then
|
||||
git_remote_status="$OSH_THEME_GIT_PROMPT_DIVERGED_REMOTE"
|
||||
git_remote_status_detailed="$OSH_THEME_GIT_PROMPT_AHEAD_REMOTE_COLOR$OSH_THEME_GIT_PROMPT_AHEAD_REMOTE$((ahead))%{$reset_color%}$OSH_THEME_GIT_PROMPT_BEHIND_REMOTE_COLOR$OSH_THEME_GIT_PROMPT_BEHIND_REMOTE$((behind))%{$reset_color%}"
|
||||
git_remote_status_detailed="$OSH_THEME_GIT_PROMPT_AHEAD_REMOTE_COLOR$OSH_THEME_GIT_PROMPT_AHEAD_REMOTE$((ahead))%{$_omb_prompt_reset_color%}$OSH_THEME_GIT_PROMPT_BEHIND_REMOTE_COLOR$OSH_THEME_GIT_PROMPT_BEHIND_REMOTE$((behind))%{$_omb_prompt_reset_color%}"
|
||||
fi
|
||||
|
||||
if [[ -n $OSH_THEME_GIT_PROMPT_REMOTE_STATUS_DETAILED ]]; then
|
||||
|
||||
@@ -1,6 +1,253 @@
|
||||
#! bash oh-my-bash.module
|
||||
|
||||
# deprecate functions
|
||||
function _omb_deprecate_warning {
|
||||
local level=$1 msg=$2
|
||||
local sep=$_omb_term_teal:
|
||||
local src=$_omb_term_purple${BASH_SOURCE[level+1]}
|
||||
local line=$_omb_term_green${BASH_LINENO[level]}
|
||||
local func=${FUNCNAME[level+1]}
|
||||
if [[ $func && $func != source ]]; then
|
||||
func=" $_omb_term_teal($_omb_term_navy$func$_omb_term_teal)"
|
||||
else
|
||||
func=
|
||||
fi
|
||||
printf '%s\n' "$src$sep$line$func$sep$_omb_term_reset $msg"
|
||||
}
|
||||
|
||||
function _omb_deprecate_function__notify {
|
||||
local old=$1 new=$2
|
||||
local v=__omb_deprecate_Function_$old; v=${v//[!a-zA-Z0-9_]/'_'}
|
||||
[[ ${!v+set} ]] && return 0
|
||||
local esc_old=$_omb_term_bold_brown$old$_omb_term_reset
|
||||
local esc_new=$_omb_term_bold_navy$new$_omb_term_reset
|
||||
_omb_deprecate_warning 2 "The function '$esc_old' is deprecated. Please use '$esc_new'." >&2
|
||||
printf -v "$v" notified
|
||||
}
|
||||
|
||||
function _omb_deprecate_function {
|
||||
local warning=
|
||||
((_omb_version >= $1)) &&
|
||||
warning="_omb_deprecate_function__notify '$2' '$3'; "
|
||||
builtin eval -- "function $2 { $warning$3 \"\$@\"; }"
|
||||
}
|
||||
|
||||
## @fn _omb_deprecate_declare version old_name new_name opts arg
|
||||
## @param[in] version
|
||||
## The OMB version starting warning messages.
|
||||
##
|
||||
## @param[in] old_name new_name
|
||||
## old and new variable names. The empty value of new_name indicates that
|
||||
## the old_name is just deprecated, or there is no unique corresponding new
|
||||
## variable.
|
||||
##
|
||||
## @param[in] opts
|
||||
## a colon-separated list of the following fields:
|
||||
##
|
||||
## sync
|
||||
## detect changes in either of old variable and new variable, and apply
|
||||
## the change to the other.
|
||||
## track
|
||||
## copy from the new variable to the old variable when the value is
|
||||
## changed.
|
||||
##
|
||||
## @param[in] arg
|
||||
## When new_name is not specified, arg contains an error message that will
|
||||
## be shown when the old_name is accessed.
|
||||
##
|
||||
|
||||
## @fn _omb_deprecate_declare__init
|
||||
## @var[in] __ver __old __new __opts __msg
|
||||
function _omb_deprecate_declare__init {
|
||||
if [[ ${!__old+set} ]]; then
|
||||
__opts=$__opts:notified
|
||||
if ((_omb_version >= __ver)); then
|
||||
if [[ $__new ]]; then
|
||||
printf '%s\n' "oh-my-bash: The variable '$__old' is set but has been renamed to '$__new'. Please use '$__new'."
|
||||
else
|
||||
printf '%s\n' "oh-my-bash: The variable '$__old' is set but has been deprecated.${__msg+ $__msg}"
|
||||
fi >/dev/tty
|
||||
fi
|
||||
if [[ $__new && ! ${!__new+set} ]]; then
|
||||
printf "$__new" '%s' "${!__old}"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
if ((_omb_bash_version >= 40300)); then
|
||||
_omb_deprecate_declare=()
|
||||
declare -gA _omb_deprecate_declare_counter=()
|
||||
function _omb_deprecate_declare {
|
||||
local __ver=$1 __old=$2 __new=$3 __opts=$4 __msg=$5
|
||||
_omb_deprecate_declare__init
|
||||
|
||||
unset -n "$__old"
|
||||
unset -v "$__old"
|
||||
if ((_omb_version >= __ver)); then
|
||||
local __index=${#_omb_deprecate_declare[@]}
|
||||
_omb_deprecate_declare[__index]=$__old:$__new:$__msg
|
||||
eval "declare -gn $__old='$__new[_omb_deprecate_declare_counter[$__index,\$BASH_SOURCE,\$LINENO]+=\$(_omb_deprecate_declare__notify $__index),0]'"
|
||||
else
|
||||
eval "declare -gn $__old='$__new'"
|
||||
fi
|
||||
}
|
||||
function _omb_deprecate_declare__notify {
|
||||
local __index=$1 data=${_omb_deprecate_declare[__index]}
|
||||
local __old=${data%%:*}; data=${data#*:}
|
||||
local __new=${data%%:*}; data=${data#*:}
|
||||
local __msg=$data
|
||||
local count=${_omb_deprecate_declare_counter[$__index,${BASH_SOURCE[1]},${BASH_LINENO[0]}]:-0}
|
||||
if ((count == 0)); then
|
||||
local esc_old=$_omb_term_bold_brown$__old$_omb_term_reset
|
||||
local esc_new=$_omb_term_bold_navy$__new$_omb_term_reset
|
||||
if [[ $__new ]]; then
|
||||
_omb_deprecate_warning 1 "The variable '$esc_old' has been renamed to '$esc_new'. Please use '$esc_new'."
|
||||
else
|
||||
_omb_deprecate_warning 1 "The variable '$esc_old' has been deprecated.${__msg+ $__msg}"
|
||||
fi >/dev/tty
|
||||
fi
|
||||
echo 1
|
||||
}
|
||||
else
|
||||
_omb_deprecate_declare=()
|
||||
_omb_deprecate_declare_notify=()
|
||||
_omb_deprecate_declare_value=()
|
||||
function _omb_deprecate_declare {
|
||||
local __ver=$1 __old=$2 __new=$3 __opts=$4 __msg=$5
|
||||
_omb_deprecate_declare__init
|
||||
|
||||
if [[ ! $__new ]]; then
|
||||
# (show warning when used) nothing can be done for bash <= 4.2
|
||||
return 0
|
||||
fi
|
||||
|
||||
local __notify=
|
||||
if ((_omb_version >= __ver)) && [[ :$__opts: != *:notified:* ]]; then
|
||||
__notify=1
|
||||
fi
|
||||
|
||||
printf "$__old" %s "${!__new-}"
|
||||
if [[ :$__opts: == *:track:* ]]; then
|
||||
local __index=${#_omb_deprecate_declare[@]}
|
||||
_omb_deprecate_declare[__index]=track:$__old:$__new:$__msg
|
||||
_omb_deprecate_declare_notify[__index]=$__notify
|
||||
elif [[ :$__opts: == *:sync:* ]]; then
|
||||
local __index=${#_omb_deprecate_declare[@]}
|
||||
_omb_deprecate_declare[__index]=sync:$__old:$__new:$__msg
|
||||
_omb_deprecate_declare_notify[__index]=$__notify
|
||||
_omb_deprecate_declare_value[__index]=${__new}
|
||||
fi
|
||||
}
|
||||
function _omb_deprecate_declare__sync {
|
||||
local __index __pair __type __old __new __msg
|
||||
for __index in "${!_omb_util_deprecate[@]}"; do
|
||||
__pair=${_omb_util_deprecate[__index]}
|
||||
__type=${__pair%%:*} __pair=${__pair#*:}
|
||||
__old=${__pair%%:*} __pair=${__pair#*:}
|
||||
__new=${_pair%%:*} __msg=${__pair#*:}
|
||||
|
||||
[[ ${!__new} != "$__value" || ${!__old} != "$__value" ]] || continue
|
||||
|
||||
# Notify deprecation when the variable 'old_name' has been first changed.
|
||||
if [[ ${!__old+set} && ${!__old} != "$__value" && ${_omb_deprecate_declare_notify[__index]} ]]; then
|
||||
_omb_deprecate_declare_notify[__index]=
|
||||
local esc_old=$_omb_term_bold_brown$__old$_omb_term_reset
|
||||
local esc_new=$_omb_term_bold_navy$__new$_omb_term_reset
|
||||
if [[ $__new ]]; then
|
||||
printf '%s\n' "oh-my-bash: The variable '$esc_old' is changed but has been renamed to '$esc_new'. Please use '$esc_new'."
|
||||
else
|
||||
printf '%s\n' "oh-my-bash: The variable '$esc_old' is changed but has been deprecated.${__msg+ $__msg}"
|
||||
fi >/dev/tty
|
||||
fi
|
||||
|
||||
case $__type in
|
||||
(sync)
|
||||
local __value=${_omb_util_deprecate_value[__index]} __event=
|
||||
if [[ ! ${!__new+set} || ! ${!__old+set} ]]; then
|
||||
__value=${!__new-${!__old-}} __event=change
|
||||
elif [[ ${!__new} != "$__value" ]]; then
|
||||
__value=${!__new} __event=change
|
||||
elif [[ ${!__old} != "$__value" ]]; then
|
||||
__value=${!__old} __event=change
|
||||
fi
|
||||
|
||||
if [[ $__event ]]; then
|
||||
_omb_util_deprecate_value[__index]=$__value
|
||||
printf -v "$__new" %s "$__value"
|
||||
printf -v "$__old" %s "$__value"
|
||||
fi ;;
|
||||
(track)
|
||||
printf -v "$__old" %s "${!__new-}" ;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
_omb_util_add_prompt_command _omb_deprecate_declare__sync
|
||||
fi
|
||||
|
||||
if ((_omb_bash_version >= 40300)); then
|
||||
_omb_deprecate_const=()
|
||||
_omb_deprecate_const_value=()
|
||||
declare -gA _omb_deprecate_const_counter=()
|
||||
function _omb_deprecate_const {
|
||||
local __ver=$1 __old=$2 __value=$3 __msg=$4
|
||||
if [[ ${!__old+set} ]]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
if ((_omb_version >= __ver)); then
|
||||
local __index=${#_omb_deprecate_const[@]}
|
||||
_omb_deprecate_const[__index]=$__old:$__msg
|
||||
_omb_deprecate_const_value[__index]=$__value
|
||||
printf -v "_omb_deprecate_Const_$__old" %s "$__value"
|
||||
eval "declare -gn $__old='_omb_deprecate_Const_$__old[_omb_deprecate_const_counter[$__index,\$BASH_SOURCE,\$LINENO]+=\$(_omb_deprecate_const__notify $__index),0]'"
|
||||
else
|
||||
printf -v "$__old" %s "$__value"
|
||||
fi
|
||||
}
|
||||
function _omb_deprecate_const__notify {
|
||||
local __index=$1
|
||||
local __old=${_omb_deprecate_const[__index]%%:*}
|
||||
local __msg=${_omb_deprecate_const[__index]#*:}
|
||||
local __value=${_omb_deprecate_const_value[__index]}
|
||||
local __ref=_omb_deprecate_Const_$__old
|
||||
if [[ ${!__ref-} == "$__value" ]]; then
|
||||
local count=${_omb_deprecate_const_counter[$__index,${BASH_SOURCE[1]},${BASH_LINENO[0]}]:-0}
|
||||
if ((count == 0)); then
|
||||
local esc_old=$_omb_term_bold_brown$__old$_omb_term_reset
|
||||
_omb_deprecate_warning 1 "The variable '$esc_old' has been deprecated.${__msg+ $__msg}" >&2
|
||||
fi
|
||||
fi
|
||||
echo 1
|
||||
}
|
||||
function _omb_deprecate_const__sync {
|
||||
local __index __old __curval __compaction=
|
||||
for __index in "${!_omb_deprecate_const[@]}"; do
|
||||
__old=${_omb_deprecate_const[__index]%%:*}
|
||||
[[ $__old ]] || continue
|
||||
|
||||
__ref=_omb_deprecate_Const_$__old
|
||||
__curval=${!__ref-}
|
||||
if [[ $__curval != "${_omb_deprecate_const_value[__index]}" ]]; then
|
||||
_omb_deprecate_const[__index]=
|
||||
_omb_deprecate_const_value[__index]=
|
||||
unset -n "$__old"
|
||||
printf -v "$__old" %s "$__curval"
|
||||
fi
|
||||
done
|
||||
}
|
||||
_omb_util_add_prompt_command _omb_deprecate_const__sync
|
||||
else
|
||||
function _omb_deprecate_const {
|
||||
local __ver=$1 __old=$2 __value=$3 __msg=$4
|
||||
if [[ ${!__old+set} ]]; then
|
||||
return 0
|
||||
fi
|
||||
printf -v "$__old" %s "$__value"
|
||||
}
|
||||
fi
|
||||
|
||||
_omb_deprecate_msg_please_use="Please use '$_omb_term_bold_navy%s$_omb_term_reset'."
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# deprecate functions and variables
|
||||
|
||||
# oh-my-bash.sh -- These functions were originally used to find
|
||||
# "fpath" directories, which are not supported by Bash.
|
||||
@@ -20,24 +267,46 @@ is_alias() {
|
||||
[[ -f $base_dir/aliases/$name/$name.aliases.sh ]]
|
||||
}
|
||||
|
||||
|
||||
# lib/utils.sh -- Logging functions
|
||||
_omb_util_defun_deprecate 20000 type_exists _omb_util_binary_exists
|
||||
_omb_deprecate_function 20000 type_exists _omb_util_binary_exists
|
||||
|
||||
_omb_util_defun_deprecate 20000 e_header _omb_log_header
|
||||
_omb_util_defun_deprecate 20000 e_arrow _omb_log_arrow
|
||||
_omb_util_defun_deprecate 20000 e_success _omb_log_success
|
||||
_omb_util_defun_deprecate 20000 e_error _omb_log_error
|
||||
_omb_util_defun_deprecate 20000 e_warning _omb_log_warning
|
||||
_omb_util_defun_deprecate 20000 e_underline _omb_log_underline
|
||||
_omb_util_defun_deprecate 20000 e_bold _omb_log_bold
|
||||
_omb_util_defun_deprecate 20000 e_note _omb_log_note
|
||||
_omb_deprecate_const 20000 ncolors "$_omb_term_colors" "${_omb_deprecate_msg_please_use/'%s'/_omb_term_colors}"
|
||||
_omb_deprecate_const 20000 bold "$_omb_term_bold" "${_omb_deprecate_msg_please_use/'%s'/_omb_term_bold}"
|
||||
_omb_deprecate_const 20000 underline "$_omb_term_underline" "${_omb_deprecate_msg_please_use/'%s'/_omb_term_underline}"
|
||||
_omb_deprecate_const 20000 reset "$_omb_term_reset" "${_omb_deprecate_msg_please_use/'%s'/_omb_term_reset}"
|
||||
_omb_deprecate_const 20000 tan "$_omb_term_olive" "${_omb_deprecate_msg_please_use/'%s'/_omb_term_olive}"
|
||||
|
||||
_omb_deprecate_red=${_omb_term_brown:+$'\1'$_omb_term_brown$'\2'}
|
||||
_omb_deprecate_green=${_omb_term_green:+$'\1'$_omb_term_green$'\2'}
|
||||
_omb_deprecate_yellow=${_omb_term_olive:+$'\1'$_omb_term_olive$'\2'}
|
||||
_omb_deprecate_blue=${_omb_term_navy:+$'\1'$_omb_term_navy$'\2'}
|
||||
_omb_deprecate_magenta=${_omb_term_purple:+$'\1'$_omb_term_purple$'\2'}
|
||||
_omb_deprecate_const 20000 red "$_omb_deprecate_red" "Please use '${_omb_term_bold_navy}_omb_term_brown$_omb_term_reset' or '${_omb_term_bold_navy}_omb_prompt_brown$_omb_term_reset'."
|
||||
_omb_deprecate_const 20000 green "$_omb_deprecate_green" "Please use '${_omb_term_bold_navy}_omb_term_green$_omb_term_reset' or '${_omb_term_bold_navy}_omb_prompt_green$_omb_term_reset'."
|
||||
_omb_deprecate_const 20000 yellow "$_omb_deprecate_yellow" "Please use '${_omb_term_bold_navy}_omb_term_olive$_omb_term_reset' or '${_omb_term_bold_navy}_omb_prompt_olive$_omb_term_reset'."
|
||||
_omb_deprecate_const 20000 blue "$_omb_deprecate_blue" "Please use '${_omb_term_bold_navy}_omb_term_navy$_omb_term_reset' or '${_omb_term_bold_navy}_omb_prompt_navy$_omb_term_reset'."
|
||||
_omb_deprecate_const 20000 purple "$_omb_deprecate_magenta" "Please use '${_omb_term_bold_navy}_omb_term_purple$_omb_term_reset' or '${_omb_term_bold_navy}_omb_prompt_purple$_omb_term_reset'."
|
||||
|
||||
_omb_deprecate_function 20000 e_header _omb_log_header
|
||||
_omb_deprecate_function 20000 e_arrow _omb_log_arrow
|
||||
_omb_deprecate_function 20000 e_success _omb_log_success
|
||||
_omb_deprecate_function 20000 e_error _omb_log_error
|
||||
_omb_deprecate_function 20000 e_warning _omb_log_warning
|
||||
_omb_deprecate_function 20000 e_underline _omb_log_underline
|
||||
_omb_deprecate_function 20000 e_bold _omb_log_bold
|
||||
_omb_deprecate_function 20000 e_note _omb_log_note
|
||||
|
||||
# plugins/bashmarks/bashmarks.plugin.sh [ This anyway conflicts with
|
||||
# variables defined by themes (axin, mairan, sexy, etc.) so do not
|
||||
# define fallbacks and warnings. ]
|
||||
#_omb_deprecate_const RED "0;31m" "${_omb_deprecate_msg_please_use/'%s'/\${_omb_term_brown:2}}"
|
||||
#_omb_deprecate_const GREEN "0;33m" "${_omb_deprecate_msg_please_use/'%s'/\${_omb_term_green:2}}"
|
||||
|
||||
# themes/*
|
||||
_omb_util_defun_deprecate 20000 prompt_command _omb_theme_PROMPT_COMMAND
|
||||
_omb_util_defun_deprecate 20000 prompt _omb_theme_PROMPT_COMMAND
|
||||
_omb_util_defun_deprecate 20000 prompt_setter _omb_theme_PROMPT_COMMAND
|
||||
_omb_util_defun_deprecate 20000 pure_setter _omb_theme_PROMPT_COMMAND # pure, gallifrey
|
||||
_omb_util_defun_deprecate 20000 dulcie_setter _omb_theme_PROMPT_COMMAND # dulcie
|
||||
_omb_util_defun_deprecate 20000 _brainy_setter _omb_theme_PROMPT_COMMAND # brainy
|
||||
_omb_util_defun_deprecate 20000 set_bash_prompt _omb_theme_PROMPT_COMMAND # agnoster
|
||||
_omb_deprecate_function 20000 prompt_command _omb_theme_PROMPT_COMMAND
|
||||
_omb_deprecate_function 20000 prompt _omb_theme_PROMPT_COMMAND
|
||||
_omb_deprecate_function 20000 prompt_setter _omb_theme_PROMPT_COMMAND
|
||||
_omb_deprecate_function 20000 pure_setter _omb_theme_PROMPT_COMMAND # pure, gallifrey
|
||||
_omb_deprecate_function 20000 dulcie_setter _omb_theme_PROMPT_COMMAND # dulcie
|
||||
_omb_deprecate_function 20000 _brainy_setter _omb_theme_PROMPT_COMMAND # brainy
|
||||
_omb_deprecate_function 20000 set_bash_prompt _omb_theme_PROMPT_COMMAND # agnoster
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
#! bash oh-my-bash.module
|
||||
|
||||
_omb_module_require lib:omb-deprecate
|
||||
_omb_module_require lib:omb-prompt-colors
|
||||
|
||||
CLOCK_CHAR_THEME_PROMPT_PREFIX=''
|
||||
CLOCK_CHAR_THEME_PROMPT_SUFFIX=''
|
||||
CLOCK_THEME_PROMPT_PREFIX=''
|
||||
@@ -438,11 +441,11 @@ _omb_util_defun_print _omb_prompt_{print,get}_rvm rvm
|
||||
_omb_util_defun_print _omb_prompt_{print,get}_chruby chruby
|
||||
_omb_util_defun_print _omb_prompt_{print,get}_ruby_env ruby_env
|
||||
|
||||
_omb_util_defun_deprecate 20000 rbfu_version_prompt _omb_prompt_print_rbfu
|
||||
_omb_util_defun_deprecate 20000 rbenv_version_prompt _omb_prompt_print_rbenv
|
||||
_omb_util_defun_deprecate 20000 rvm_version_prompt _omb_prompt_print_rvm
|
||||
_omb_util_defun_deprecate 20000 chruby_version_prompt _omb_prompt_print_chruby
|
||||
_omb_util_defun_deprecate 20000 ruby_version_prompt _omb_prompt_print_ruby_env
|
||||
_omb_deprecate_function 20000 rbfu_version_prompt _omb_prompt_print_rbfu
|
||||
_omb_deprecate_function 20000 rbenv_version_prompt _omb_prompt_print_rbenv
|
||||
_omb_deprecate_function 20000 rvm_version_prompt _omb_prompt_print_rvm
|
||||
_omb_deprecate_function 20000 chruby_version_prompt _omb_prompt_print_chruby
|
||||
_omb_deprecate_function 20000 ruby_version_prompt _omb_prompt_print_ruby_env
|
||||
|
||||
function _omb_prompt_get_virtualenv {
|
||||
virtualenv=
|
||||
@@ -484,10 +487,10 @@ _omb_util_defun_print _omb_prompt_{print,get}_python_version python_version
|
||||
_omb_util_defun_print _omb_prompt_{print,get}_python_venv python_venv
|
||||
_omb_util_defun_print _omb_prompt_{print,get}_python_env python_env
|
||||
|
||||
_omb_util_defun_deprecate 20000 virtualenv_prompt _omb_prompt_print_virtualenv
|
||||
_omb_util_defun_deprecate 20000 condaenv_prompt _omb_prompt_print_condaenv
|
||||
_omb_util_defun_deprecate 20000 py_interp_prompt _omb_prompt_print_python_version
|
||||
_omb_util_defun_deprecate 20000 python_version_prompt _omb_prompt_print_python_env
|
||||
_omb_deprecate_function 20000 virtualenv_prompt _omb_prompt_print_virtualenv
|
||||
_omb_deprecate_function 20000 condaenv_prompt _omb_prompt_print_condaenv
|
||||
_omb_deprecate_function 20000 py_interp_prompt _omb_prompt_print_python_version
|
||||
_omb_deprecate_function 20000 python_version_prompt _omb_prompt_print_python_env
|
||||
|
||||
function git_user_info {
|
||||
# support two or more initials, set by 'git pair' plugin
|
||||
@@ -499,7 +502,7 @@ function git_user_info {
|
||||
|
||||
function clock_char {
|
||||
CLOCK_CHAR=${THEME_CLOCK_CHAR:-"⌚"}
|
||||
CLOCK_CHAR_COLOR=${THEME_CLOCK_CHAR_COLOR:-"$normal"}
|
||||
CLOCK_CHAR_COLOR=${THEME_CLOCK_CHAR_COLOR:-"$_omb_prompt_normal"}
|
||||
SHOW_CLOCK_CHAR=${THEME_SHOW_CLOCK_CHAR:-"true"}
|
||||
|
||||
if [[ "${SHOW_CLOCK_CHAR}" = "true" ]]; then
|
||||
@@ -508,7 +511,7 @@ function clock_char {
|
||||
}
|
||||
|
||||
function clock_prompt {
|
||||
CLOCK_COLOR=${THEME_CLOCK_COLOR:-"$normal"}
|
||||
CLOCK_COLOR=${THEME_CLOCK_COLOR:-"$_omb_prompt_normal"}
|
||||
CLOCK_FORMAT=${THEME_CLOCK_FORMAT:-"%H:%M:%S"}
|
||||
[ -z $THEME_SHOW_CLOCK ] && THEME_SHOW_CLOCK=${THEME_CLOCK_CHECK:-"true"}
|
||||
SHOW_CLOCK=$THEME_SHOW_CLOCK
|
||||
@@ -552,7 +555,7 @@ function prompt_char {
|
||||
|
||||
function battery_char {
|
||||
if [[ "${THEME_BATTERY_PERCENTAGE_CHECK}" = true ]]; then
|
||||
echo -e "${bold_red}$(battery_percentage)%"
|
||||
echo -e "${_omb_prompt_bold_brown}$(battery_percentage)%"
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -583,5 +586,5 @@ function aws_profile {
|
||||
|
||||
|
||||
# Returns true if $1 is a shell function.
|
||||
_omb_util_defun_deprecate 20000 fn_exists _omb_util_function_exists
|
||||
_omb_util_defun_deprecate 20000 safe_append_prompt_command _omb_util_add_prompt_command
|
||||
_omb_deprecate_function 20000 fn_exists _omb_util_function_exists
|
||||
_omb_deprecate_function 20000 safe_append_prompt_command _omb_util_add_prompt_command
|
||||
190
lib/omb-prompt-colors.sh
Normal file
190
lib/omb-prompt-colors.sh
Normal file
@@ -0,0 +1,190 @@
|
||||
#! bash oh-my-bash.module
|
||||
#
|
||||
# 2022-01-20 Koichi Murase: renamed from "themes/colours.theme.sh" to "lib/omb-prompt-colors.sh"
|
||||
|
||||
_omb_module_require lib:omb-deprecate
|
||||
|
||||
function _omb_theme__construct_sgr {
|
||||
out=
|
||||
local reset=
|
||||
while (($#)); do
|
||||
local next=$1; shift
|
||||
case $next in
|
||||
reset) reset=0 ;;
|
||||
bold) out=${out:+$out;}1 ;;
|
||||
faint) out=${out:+$out;}2 ;;
|
||||
italic) out=${out:+$out;}3 ;;
|
||||
underline) out=${out:+$out;}4 ;;
|
||||
negative) out=${out:+$out;}7 ;;
|
||||
crossed) out=${out:+$out;}8 ;;
|
||||
color)
|
||||
local color=$1; shift
|
||||
|
||||
local side=fg mode=normal
|
||||
case $1 in
|
||||
fg | bg) side=$1; shift ;;
|
||||
esac
|
||||
case $1 in
|
||||
normal | bright) mode=$1; shift ;;
|
||||
esac
|
||||
|
||||
local prefix=3
|
||||
case $side:$mode in
|
||||
fg:normal) prefix=3 ;;
|
||||
bg:normal) prefix=4 ;;
|
||||
fg:bright) prefix=9 ;;
|
||||
bg:bright) prefix=10 ;;
|
||||
esac
|
||||
|
||||
case $color in
|
||||
black) color=0 ;;
|
||||
red) color=1 ;;
|
||||
green) color=2 ;;
|
||||
yellow) color=3 ;;
|
||||
blue) color=4 ;;
|
||||
magenta) color=5 ;;
|
||||
cyan) color=6 ;;
|
||||
white) color=7 ;;
|
||||
rgb)
|
||||
local r=$1 g=$2 b=$3; shift 3
|
||||
if ((r == g && g == b)); then
|
||||
# gray range above 232
|
||||
color=$((232 + r / 11))
|
||||
else
|
||||
color="8;5;$(((r * 36 + b * 6 + g) / 51 + 16))"
|
||||
fi ;;
|
||||
*) printf '%s\n' "_omb_theme_color: unknown color '$color'" >&2
|
||||
continue ;;
|
||||
esac
|
||||
out=${out:+$out;}$prefix$color ;;
|
||||
'')
|
||||
out="${out:+$out;}$*" ;;
|
||||
*)
|
||||
printf '%s\n' "_omb_theme_color: unknown token '$next'" >&2 ;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [[ $reset ]]; then
|
||||
out=$reset${out:+;$out}
|
||||
fi
|
||||
}
|
||||
|
||||
function _omb_theme_color_prompt {
|
||||
local out
|
||||
_omb_theme__construct_sgr "$@"
|
||||
echo "\[\e[${out}m\]"
|
||||
}
|
||||
|
||||
function _omb_theme_color_echo {
|
||||
local out
|
||||
_omb_theme__construct_sgr "$@"
|
||||
echo "\033[${out}m"
|
||||
}
|
||||
|
||||
function _omb_prompt_color_initialize {
|
||||
_omb_prompt_normal='\[\e[0m\]'
|
||||
_omb_prompt_reset_color='\[\e[39m\]'
|
||||
|
||||
# used by themes/gallifrey
|
||||
_omb_prompt_bold='\[\e[1m\]'
|
||||
|
||||
local -a normal_colors=(black brown green olive navy purple teal silver)
|
||||
local -a bright_colors=(gray red lime yellow blue magenta cyan white)
|
||||
local index
|
||||
for ((index = 0; index < 8; index++)); do
|
||||
printf -v "_omb_prompt_${normal_colors[index]}" %s '\[\e[0;3'"$index"'m\]'
|
||||
printf -v "_omb_prompt_bold_${normal_colors[index]}" %s '\[\e[3'"$index"';1m\]'
|
||||
printf -v "_omb_prompt_underline_${normal_colors[index]}" %s '\[\e[3'"$index"';4m\]'
|
||||
printf -v "_omb_prompt_background_${normal_colors[index]}" %s '\[\e[4'"$index"'m\]'
|
||||
printf -v "_omb_prompt_${bright_colors[index]}" %s '\[\e[0;9'"$index"'m\]'
|
||||
printf -v "_omb_prompt_bold_${bright_colors[index]}" %s '\[\e[9'"$index"';1m\]'
|
||||
printf -v "_omb_prompt_underline_${bright_colors[index]}" %s '\[\e[9'"$index"';4m\]'
|
||||
printf -v "_omb_prompt_background_${bright_colors[index]}" %s '\[\e[10'"$index"'m\]'
|
||||
done
|
||||
}
|
||||
_omb_prompt_color_initialize
|
||||
|
||||
|
||||
_omb_deprecate_function 20000 color _omb_theme_color_prompt
|
||||
_omb_deprecate_function 20000 echo_color _omb_theme_color_echo
|
||||
|
||||
_omb_deprecate_const 20000 black "$_omb_prompt_black" "${_omb_deprecate_msg_please_use/'%s'/_omb_prompt_black}"
|
||||
_omb_deprecate_const 20000 cyan "$_omb_prompt_teal" "${_omb_deprecate_msg_please_use/'%s'/_omb_prompt_teal}"
|
||||
_omb_deprecate_const 20000 white "$_omb_prompt_white" "${_omb_deprecate_msg_please_use/'%s'/_omb_prompt_white}"
|
||||
_omb_deprecate_const 20000 orange "$_omb_prompt_red" "${_omb_deprecate_msg_please_use/'%s'/_omb_prompt_red}"
|
||||
|
||||
_omb_deprecate_const 20000 bold_black "$_omb_prompt_bold_black" "${_omb_deprecate_msg_please_use/'%s'/_omb_prompt_bold_black}"
|
||||
_omb_deprecate_const 20000 bold_red "$_omb_prompt_bold_brown" "${_omb_deprecate_msg_please_use/'%s'/_omb_prompt_bold_brown}"
|
||||
_omb_deprecate_const 20000 bold_green "$_omb_prompt_bold_green" "${_omb_deprecate_msg_please_use/'%s'/_omb_prompt_bold_green}"
|
||||
_omb_deprecate_const 20000 bold_yellow "$_omb_prompt_bold_olive" "${_omb_deprecate_msg_please_use/'%s'/_omb_prompt_bold_olive}"
|
||||
_omb_deprecate_const 20000 bold_blue "$_omb_prompt_bold_navy" "${_omb_deprecate_msg_please_use/'%s'/_omb_prompt_bold_navy}"
|
||||
_omb_deprecate_const 20000 bold_purple "$_omb_prompt_bold_purple" "${_omb_deprecate_msg_please_use/'%s'/_omb_prompt_bold_purple}"
|
||||
_omb_deprecate_const 20000 bold_cyan "$_omb_prompt_bold_teal" "${_omb_deprecate_msg_please_use/'%s'/_omb_prompt_bold_teal}"
|
||||
_omb_deprecate_const 20000 bold_white "$_omb_prompt_bold_white" "${_omb_deprecate_msg_please_use/'%s'/_omb_prompt_bold_white}"
|
||||
_omb_deprecate_const 20000 bold_orange "$_omb_prompt_bold_red" "${_omb_deprecate_msg_please_use/'%s'/_omb_prompt_bold_red}"
|
||||
|
||||
_omb_deprecate_const 20000 underline_black "$_omb_prompt_underline_black" "${_omb_deprecate_msg_please_use/'%s'/_omb_prompt_underline_black}"
|
||||
_omb_deprecate_const 20000 underline_red "$_omb_prompt_underline_brown" "${_omb_deprecate_msg_please_use/'%s'/_omb_prompt_underline_brown}"
|
||||
_omb_deprecate_const 20000 underline_green "$_omb_prompt_underline_green" "${_omb_deprecate_msg_please_use/'%s'/_omb_prompt_underline_green}"
|
||||
_omb_deprecate_const 20000 underline_yellow "$_omb_prompt_underline_olive" "${_omb_deprecate_msg_please_use/'%s'/_omb_prompt_underline_olive}"
|
||||
_omb_deprecate_const 20000 underline_blue "$_omb_prompt_underline_navy" "${_omb_deprecate_msg_please_use/'%s'/_omb_prompt_underline_navy}"
|
||||
_omb_deprecate_const 20000 underline_purple "$_omb_prompt_underline_purple" "${_omb_deprecate_msg_please_use/'%s'/_omb_prompt_underline_purple}"
|
||||
_omb_deprecate_const 20000 underline_cyan "$_omb_prompt_underline_teal" "${_omb_deprecate_msg_please_use/'%s'/_omb_prompt_underline_teal}"
|
||||
_omb_deprecate_const 20000 underline_white "$_omb_prompt_underline_white" "${_omb_deprecate_msg_please_use/'%s'/_omb_prompt_underline_white}"
|
||||
_omb_deprecate_const 20000 underline_orange "$_omb_prompt_underline_red" "${_omb_deprecate_msg_please_use/'%s'/_omb_prompt_underline_red}"
|
||||
|
||||
_omb_deprecate_const 20000 background_black "$_omb_prompt_background_black" "${_omb_deprecate_msg_please_use/'%s'/_omb_prompt_background_black}"
|
||||
_omb_deprecate_const 20000 background_red "$_omb_prompt_background_brown" "${_omb_deprecate_msg_please_use/'%s'/_omb_prompt_background_brown}"
|
||||
_omb_deprecate_const 20000 background_green "$_omb_prompt_background_green" "${_omb_deprecate_msg_please_use/'%s'/_omb_prompt_background_green}"
|
||||
_omb_deprecate_const 20000 background_yellow "$_omb_prompt_background_olive" "${_omb_deprecate_msg_please_use/'%s'/_omb_prompt_background_olive}"
|
||||
_omb_deprecate_const 20000 background_blue "$_omb_prompt_background_navy" "${_omb_deprecate_msg_please_use/'%s'/_omb_prompt_background_navy}"
|
||||
_omb_deprecate_const 20000 background_purple "$_omb_prompt_background_purple" "${_omb_deprecate_msg_please_use/'%s'/_omb_prompt_background_purple}"
|
||||
_omb_deprecate_const 20000 background_cyan "$_omb_prompt_background_teal" "${_omb_deprecate_msg_please_use/'%s'/_omb_prompt_background_teal}"
|
||||
_omb_deprecate_const 20000 background_white "$_omb_prompt_background_white" "${_omb_deprecate_msg_please_use/'%s'/_omb_prompt_background_white}"
|
||||
_omb_deprecate_const 20000 background_orange "$_omb_prompt_background_red" "${_omb_deprecate_msg_please_use/'%s'/_omb_prompt_background_red}"
|
||||
|
||||
_omb_deprecate_const 20000 normal "$_omb_prompt_normal" "${_omb_deprecate_msg_please_use/'%s'/_omb_prompt_normal}"
|
||||
_omb_deprecate_const 20000 reset_color "$_omb_prompt_reset_color" "${_omb_deprecate_msg_please_use/'%s'/_omb_prompt_reset_color}"
|
||||
|
||||
_omb_deprecate_const 20000 echo_black "$_omb_term_black" "${_omb_deprecate_msg_please_use/'%s'/_omb_term_black}"
|
||||
_omb_deprecate_const 20000 echo_red "$_omb_term_brown" "${_omb_deprecate_msg_please_use/'%s'/_omb_term_brown}"
|
||||
_omb_deprecate_const 20000 echo_green "$_omb_term_green" "${_omb_deprecate_msg_please_use/'%s'/_omb_term_green}"
|
||||
_omb_deprecate_const 20000 echo_yellow "$_omb_term_olive" "${_omb_deprecate_msg_please_use/'%s'/_omb_term_olive}"
|
||||
_omb_deprecate_const 20000 echo_blue "$_omb_term_navy" "${_omb_deprecate_msg_please_use/'%s'/_omb_term_navy}"
|
||||
_omb_deprecate_const 20000 echo_purple "$_omb_term_purple" "${_omb_deprecate_msg_please_use/'%s'/_omb_term_purple}"
|
||||
_omb_deprecate_const 20000 echo_cyan "$_omb_term_teal" "${_omb_deprecate_msg_please_use/'%s'/_omb_term_teal}"
|
||||
_omb_deprecate_const 20000 echo_white "$_omb_term_white" "${_omb_deprecate_msg_please_use/'%s'/_omb_term_white}"
|
||||
_omb_deprecate_const 20000 echo_orange "$_omb_term_red" "${_omb_deprecate_msg_please_use/'%s'/_omb_term_red}"
|
||||
|
||||
_omb_deprecate_const 20000 echo_bold_black "$_omb_term_bold_black" "${_omb_deprecate_msg_please_use/'%s'/_omb_term_bold_black}"
|
||||
_omb_deprecate_const 20000 echo_bold_red "$_omb_term_bold_brown" "${_omb_deprecate_msg_please_use/'%s'/_omb_term_bold_brown}"
|
||||
_omb_deprecate_const 20000 echo_bold_green "$_omb_term_bold_green" "${_omb_deprecate_msg_please_use/'%s'/_omb_term_bold_green}"
|
||||
_omb_deprecate_const 20000 echo_bold_yellow "$_omb_term_bold_olive" "${_omb_deprecate_msg_please_use/'%s'/_omb_term_bold_olive}"
|
||||
_omb_deprecate_const 20000 echo_bold_blue "$_omb_term_bold_navy" "${_omb_deprecate_msg_please_use/'%s'/_omb_term_bold_navy}"
|
||||
_omb_deprecate_const 20000 echo_bold_purple "$_omb_term_bold_purple" "${_omb_deprecate_msg_please_use/'%s'/_omb_term_bold_purple}"
|
||||
_omb_deprecate_const 20000 echo_bold_cyan "$_omb_term_bold_teal" "${_omb_deprecate_msg_please_use/'%s'/_omb_term_bold_teal}"
|
||||
_omb_deprecate_const 20000 echo_bold_white "$_omb_term_bold_white" "${_omb_deprecate_msg_please_use/'%s'/_omb_term_bold_white}"
|
||||
_omb_deprecate_const 20000 echo_bold_orange "$_omb_term_bold_red" "${_omb_deprecate_msg_please_use/'%s'/_omb_term_bold_red}"
|
||||
|
||||
_omb_deprecate_const 20000 echo_underline_black "$_omb_term_underline_black" "${_omb_deprecate_msg_please_use/'%s'/_omb_term_underline_black}"
|
||||
_omb_deprecate_const 20000 echo_underline_red "$_omb_term_underline_brown" "${_omb_deprecate_msg_please_use/'%s'/_omb_term_underline_brown}"
|
||||
_omb_deprecate_const 20000 echo_underline_green "$_omb_term_underline_green" "${_omb_deprecate_msg_please_use/'%s'/_omb_term_underline_green}"
|
||||
_omb_deprecate_const 20000 echo_underline_yellow "$_omb_term_underline_olive" "${_omb_deprecate_msg_please_use/'%s'/_omb_term_underline_olive}"
|
||||
_omb_deprecate_const 20000 echo_underline_blue "$_omb_term_underline_navy" "${_omb_deprecate_msg_please_use/'%s'/_omb_term_underline_navy}"
|
||||
_omb_deprecate_const 20000 echo_underline_purple "$_omb_term_underline_purple" "${_omb_deprecate_msg_please_use/'%s'/_omb_term_underline_purple}"
|
||||
_omb_deprecate_const 20000 echo_underline_cyan "$_omb_term_underline_teal" "${_omb_deprecate_msg_please_use/'%s'/_omb_term_underline_teal}"
|
||||
_omb_deprecate_const 20000 echo_underline_white "$_omb_term_underline_white" "${_omb_deprecate_msg_please_use/'%s'/_omb_term_underline_white}"
|
||||
_omb_deprecate_const 20000 echo_underline_orange "$_omb_term_underline_red" "${_omb_deprecate_msg_please_use/'%s'/_omb_term_underline_red}"
|
||||
|
||||
_omb_deprecate_const 20000 echo_background_black "$_omb_term_background_black" "${_omb_deprecate_msg_please_use/'%s'/_omb_term_background_black}"
|
||||
_omb_deprecate_const 20000 echo_background_red "$_omb_term_background_brown" "${_omb_deprecate_msg_please_use/'%s'/_omb_term_background_brown}"
|
||||
_omb_deprecate_const 20000 echo_background_green "$_omb_term_background_green" "${_omb_deprecate_msg_please_use/'%s'/_omb_term_background_green}"
|
||||
_omb_deprecate_const 20000 echo_background_yellow "$_omb_term_background_olive" "${_omb_deprecate_msg_please_use/'%s'/_omb_term_background_olive}"
|
||||
_omb_deprecate_const 20000 echo_background_blue "$_omb_term_background_navy" "${_omb_deprecate_msg_please_use/'%s'/_omb_term_background_navy}"
|
||||
_omb_deprecate_const 20000 echo_background_purple "$_omb_term_background_purple" "${_omb_deprecate_msg_please_use/'%s'/_omb_term_background_purple}"
|
||||
_omb_deprecate_const 20000 echo_background_cyan "$_omb_term_background_teal" "${_omb_deprecate_msg_please_use/'%s'/_omb_term_background_teal}"
|
||||
_omb_deprecate_const 20000 echo_background_white "$_omb_term_background_white" "${_omb_deprecate_msg_please_use/'%s'/_omb_term_background_white}"
|
||||
_omb_deprecate_const 20000 echo_background_orange "$_omb_term_background_red" "${_omb_deprecate_msg_please_use/'%s'/_omb_term_background_red}"
|
||||
|
||||
_omb_deprecate_const 20000 echo_normal "$_omb_term_normal" "${_omb_deprecate_msg_please_use/'%s'/_omb_term_normal}"
|
||||
_omb_deprecate_const 20000 echo_reset_color "$_omb_term_reset_color" "${_omb_deprecate_msg_please_use/'%s'/_omb_term_reset_color}"
|
||||
@@ -3,46 +3,61 @@
|
||||
# P.C. Shyamshankar <sykora@lucentbeing.com>
|
||||
# Copied from http://github.com/sykora/etc/blob/master/zsh/functions/spectrum/
|
||||
|
||||
_omb_module_require lib:omb-deprecate
|
||||
_omb_module_require lib:omb-prompt-colors
|
||||
|
||||
# typeset in bash does not have associative arrays, declare does in bash 4.0+
|
||||
# https://stackoverflow.com/a/6047948
|
||||
|
||||
# This library only works for BASH 4.x to keep the minimum compatible for macOS.
|
||||
# This library only works for BASH 4.x to keep the minimum compatibility for macOS.
|
||||
# shellcheck disable=SC2034
|
||||
if [ "${BASH_VERSINFO[0]}" -gt 4 ]; then
|
||||
_RED='\033[0;31m' # Red Color (For error)
|
||||
_NC='\033[0m' # No Color (To reset the terminal color)
|
||||
|
||||
declare -Ag FX FG BG
|
||||
|
||||
FX=(
|
||||
[reset]="%{^[[00m%}"
|
||||
[bold]="%{^[[01m%}" [no-bold]="%{^[[22m%}"
|
||||
[italic]="%{^[[03m%}" [no-italic]="%{^[[23m%}"
|
||||
[underline]="%{^[[04m%}" [no-underline]="%{^[[24m%}"
|
||||
[blink]="%{^[[05m%}" [no-blink]="%{^[[25m%}"
|
||||
[reverse]="%{^[[07m%}" [no-reverse]="%{^[[27m%}"
|
||||
)
|
||||
|
||||
for color in {000..255}; do
|
||||
FG[$color]="%{^[[38;5;${color}m%}"
|
||||
BG[$color]="%{^[[48;5;${color}m%}"
|
||||
done
|
||||
|
||||
|
||||
OSH_SPECTRUM_TEXT=${OSH_SPECTRUM_TEXT:-Arma virumque cano Troiae qui primus ab oris}
|
||||
|
||||
# Show all 256 colors with color number
|
||||
function spectrum_ls() {
|
||||
for code in {000..255}; do
|
||||
print -P -- "$code: %{$FG[$code]%}$OSH_SPECTRUM_TEXT%{$reset_color%}"
|
||||
if ((_omb_bash_version >= 40000)); then
|
||||
declare -gA _omb_spectrum_fx=()
|
||||
declare -gA _omb_spectrum_fg=()
|
||||
declare -gA _omb_spectrum_bg=()
|
||||
function _omb_spectrum__initialize() {
|
||||
_omb_spectrum_fx=(
|
||||
[reset]=$'\e[00m'
|
||||
[bold]=$'\e[01m' [no-bold]=$'\e[22m'
|
||||
[italic]=$'\e[03m' [no-italic]=$'\e[23m'
|
||||
[underline]=$'\e[04m' [no-underline]=$'\e[24m'
|
||||
[blink]=$'\e[05m' [no-blink]=$'\e[25m'
|
||||
[reverse]=$'\e[07m' [no-reverse]=$'\e[27m'
|
||||
)
|
||||
local color
|
||||
for color in {000..255}; do
|
||||
_omb_spectrum_fg[$color]=$'\e[38;5;'${color}'m'
|
||||
_omb_spectrum_bg[$color]=$'\e[48;5;'${color}'m'
|
||||
done
|
||||
}
|
||||
_omb_spectrum__initialize
|
||||
|
||||
# Show all 256 colors where the background is set to specific color
|
||||
function spectrum_bls() {
|
||||
for code in {000..255}; do
|
||||
print -P -- "$code: %{$BG[$code]%}$OSH_SPECTRUM_TEXT%{$reset_color%}"
|
||||
done
|
||||
declare -gA FX FG BG
|
||||
_omb_deprecate_const 20000 _RED "$_omb_term_brown" "${_omb_deprecate_msg_please_use/'%s'/_omb_term_brown}"
|
||||
_omb_deprecate_const 20000 _NC "$_omb_term_reset" "${_omb_deprecate_msg_please_use/'%s'/_omb_term_reset}"
|
||||
function _omb_spectrum__deprecate() {
|
||||
local key
|
||||
for key in "${!_omb_spectrum_fx[@]}"; do FX[$key]=${_omb_spectrum_fx[$key]}; done
|
||||
for key in "${!_omb_spectrum_fg[@]}"; do FG[$key]=${_omb_spectrum_fg[$key]}; done
|
||||
for key in "${!_omb_spectrum_bg[@]}"; do BG[$key]=${_omb_spectrum_bg[$key]}; done
|
||||
}
|
||||
_omb_spectrum__deprecate
|
||||
fi
|
||||
|
||||
OSH_SPECTRUM_TEXT=${OSH_SPECTRUM_TEXT:-Arma virumque cano Troiae qui primus ab oris}
|
||||
|
||||
# Show all 256 colors with color number
|
||||
function spectrum_ls() {
|
||||
local code
|
||||
for code in {000..255}; do
|
||||
printf '%s: \e[38;5;%sm%s%s\n' "$code" "$code" "$OSH_SPECTRUM_TEXT" "$_omb_term_reset"
|
||||
done
|
||||
}
|
||||
|
||||
# Show all 256 colors where the background is set to specific color
|
||||
function spectrum_bls() {
|
||||
local code
|
||||
for code in {000..255}; do
|
||||
printf '%s: \e[48;5;%sm%s%s\n' "$code" "$code" "$OSH_SPECTRUM_TEXT" "$_omb_term_reset"
|
||||
done
|
||||
}
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
#
|
||||
# Examples
|
||||
#
|
||||
# echo -ne "${fg[red]}I am running..."
|
||||
# echo -ne "${_omb_term_brown}I am running..."
|
||||
# ( my_long_task_running ) &
|
||||
# spinner
|
||||
# echo -ne "...${reset_color} ${fg[green]}DONE${reset_color}"
|
||||
# echo -ne "...${_omb_term_reset} ${_omb_term_green}DONE${_omb_term_reset}"
|
||||
#
|
||||
|
||||
# This spinner is used when there is a terminal.
|
||||
|
||||
150
lib/utils.sh
150
lib/utils.sh
@@ -80,21 +80,6 @@ function _omb_util_defun_print {
|
||||
builtin eval -- "function $1 { local $3; $2 \"\$@\" && printf '%s\n' \"\${$3}\"; }"
|
||||
}
|
||||
|
||||
function __omb_util_defun_deprecate__message {
|
||||
local old=$1 new=$2
|
||||
local v=__omb_util_DeprecateFunction_$old; v=${v//[!a-zA-Z0-9_]/'_'}
|
||||
[[ ${!v+set} ]] && return 0
|
||||
printf 'warning (oh-my-bash): %s\n' "\`$old' is deprecated. Use \`$new'." >&2
|
||||
printf -v "$v" done
|
||||
}
|
||||
|
||||
function _omb_util_defun_deprecate {
|
||||
local warning=
|
||||
((_omb_version >= $1)) &&
|
||||
warning='__omb_util_defun_deprecate__message "$2" "$3"; '
|
||||
builtin eval -- "function $2 { $warning$3 \"\$@\"; }"
|
||||
}
|
||||
|
||||
#
|
||||
# Test whether a command---either an alias, a keyword, a function, a builtin,
|
||||
# or a file---is defined.
|
||||
@@ -135,48 +120,115 @@ _omb_util_function_exists() {
|
||||
declare -F "$@" &>/dev/null # bash-3.2
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Set Colors
|
||||
#
|
||||
# Use colors, but only if connected to a terminal, and that terminal
|
||||
# supports them.
|
||||
if which tput >/dev/null 2>&1; then
|
||||
ncolors=$(tput colors)
|
||||
fi
|
||||
if [[ -t 1 && $ncolors && ncolors -ge 8 ]]; then
|
||||
bold=$(tput bold 2>/dev/null || tput md 2>/dev/null)
|
||||
underline=$(tput smul 2>/dev/null || tput ul 2>/dev/null)
|
||||
reset=$(tput sgr0 2>/dev/null || tput me 2>/dev/null)
|
||||
red=$(tput setaf 1 2>/dev/null || tput AF 1 2>/dev/null)
|
||||
green=$(tput setaf 2 2>/dev/null || tput AF 2 2>/dev/null)
|
||||
yellow=$(tput setaf 3 2>/dev/null || tput AF 3 2>/dev/null)
|
||||
blue=$(tput setaf 4 2>/dev/null || tput AF 4 2>/dev/null)
|
||||
purple=$(tput setaf 171 2>/dev/null || tput AF 171 2>/dev/null)
|
||||
tan=$(tput setaf 3 2>/dev/null || tput AF 3 2>/dev/null)
|
||||
else
|
||||
bold=""
|
||||
underline=""
|
||||
reset=""
|
||||
red=""
|
||||
green=""
|
||||
yellow=""
|
||||
blue=""
|
||||
purple=""
|
||||
tan=""
|
||||
fi
|
||||
# supports them. These colors are intended to be used with `echo`
|
||||
#
|
||||
_omb_term_color_initialize() {
|
||||
local name
|
||||
local -a normal_colors=(black brown green olive navy purple teal silver)
|
||||
local -a bright_colors=(gray red lime yellow blue magenta cyan white)
|
||||
|
||||
if [[ ! -t 1 ]]; then
|
||||
_omb_term_colors=
|
||||
_omb_term_bold=
|
||||
_omb_term_underline=
|
||||
_omb_term_reset=
|
||||
_omb_term_normal=
|
||||
_omb_term_reset_color=
|
||||
for name in "${normal_colors[@]}" "${bright_colors[@]}" violet; do
|
||||
printf -v "_omb_term_$name" ''
|
||||
printf -v "_omb_term_background_$name" ''
|
||||
printf -v "_omb_term_bold_$name" ''
|
||||
printf -v "_omb_term_underline_$name" ''
|
||||
done
|
||||
return 0
|
||||
fi
|
||||
|
||||
if _omb_util_binary_exists tput; then
|
||||
_omb_term_colors=$(tput colors 2>/dev/null || tput Co 2>/dev/null)
|
||||
_omb_term_bold=$(tput bold 2>/dev/null || tput md 2>/dev/null)
|
||||
_omb_term_underline=$(tput smul 2>/dev/null || tput ul 2>/dev/null)
|
||||
_omb_term_reset=$(tput sgr0 2>/dev/null || tput me 2>/dev/null)
|
||||
else
|
||||
_omb_term_colors=
|
||||
_omb_term_bold=$'\e[1m'
|
||||
_omb_term_underline=$'\e[4m'
|
||||
_omb_term_reset=$'\e[0m'
|
||||
fi
|
||||
_omb_term_normal=$'\e[0m'
|
||||
_omb_term_reset_color=$'\e[39m'
|
||||
|
||||
# normal colors
|
||||
if ((_omb_term_colors >= 8)); then
|
||||
local index
|
||||
for ((index = 0; index < 8; index++)); do
|
||||
local fg=$(tput setaf "$index" 2>/dev/null || tput AF "$index" 2>/dev/null)
|
||||
[[ $fg ]] || fg=$'\e[3'$index'm'
|
||||
printf -v "_omb_term_${normal_colors[index]}" %s "$fg"
|
||||
printf -v "_omb_term_background_${normal_colors[index]}" '\e[4%sm' "$index"
|
||||
done
|
||||
else
|
||||
local index
|
||||
for ((index = 0; index < 8; index++)); do
|
||||
printf -v "_omb_term_${normal_colors[index]}" '\e[3%sm' "$index"
|
||||
printf -v "_omb_term_background_${normal_colors[index]}" '\e[4%sm' "$index"
|
||||
done
|
||||
fi
|
||||
|
||||
# bright colors
|
||||
if ((_omb_term_colors >= 16)); then
|
||||
local index
|
||||
for ((index = 0; index < 8; index++)); do
|
||||
local fg=$(tput setaf $((index+8)) 2>/dev/null || tput AF $((index+8)) 2>/dev/null)
|
||||
[[ $fg ]] || fg=$'\e[9'$index'm'
|
||||
local refbg=_omb_term_background_${normal_colors[index]}
|
||||
local bg=${!refbg}$'\e[10'$index'm'
|
||||
printf -v "_omb_term_${bright_colors[index]}" %s "$fg"
|
||||
printf -v "_omb_term_background_${bright_colors[index]}" %s "$bg"
|
||||
done
|
||||
else
|
||||
# copy normal colors to bright colors (with bold)
|
||||
local index
|
||||
for ((index = 0; index < 8; index++)); do
|
||||
local reffg=_omb_term_${normal_colors[index]}
|
||||
local refbg=_omb_term_background_${normal_colors[index]}
|
||||
printf -v "_omb_term_${bright_colors[index]}" %s "$_omb_term_bold${!reffg}"
|
||||
printf -v "_omb_term_background_${bright_colors[index]}" %s "$_omb_term_bold${!refbg}"
|
||||
done
|
||||
fi
|
||||
|
||||
# index colors
|
||||
if ((_omb_term_colors == 256)); then
|
||||
_omb_term_violet=$'\e[38;5;171m'
|
||||
_omb_term_background_violet=$'\e[48;5;171m'
|
||||
else
|
||||
_omb_term_violet=$_omb_term_purple
|
||||
_omb_term_background_violet=$_omb_term_background_purple
|
||||
fi
|
||||
|
||||
# bold / underline versions
|
||||
for name in "${normal_colors[@]}" "${bright_colors[@]}" violet; do
|
||||
local ref=_omb_term_$name
|
||||
printf -v "_omb_term_bold_$name" %s "$_omb_term_bold${!ref}"
|
||||
printf -v "_omb_term_underline_$name" %s "$_omb_term_underline${!ref}"
|
||||
done
|
||||
}
|
||||
_omb_term_color_initialize
|
||||
|
||||
#
|
||||
# Headers and Logging
|
||||
#
|
||||
_omb_log_header() { printf "\n${bold}${purple}========== %s ==========${reset}\n" "$@"; }
|
||||
_omb_log_header() { printf "\n${_omb_term_bold}${_omb_term_violet}========== %s ==========${_omb_term_reset}\n" "$@"; }
|
||||
_omb_log_arrow() { printf "➜ %s\n" "$@"; }
|
||||
_omb_log_success() { printf "${green}✔ %s${reset}\n" "$@"; }
|
||||
_omb_log_error() { printf "${red}✖ %s${reset}\n" "$@"; }
|
||||
_omb_log_warning() { printf "${tan}➜ %s${reset}\n" "$@"; }
|
||||
_omb_log_underline() { printf "${underline}${bold}%s${reset}\n" "$@"; }
|
||||
_omb_log_bold() { printf "${bold}%s${reset}\n" "$@"; }
|
||||
_omb_log_note() { printf "${underline}${bold}${blue}Note:${reset} ${yellow}%s${reset}\n" "$@"; }
|
||||
_omb_log_success() { printf "${_omb_term_green}✔ %s${_omb_term_reset}\n" "$@"; }
|
||||
_omb_log_error() { printf "${_omb_term_brown}✖ %s${_omb_term_reset}\n" "$@"; }
|
||||
_omb_log_warning() { printf "${_omb_term_olive}➜ %s${_omb_term_reset}\n" "$@"; }
|
||||
_omb_log_underline() { printf "${_omb_term_underline}${_omb_term_bold}%s${_omb_term_reset}\n" "$@"; }
|
||||
_omb_log_bold() { printf "${_omb_term_bold}%s${_omb_term_reset}\n" "$@"; }
|
||||
_omb_log_note() { printf "${_omb_term_underline}${_omb_term_bold}${_omb_term_navy}Note:${_omb_term_reset} ${_omb_term_olive}%s${_omb_term_reset}\n" "$@"; }
|
||||
|
||||
#
|
||||
# USAGE FOR SEEKING CONFIRMATION
|
||||
@@ -190,7 +242,7 @@ _omb_log_note() { printf "${underline}${bold}${blue}Note:${reset} ${yellow
|
||||
# fi
|
||||
#
|
||||
seek_confirmation() {
|
||||
printf "\\n${bold}%s${reset}" "$@"
|
||||
printf "\\n${_omb_term_bold}%s${_omb_term_reset}" "$@"
|
||||
read -p " (y/n) " -n 1
|
||||
printf "\\n"
|
||||
}
|
||||
|
||||
@@ -96,7 +96,6 @@ _omb_module_require_theme() { _omb_module_require "${@/#/theme:}"; }
|
||||
# Load all of the config files in ~/.oh-my-bash/lib that end in .sh
|
||||
# TIP: Add files you don't want in git to .gitignore
|
||||
_omb_module_require_lib utils
|
||||
_omb_module_require_lib omb-deprecate
|
||||
_omb_util_glob_expand _omb_init_files '{"$OSH","$OSH_CUSTOM"}/lib/*.{bash,sh}'
|
||||
_omb_init_files=("${_omb_init_files[@]##*/}")
|
||||
_omb_init_files=("${_omb_init_files[@]%.bash}")
|
||||
@@ -129,10 +128,6 @@ for _omb_init_file in "${_omb_init_files[@]}"; do
|
||||
done
|
||||
unset -v _omb_init_files _omb_init_file
|
||||
|
||||
# Load colors first so they can be use in base theme
|
||||
source "${OSH}/themes/colours.theme.sh"
|
||||
source "${OSH}/themes/base.theme.sh"
|
||||
|
||||
# Load the theme
|
||||
if [[ $OSH_THEME == random ]]; then
|
||||
_omb_util_glob_expand _omb_init_files '"$OSH"/themes/*/*.theme.sh'
|
||||
|
||||
@@ -39,9 +39,6 @@ if [ ! -n "$SDIRS" ]; then
|
||||
fi
|
||||
touch $SDIRS
|
||||
|
||||
RED="0;31m"
|
||||
GREEN="0;33m"
|
||||
|
||||
# main function
|
||||
function bm {
|
||||
option="${1}"
|
||||
@@ -125,9 +122,9 @@ function _goto_bookmark {
|
||||
if [ -d "$target" ]; then
|
||||
cd "$target"
|
||||
elif [ ! -n "$target" ]; then
|
||||
echo -e "\033[${RED}WARNING: '${1}' bashmark does not exist\033[00m"
|
||||
printf '%s\n' "${_omb_term_brown}WARNING: '${1}' bashmark does not exist${_omb_term_reset}"
|
||||
else
|
||||
echo -e "\033[${RED}WARNING: '${target}' does not exist\033[00m"
|
||||
printf '%s\n' "${_omb_term_brown}WARNING: '${target}' does not exist${_omb_term_reset}"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
@@ -137,10 +137,10 @@ battery_charge(){
|
||||
local F_C='▸'
|
||||
# Depleted char
|
||||
local D_C='▹'
|
||||
local DEPLETED_COLOR="${normal}"
|
||||
local FULL_COLOR="${green}"
|
||||
local HALF_COLOR="${yellow}"
|
||||
local DANGER_COLOR="${red}"
|
||||
local DEPLETED_COLOR="${_omb_prompt_normal}"
|
||||
local FULL_COLOR="${_omb_prompt_green}"
|
||||
local HALF_COLOR="${_omb_prompt_olive}"
|
||||
local DANGER_COLOR="${_omb_prompt_brown}"
|
||||
local BATTERY_OUTPUT="${DEPLETED_COLOR}${D_C}${D_C}${D_C}${D_C}${D_C}"
|
||||
local BATTERY_PERC=$(battery_percentage)
|
||||
|
||||
@@ -149,49 +149,49 @@ battery_charge(){
|
||||
echo ""
|
||||
;;
|
||||
9*)
|
||||
echo "${FULL_COLOR}${F_C}${F_C}${F_C}${F_C}${F_C}${normal}"
|
||||
echo "${FULL_COLOR}${F_C}${F_C}${F_C}${F_C}${F_C}${_omb_prompt_normal}"
|
||||
;;
|
||||
8*)
|
||||
echo "${FULL_COLOR}${F_C}${F_C}${F_C}${F_C}${HALF_COLOR}${F_C}${normal}"
|
||||
echo "${FULL_COLOR}${F_C}${F_C}${F_C}${F_C}${HALF_COLOR}${F_C}${_omb_prompt_normal}"
|
||||
;;
|
||||
7*)
|
||||
echo "${FULL_COLOR}${F_C}${F_C}${F_C}${F_C}${DEPLETED_COLOR}${D_C}${normal}"
|
||||
echo "${FULL_COLOR}${F_C}${F_C}${F_C}${F_C}${DEPLETED_COLOR}${D_C}${_omb_prompt_normal}"
|
||||
;;
|
||||
6*)
|
||||
echo "${FULL_COLOR}${F_C}${F_C}${F_C}${HALF_COLOR}${F_C}${DEPLETED_COLOR}${D_C}${normal}"
|
||||
echo "${FULL_COLOR}${F_C}${F_C}${F_C}${HALF_COLOR}${F_C}${DEPLETED_COLOR}${D_C}${_omb_prompt_normal}"
|
||||
;;
|
||||
5*)
|
||||
echo "${FULL_COLOR}${F_C}${F_C}${F_C}${DEPLETED_COLOR}${D_C}${D_C}${normal}"
|
||||
echo "${FULL_COLOR}${F_C}${F_C}${F_C}${DEPLETED_COLOR}${D_C}${D_C}${_omb_prompt_normal}"
|
||||
;;
|
||||
4*)
|
||||
echo "${FULL_COLOR}${F_C}${F_C}${HALF_COLOR}${F_C}${DEPLETED_COLOR}${D_C}${D_C}${normal}"
|
||||
echo "${FULL_COLOR}${F_C}${F_C}${HALF_COLOR}${F_C}${DEPLETED_COLOR}${D_C}${D_C}${_omb_prompt_normal}"
|
||||
;;
|
||||
3*)
|
||||
echo "${FULL_COLOR}${F_C}${F_C}${DEPLETED_COLOR}${D_C}${D_C}${D_C}${normal}"
|
||||
echo "${FULL_COLOR}${F_C}${F_C}${DEPLETED_COLOR}${D_C}${D_C}${D_C}${_omb_prompt_normal}"
|
||||
;;
|
||||
2*)
|
||||
echo "${FULL_COLOR}${F_C}${HALF_COLOR}${F_C}${DEPLETED_COLOR}${D_C}${D_C}${D_C}${normal}"
|
||||
echo "${FULL_COLOR}${F_C}${HALF_COLOR}${F_C}${DEPLETED_COLOR}${D_C}${D_C}${D_C}${_omb_prompt_normal}"
|
||||
;;
|
||||
1*)
|
||||
echo "${FULL_COLOR}${F_C}${DEPLETED_COLOR}${D_C}${D_C}${D_C}${D_C}${normal}"
|
||||
echo "${FULL_COLOR}${F_C}${DEPLETED_COLOR}${D_C}${D_C}${D_C}${D_C}${_omb_prompt_normal}"
|
||||
;;
|
||||
05)
|
||||
echo "${DANGER_COLOR}${F_C}${DEPLETED_COLOR}${D_C}${D_C}${D_C}${D_C}${normal}"
|
||||
echo "${DANGER_COLOR}${F_C}${DEPLETED_COLOR}${D_C}${D_C}${D_C}${D_C}${_omb_prompt_normal}"
|
||||
;;
|
||||
04)
|
||||
echo "${DANGER_COLOR}${F_C}${DEPLETED_COLOR}${D_C}${D_C}${D_C}${D_C}${normal}"
|
||||
echo "${DANGER_COLOR}${F_C}${DEPLETED_COLOR}${D_C}${D_C}${D_C}${D_C}${_omb_prompt_normal}"
|
||||
;;
|
||||
03)
|
||||
echo "${DANGER_COLOR}${F_C}${DEPLETED_COLOR}${D_C}${D_C}${D_C}${D_C}${normal}"
|
||||
echo "${DANGER_COLOR}${F_C}${DEPLETED_COLOR}${D_C}${D_C}${D_C}${D_C}${_omb_prompt_normal}"
|
||||
;;
|
||||
02)
|
||||
echo "${DANGER_COLOR}${F_C}${DEPLETED_COLOR}${D_C}${D_C}${D_C}${D_C}${normal}"
|
||||
echo "${DANGER_COLOR}${F_C}${DEPLETED_COLOR}${D_C}${D_C}${D_C}${D_C}${_omb_prompt_normal}"
|
||||
;;
|
||||
0*)
|
||||
echo "${HALF_COLOR}${F_C}${DEPLETED_COLOR}${D_C}${D_C}${D_C}${D_C}${normal}"
|
||||
echo "${HALF_COLOR}${F_C}${DEPLETED_COLOR}${D_C}${D_C}${D_C}${D_C}${_omb_prompt_normal}"
|
||||
;;
|
||||
*)
|
||||
echo "${DANGER_COLOR}UNPLG${normal}"
|
||||
echo "${DANGER_COLOR}UNPLG${_omb_prompt_normal}"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
#! bash oh-my-bash.module
|
||||
SCM_THEME_PROMPT_DIRTY=" ${red}✗"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓"
|
||||
SCM_THEME_PROMPT_DIRTY=" ${_omb_prompt_brown}✗"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${_omb_prompt_bold_green}✓"
|
||||
SCM_THEME_PROMPT_PREFIX=" |"
|
||||
SCM_THEME_PROMPT_SUFFIX="${green}|"
|
||||
SCM_THEME_PROMPT_SUFFIX="${_omb_prompt_green}|"
|
||||
|
||||
GIT_THEME_PROMPT_DIRTY=" ${red}✗"
|
||||
GIT_THEME_PROMPT_CLEAN=" ${bold_green}✓"
|
||||
GIT_THEME_PROMPT_PREFIX=" ${green}|"
|
||||
GIT_THEME_PROMPT_SUFFIX="${green}|"
|
||||
GIT_THEME_PROMPT_DIRTY=" ${_omb_prompt_brown}✗"
|
||||
GIT_THEME_PROMPT_CLEAN=" ${_omb_prompt_bold_green}✓"
|
||||
GIT_THEME_PROMPT_PREFIX=" ${_omb_prompt_green}|"
|
||||
GIT_THEME_PROMPT_SUFFIX="${_omb_prompt_green}|"
|
||||
|
||||
# Nicely formatted terminal prompt
|
||||
function _omb_theme_PROMPT_COMMAND(){
|
||||
export PS1="\n${bold_black}[${blue}\@${bold_black}]-${bold_black}[${green}\u${yellow}@${green}\h${bold_black}]-${bold_black}[${purple}\w${bold_black}]-$(scm_prompt_info)\n${reset_color}\$ "
|
||||
export PS1="\n${_omb_prompt_bold_black}[${_omb_prompt_navy}\@${_omb_prompt_bold_black}]-${_omb_prompt_bold_black}[${_omb_prompt_green}\u${_omb_prompt_olive}@${_omb_prompt_green}\h${_omb_prompt_bold_black}]-${_omb_prompt_bold_black}[${_omb_prompt_purple}\w${_omb_prompt_bold_black}]-$(scm_prompt_info)\n${_omb_prompt_reset_color}\$ "
|
||||
}
|
||||
|
||||
_omb_util_add_prompt_command _omb_theme_PROMPT_COMMAND
|
||||
|
||||
@@ -37,6 +37,6 @@ function _omb_theme_PROMPT_COMMAND() {
|
||||
PS1="\[${BOLD}${MAGENTA}\]\u \[$WHITE\]@ \[$ORANGE\]\h \[$WHITE\]in \[$GREEN\]\w\[$WHITE\]\[$SCM_THEME_PROMPT_PREFIX\]$(clock_prompt) \[$PURPLE\]\$(scm_prompt_info) \n\$ \[$RESET\]"
|
||||
}
|
||||
|
||||
THEME_CLOCK_COLOR=${THEME_CLOCK_COLOR:-"${white}"}
|
||||
THEME_CLOCK_COLOR=${THEME_CLOCK_COLOR:-"${_omb_prompt_white}"}
|
||||
|
||||
_omb_util_add_prompt_command _omb_theme_PROMPT_COMMAND
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
#! bash oh-my-bash.module
|
||||
SCM_THEME_PROMPT_DIRTY=" ${red}✗"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓"
|
||||
SCM_THEME_PROMPT_DIRTY=" ${_omb_prompt_brown}✗"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${_omb_prompt_bold_green}✓"
|
||||
SCM_THEME_PROMPT_PREFIX=" |"
|
||||
SCM_THEME_PROMPT_SUFFIX="${green}|"
|
||||
SCM_THEME_PROMPT_SUFFIX="${_omb_prompt_green}|"
|
||||
|
||||
GIT_THEME_PROMPT_DIRTY=" ${red}✗"
|
||||
GIT_THEME_PROMPT_CLEAN=" ${bold_green}✓"
|
||||
GIT_THEME_PROMPT_PREFIX=" ${green}|"
|
||||
GIT_THEME_PROMPT_SUFFIX="${green}|"
|
||||
GIT_THEME_PROMPT_DIRTY=" ${_omb_prompt_brown}✗"
|
||||
GIT_THEME_PROMPT_CLEAN=" ${_omb_prompt_bold_green}✓"
|
||||
GIT_THEME_PROMPT_PREFIX=" ${_omb_prompt_green}|"
|
||||
GIT_THEME_PROMPT_SUFFIX="${_omb_prompt_green}|"
|
||||
|
||||
RVM_THEME_PROMPT_PREFIX="|"
|
||||
RVM_THEME_PROMPT_SUFFIX="|"
|
||||
|
||||
function _omb_theme_PROMPT_COMMAND() {
|
||||
#PS1="${bold_cyan}$(scm_char)${green}$(scm_prompt_info)${purple}$(_omb_prompt_print_ruby_env) ${yellow}\h ${reset_color}in ${green}\w ${reset_color}\n${green}→${reset_color} "
|
||||
#PS1="\n${purple}\h: ${reset_color} ${green}\w\n${bold_cyan}$(scm_char)${green}$(scm_prompt_info) ${green}→${reset_color} "
|
||||
#PS1="\n${cyan}\h: ${reset_color} ${yellow}\w\n${red}$(scm_char)${red}$(scm_prompt_info) ${green}→${reset_color} "
|
||||
PS1="\n${cyan}\h: ${reset_color} ${yellow}\w ${green}$(scm_prompt_info)\n${reset_color}→ "
|
||||
#PS1="${_omb_prompt_bold_teal}$(scm_char)${_omb_prompt_green}$(scm_prompt_info)${_omb_prompt_purple}$(_omb_prompt_print_ruby_env) ${_omb_prompt_olive}\h ${_omb_prompt_reset_color}in ${_omb_prompt_green}\w ${_omb_prompt_reset_color}\n${_omb_prompt_green}→${_omb_prompt_reset_color} "
|
||||
#PS1="\n${_omb_prompt_purple}\h: ${_omb_prompt_reset_color} ${_omb_prompt_green}\w\n${_omb_prompt_bold_teal}$(scm_char)${_omb_prompt_green}$(scm_prompt_info) ${_omb_prompt_green}→${_omb_prompt_reset_color} "
|
||||
#PS1="\n${_omb_prompt_teal}\h: ${_omb_prompt_reset_color} ${_omb_prompt_olive}\w\n${_omb_prompt_brown}$(scm_char)${_omb_prompt_brown}$(scm_prompt_info) ${_omb_prompt_green}→${_omb_prompt_reset_color} "
|
||||
PS1="\n${_omb_prompt_teal}\h: ${_omb_prompt_reset_color} ${_omb_prompt_olive}\w ${_omb_prompt_green}$(scm_prompt_info)\n${_omb_prompt_reset_color}→ "
|
||||
}
|
||||
|
||||
_omb_util_add_prompt_command _omb_theme_PROMPT_COMMAND
|
||||
|
||||
@@ -30,10 +30,10 @@ function set_host_color() {
|
||||
function set_user_color() {
|
||||
case $(id -u) in
|
||||
0)
|
||||
printf "${red}"
|
||||
printf "${_omb_prompt_brown}"
|
||||
;;
|
||||
*)
|
||||
printf "${cyan}"
|
||||
printf "${_omb_prompt_teal}"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
@@ -63,21 +63,21 @@ function set_custom_colors() {
|
||||
}
|
||||
|
||||
__ps_time() {
|
||||
echo "$(clock_prompt)${normal}\n"
|
||||
echo "$(clock_prompt)${_omb_prompt_normal}\n"
|
||||
}
|
||||
|
||||
function _omb_theme_PROMPT_COMMAND() {
|
||||
ps_reboot="${bright_yellow}$(show_reboot_required)${normal}\n"
|
||||
ps_reboot="${bright_yellow}$(show_reboot_required)${_omb_prompt_normal}\n"
|
||||
|
||||
ps_username="$(set_user_color)\u${normal}"
|
||||
ps_uh_separator="${dark_grey}@${normal}"
|
||||
ps_hostname="$(set_host_color)\h${normal}"
|
||||
ps_username="$(set_user_color)\u${_omb_prompt_normal}"
|
||||
ps_uh_separator="${dark_grey}@${_omb_prompt_normal}"
|
||||
ps_hostname="$(set_host_color)\h${_omb_prompt_normal}"
|
||||
|
||||
ps_path="${yellow}\w${normal}"
|
||||
ps_path="${_omb_prompt_olive}\w${_omb_prompt_normal}"
|
||||
ps_scm_prompt="${light_grey}$(scm_prompt)"
|
||||
|
||||
ps_user_mark="${normal} ${normal}"
|
||||
ps_user_input="${normal}"
|
||||
ps_user_mark="${_omb_prompt_normal} ${_omb_prompt_normal}"
|
||||
ps_user_input="${_omb_prompt_normal}"
|
||||
|
||||
# Set prompt
|
||||
PS1="$ps_reboot$(__ps_time)$ps_username$ps_uh_separator$ps_hostname $ps_path $ps_scm_prompt$ps_user_mark$ps_user_input"
|
||||
@@ -92,10 +92,10 @@ THEME_CLOCK_COLOR=${THEME_CLOCK_COLOR:-"$dark_grey"}
|
||||
SCM_THEME_PROMPT_PREFIX=""
|
||||
SCM_THEME_PROMPT_SUFFIX=""
|
||||
|
||||
SCM_THEME_PROMPT_DIRTY=" ${bold_red}✗${light_grey}"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${green}✓${light_grey}"
|
||||
SCM_GIT_CHAR="${green}±${light_grey}"
|
||||
SCM_SVN_CHAR="${bold_cyan}⑆${light_grey}"
|
||||
SCM_HG_CHAR="${bold_red}☿${light_grey}"
|
||||
SCM_THEME_PROMPT_DIRTY=" ${_omb_prompt_bold_brown}✗${light_grey}"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${_omb_prompt_green}✓${light_grey}"
|
||||
SCM_GIT_CHAR="${_omb_prompt_green}±${light_grey}"
|
||||
SCM_SVN_CHAR="${_omb_prompt_bold_teal}⑆${light_grey}"
|
||||
SCM_HG_CHAR="${_omb_prompt_bold_brown}☿${light_grey}"
|
||||
|
||||
_omb_util_add_prompt_command _omb_theme_PROMPT_COMMAND
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
#! bash oh-my-bash.module
|
||||
SCM_THEME_PROMPT_DIRTY=" ${red}✗"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓"
|
||||
SCM_THEME_PROMPT_DIRTY=" ${_omb_prompt_brown}✗"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${_omb_prompt_bold_green}✓"
|
||||
SCM_THEME_PROMPT_PREFIX=" |"
|
||||
SCM_THEME_PROMPT_SUFFIX="${green}|"
|
||||
SCM_THEME_PROMPT_SUFFIX="${_omb_prompt_green}|"
|
||||
|
||||
GIT_THEME_PROMPT_DIRTY=" ${red}✗"
|
||||
GIT_THEME_PROMPT_CLEAN=" ${bold_green}✓"
|
||||
GIT_THEME_PROMPT_PREFIX=" ${green}|"
|
||||
GIT_THEME_PROMPT_SUFFIX="${green}|"
|
||||
GIT_THEME_PROMPT_DIRTY=" ${_omb_prompt_brown}✗"
|
||||
GIT_THEME_PROMPT_CLEAN=" ${_omb_prompt_bold_green}✓"
|
||||
GIT_THEME_PROMPT_PREFIX=" ${_omb_prompt_green}|"
|
||||
GIT_THEME_PROMPT_SUFFIX="${_omb_prompt_green}|"
|
||||
|
||||
CONDAENV_THEME_PROMPT_SUFFIX="|"
|
||||
|
||||
function _omb_theme_PROMPT_COMMAND() {
|
||||
#PS1="${bold_cyan}$(scm_char)${green}$(scm_prompt_info)${purple}$(_omb_prompt_print_ruby_env) ${yellow}\h ${reset_color}in ${green}\w ${reset_color}\n${green}→${reset_color} "
|
||||
PS1="\n${yellow}$(python_version_prompt) ${purple}\h ${reset_color}in ${green}\w\n${bold_cyan}$(scm_char)${green}$(scm_prompt_info) ${green}→${reset_color} "
|
||||
#PS1="${_omb_prompt_bold_teal}$(scm_char)${_omb_prompt_green}$(scm_prompt_info)${_omb_prompt_purple}$(_omb_prompt_print_ruby_env) ${_omb_prompt_olive}\h ${_omb_prompt_reset_color}in ${_omb_prompt_green}\w ${_omb_prompt_reset_color}\n${_omb_prompt_green}→${_omb_prompt_reset_color} "
|
||||
PS1="\n${_omb_prompt_olive}$(python_version_prompt) ${_omb_prompt_purple}\h ${_omb_prompt_reset_color}in ${_omb_prompt_green}\w\n${_omb_prompt_bold_teal}$(scm_char)${_omb_prompt_green}$(scm_prompt_info) ${_omb_prompt_green}→${_omb_prompt_reset_color} "
|
||||
}
|
||||
|
||||
_omb_util_add_prompt_command _omb_theme_PROMPT_COMMAND
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
#! bash oh-my-bash.module
|
||||
|
||||
SCM_THEME_PROMPT_DIRTY=" ${red}✗"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓"
|
||||
SCM_THEME_PROMPT_PREFIX=" ${green}|"
|
||||
SCM_THEME_PROMPT_SUFFIX="${green}|"
|
||||
SCM_THEME_PROMPT_DIRTY=" ${_omb_prompt_brown}✗"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${_omb_prompt_bold_green}✓"
|
||||
SCM_THEME_PROMPT_PREFIX=" ${_omb_prompt_green}|"
|
||||
SCM_THEME_PROMPT_SUFFIX="${_omb_prompt_green}|"
|
||||
|
||||
GIT_THEME_PROMPT_DIRTY=" ${red}✗"
|
||||
GIT_THEME_PROMPT_CLEAN=" ${bold_green}✓"
|
||||
GIT_THEME_PROMPT_PREFIX=" ${green}|"
|
||||
GIT_THEME_PROMPT_SUFFIX="${green}|"
|
||||
GIT_THEME_PROMPT_DIRTY=" ${_omb_prompt_brown}✗"
|
||||
GIT_THEME_PROMPT_CLEAN=" ${_omb_prompt_bold_green}✓"
|
||||
GIT_THEME_PROMPT_PREFIX=" ${_omb_prompt_green}|"
|
||||
GIT_THEME_PROMPT_SUFFIX="${_omb_prompt_green}|"
|
||||
|
||||
RVM_THEME_PROMPT_PREFIX="|"
|
||||
RVM_THEME_PROMPT_SUFFIX="|"
|
||||
@@ -22,13 +22,13 @@ __bobby_clock() {
|
||||
}
|
||||
|
||||
function _omb_theme_PROMPT_COMMAND() {
|
||||
#PS1="${bold_cyan}$(scm_char)${green}$(scm_prompt_info)${purple}$(_omb_prompt_print_ruby_env) ${yellow}\h ${reset_color}in ${green}\w ${reset_color}\n${green}→${reset_color} "
|
||||
PS1="\n$(battery_char) $(__bobby_clock)${yellow}$(_omb_prompt_print_ruby_env) ${purple}\h ${reset_color}in ${green}\w\n${bold_cyan}$(scm_prompt_char_info) ${green}→${reset_color} "
|
||||
#PS1="${_omb_prompt_bold_teal}$(scm_char)${_omb_prompt_green}$(scm_prompt_info)${_omb_prompt_purple}$(_omb_prompt_print_ruby_env) ${_omb_prompt_olive}\h ${_omb_prompt_reset_color}in ${_omb_prompt_green}\w ${_omb_prompt_reset_color}\n${_omb_prompt_green}→${_omb_prompt_reset_color} "
|
||||
PS1="\n$(battery_char) $(__bobby_clock)${_omb_prompt_olive}$(_omb_prompt_print_ruby_env) ${_omb_prompt_purple}\h ${_omb_prompt_reset_color}in ${_omb_prompt_green}\w\n${_omb_prompt_bold_teal}$(scm_prompt_char_info) ${_omb_prompt_green}→${_omb_prompt_reset_color} "
|
||||
}
|
||||
|
||||
THEME_SHOW_CLOCK_CHAR=${THEME_SHOW_CLOCK_CHAR:-"true"}
|
||||
THEME_CLOCK_CHAR_COLOR=${THEME_CLOCK_CHAR_COLOR:-"$red"}
|
||||
THEME_CLOCK_COLOR=${THEME_CLOCK_COLOR:-"$bold_cyan"}
|
||||
THEME_CLOCK_CHAR_COLOR=${THEME_CLOCK_CHAR_COLOR:-"$_omb_prompt_brown"}
|
||||
THEME_CLOCK_COLOR=${THEME_CLOCK_COLOR:-"$_omb_prompt_bold_teal"}
|
||||
THEME_CLOCK_FORMAT=${THEME_CLOCK_FORMAT:-"%Y-%m-%d %H:%M:%S"}
|
||||
|
||||
_omb_util_add_prompt_command _omb_theme_PROMPT_COMMAND
|
||||
|
||||
@@ -88,59 +88,59 @@ ____brainy_bottom() {
|
||||
##############
|
||||
|
||||
___brainy_prompt_user_info() {
|
||||
color=$bold_blue
|
||||
color=$_omb_prompt_bold_navy
|
||||
if [ "${THEME_SHOW_SUDO}" == "true" ]; then
|
||||
if [ $(sudo -n id -u 2>&1 | grep 0) ]; then
|
||||
color=$bold_red
|
||||
color=$_omb_prompt_bold_brown
|
||||
fi
|
||||
fi
|
||||
box="[|]"
|
||||
info="\u@\H"
|
||||
if [ -n "${SSH_CLIENT}" ]; then
|
||||
printf "%s|%s|%s|%s" "${color}" "${info}" "${bold_white}" "${box}"
|
||||
printf "%s|%s|%s|%s" "${color}" "${info}" "${_omb_prompt_bold_white}" "${box}"
|
||||
else
|
||||
printf "%s|%s" "${color}" "${info}"
|
||||
fi
|
||||
}
|
||||
|
||||
___brainy_prompt_dir() {
|
||||
color=$bold_yellow
|
||||
color=$_omb_prompt_bold_olive
|
||||
box="[|]"
|
||||
info="\w"
|
||||
printf "%s|%s|%s|%s" "${color}" "${info}" "${bold_white}" "${box}"
|
||||
printf "%s|%s|%s|%s" "${color}" "${info}" "${_omb_prompt_bold_white}" "${box}"
|
||||
}
|
||||
|
||||
___brainy_prompt_scm() {
|
||||
[ "${THEME_SHOW_SCM}" != "true" ] && return
|
||||
color=$bold_green
|
||||
color=$_omb_prompt_bold_green
|
||||
box="$(scm_char) "
|
||||
info="$(scm_prompt_info)"
|
||||
printf "%s|%s|%s|%s" "${color}" "${info}" "${bold_white}" "${box}"
|
||||
printf "%s|%s|%s|%s" "${color}" "${info}" "${_omb_prompt_bold_white}" "${box}"
|
||||
}
|
||||
|
||||
___brainy_prompt_python() {
|
||||
[ "${THEME_SHOW_PYTHON}" != "true" ] && return
|
||||
color=$bold_yellow
|
||||
color=$_omb_prompt_bold_olive
|
||||
box="[|]"
|
||||
info="$(python_version_prompt)"
|
||||
printf "%s|%s|%s|%s" "${color}" "${info}" "${bold_blue}" "${box}"
|
||||
printf "%s|%s|%s|%s" "${color}" "${info}" "${_omb_prompt_bold_navy}" "${box}"
|
||||
}
|
||||
|
||||
___brainy_prompt_ruby() {
|
||||
[ "${THEME_SHOW_RUBY}" != "true" ] && return
|
||||
color=$bold_white
|
||||
color=$_omb_prompt_bold_white
|
||||
box="[|]"
|
||||
info="rb-$(_omb_prompt_print_ruby_env)"
|
||||
printf "%s|%s|%s|%s" "${color}" "${info}" "${bold_red}" "${box}"
|
||||
printf "%s|%s|%s|%s" "${color}" "${info}" "${_omb_prompt_bold_brown}" "${box}"
|
||||
}
|
||||
|
||||
___brainy_prompt_todo() {
|
||||
[ "${THEME_SHOW_TODO}" != "true" ] ||
|
||||
[ -z "$(which todo.sh)" ] && return
|
||||
color=$bold_white
|
||||
color=$_omb_prompt_bold_white
|
||||
box="[|]"
|
||||
info="t:$(todo.sh ls | egrep "TODO: [0-9]+ of ([0-9]+)" | awk '{ print $4 }' )"
|
||||
printf "%s|%s|%s|%s" "${color}" "${info}" "${bold_green}" "${box}"
|
||||
printf "%s|%s|%s|%s" "${color}" "${info}" "${_omb_prompt_bold_green}" "${box}"
|
||||
}
|
||||
|
||||
___brainy_prompt_clock() {
|
||||
@@ -148,33 +148,33 @@ ___brainy_prompt_clock() {
|
||||
color=$THEME_CLOCK_COLOR
|
||||
box="[|]"
|
||||
info="$(date +"${THEME_CLOCK_FORMAT}")"
|
||||
printf "%s|%s|%s|%s" "${color}" "${info}" "${bold_purple}" "${box}"
|
||||
printf "%s|%s|%s|%s" "${color}" "${info}" "${_omb_prompt_bold_purple}" "${box}"
|
||||
}
|
||||
|
||||
___brainy_prompt_battery() {
|
||||
[ ! -e $OSH/plugins/battery/battery.plugin.sh ] ||
|
||||
[ "${THEME_SHOW_BATTERY}" != "true" ] && return
|
||||
info=$(battery_percentage)
|
||||
color=$bold_green
|
||||
color=$_omb_prompt_bold_green
|
||||
if [ "$info" -lt 50 ]; then
|
||||
color=$bold_yellow
|
||||
color=$_omb_prompt_bold_olive
|
||||
elif [ "$info" -lt 25 ]; then
|
||||
color=$bold_red
|
||||
color=$_omb_prompt_bold_brown
|
||||
fi
|
||||
box="[|]"
|
||||
ac_adapter_connected && info+="+"
|
||||
[ "$info" == "100+" ] && info="AC"
|
||||
printf "%s|%s|%s|%s" "${color}" "${info}" "${bold_white}" "${box}"
|
||||
printf "%s|%s|%s|%s" "${color}" "${info}" "${_omb_prompt_bold_white}" "${box}"
|
||||
}
|
||||
|
||||
___brainy_prompt_exitcode() {
|
||||
[ "${THEME_SHOW_EXITCODE}" != "true" ] && return
|
||||
color=$bold_purple
|
||||
color=$_omb_prompt_bold_purple
|
||||
[ "$exitcode" -ne 0 ] && printf "%s|%s" "${color}" "${exitcode}"
|
||||
}
|
||||
|
||||
___brainy_prompt_char() {
|
||||
color=$bold_white
|
||||
color=$_omb_prompt_bold_white
|
||||
prompt_char="${__BRAINY_PROMPT_CHAR_PS1}"
|
||||
printf "%s|%s" "${color}" "${prompt_char}"
|
||||
}
|
||||
@@ -250,8 +250,8 @@ export RBFU_THEME_PROMPT_SUFFIX=""
|
||||
export RVM_THEME_PROMPT_PREFIX=""
|
||||
export RVM_THEME_PROMPT_SUFFIX=""
|
||||
|
||||
export SCM_THEME_PROMPT_DIRTY=" ${bold_red}✗${normal}"
|
||||
export SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓${normal}"
|
||||
export SCM_THEME_PROMPT_DIRTY=" ${_omb_prompt_bold_brown}✗${_omb_prompt_normal}"
|
||||
export SCM_THEME_PROMPT_CLEAN=" ${_omb_prompt_bold_green}✓${_omb_prompt_normal}"
|
||||
|
||||
THEME_SHOW_SUDO=${THEME_SHOW_SUDO:-"true"}
|
||||
THEME_SHOW_SCM=${THEME_SHOW_SCM:-"true"}
|
||||
@@ -262,7 +262,7 @@ THEME_SHOW_TODO=${THEME_SHOW_TODO:-"false"}
|
||||
THEME_SHOW_BATTERY=${THEME_SHOW_BATTERY:-"false"}
|
||||
THEME_SHOW_EXITCODE=${THEME_SHOW_EXITCODE:-"true"}
|
||||
|
||||
THEME_CLOCK_COLOR=${THEME_CLOCK_COLOR:-"$bold_white"}
|
||||
THEME_CLOCK_COLOR=${THEME_CLOCK_COLOR:-"$_omb_prompt_bold_white"}
|
||||
THEME_CLOCK_FORMAT=${THEME_CLOCK_FORMAT:-"%H:%M:%S"}
|
||||
|
||||
__BRAINY_PROMPT_CHAR_PS1=${THEME_PROMPT_CHAR_PS1:-">"}
|
||||
@@ -277,12 +277,12 @@ ___BRAINY_BOTTOM=${___BRAINY_BOTTOM:-"exitcode char"}
|
||||
############
|
||||
|
||||
__brainy_ps1() {
|
||||
printf "%s%s%s" "$(____brainy_top)" "$(____brainy_bottom)" "${normal}"
|
||||
printf "%s%s%s" "$(____brainy_top)" "$(____brainy_bottom)" "${_omb_prompt_normal}"
|
||||
}
|
||||
|
||||
__brainy_ps2() {
|
||||
color=$bold_white
|
||||
printf "%s%s%s" "${color}" "${__BRAINY_PROMPT_CHAR_PS2} " "${normal}"
|
||||
color=$_omb_prompt_bold_white
|
||||
printf "%s%s%s" "${color}" "${__BRAINY_PROMPT_CHAR_PS2} " "${_omb_prompt_normal}"
|
||||
}
|
||||
|
||||
_omb_theme_PROMPT_COMMAND() {
|
||||
|
||||
@@ -3,16 +3,16 @@
|
||||
SCM_THEME_PROMPT_PREFIX=""
|
||||
SCM_THEME_PROMPT_SUFFIX=""
|
||||
|
||||
SCM_THEME_PROMPT_DIRTY=" ${bold_red}✗${normal}"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓${normal}"
|
||||
SCM_GIT_CHAR="${bold_green}±${normal}"
|
||||
SCM_SVN_CHAR="${bold_cyan}⑆${normal}"
|
||||
SCM_HG_CHAR="${bold_red}☿${normal}"
|
||||
SCM_THEME_PROMPT_DIRTY=" ${_omb_prompt_bold_brown}✗${_omb_prompt_normal}"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${_omb_prompt_bold_green}✓${_omb_prompt_normal}"
|
||||
SCM_GIT_CHAR="${_omb_prompt_bold_green}±${_omb_prompt_normal}"
|
||||
SCM_SVN_CHAR="${_omb_prompt_bold_teal}⑆${_omb_prompt_normal}"
|
||||
SCM_HG_CHAR="${_omb_prompt_bold_brown}☿${_omb_prompt_normal}"
|
||||
|
||||
is_vim_shell() {
|
||||
if [ ! -z "$VIMRUNTIME" ]
|
||||
then
|
||||
echo "[${cyan}vim shell${normal}]"
|
||||
echo "[${_omb_prompt_teal}vim shell${_omb_prompt_normal}]"
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -22,15 +22,15 @@ scm_prompt() {
|
||||
then
|
||||
return
|
||||
else
|
||||
echo " $(scm_char) (${white}$(scm_prompt_info)${normal})"
|
||||
echo " $(scm_char) (${_omb_prompt_white}$(scm_prompt_info)${_omb_prompt_normal})"
|
||||
fi
|
||||
}
|
||||
|
||||
_omb_theme_PROMPT_COMMAND() {
|
||||
PS1="${white}${background_blue} \u${normal}${background_blue}@${red}${background_blue}\h $(clock_prompt) ${reset_color}${normal} $(battery_charge)\n${bold_black}${background_white} \w ${normal}$(scm_prompt)$(is_vim_shell)\n${white}>${normal} "
|
||||
PS1="${_omb_prompt_white}${_omb_prompt_background_navy} \u${_omb_prompt_normal}${_omb_prompt_background_navy}@${_omb_prompt_brown}${_omb_prompt_background_navy}\h $(clock_prompt) ${_omb_prompt_reset_color}${_omb_prompt_normal} $(battery_charge)\n${_omb_prompt_bold_black}${_omb_prompt_background_white} \w ${_omb_prompt_normal}$(scm_prompt)$(is_vim_shell)\n${_omb_prompt_white}>${_omb_prompt_normal} "
|
||||
}
|
||||
|
||||
THEME_CLOCK_COLOR=${THEME_CLOCK_COLOR:-"$blue$background_white"}
|
||||
THEME_CLOCK_COLOR=${THEME_CLOCK_COLOR:-"$_omb_prompt_navy$_omb_prompt_background_white"}
|
||||
THEME_CLOCK_FORMAT=${THEME_CLOCK_FORMAT:-" %H:%M:%S"}
|
||||
|
||||
_omb_util_add_prompt_command _omb_theme_PROMPT_COMMAND
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
#! bash oh-my-bash.module
|
||||
|
||||
function _omb_theme_PROMPT_COMMAND() {
|
||||
PS1="${green}\u@\h $(clock_prompt) ${reset_color}${white}\w${reset_color}$(scm_prompt_info)${blue} →${bold_blue} ${reset_color} ";
|
||||
PS1="${_omb_prompt_green}\u@\h $(clock_prompt) ${_omb_prompt_reset_color}${_omb_prompt_white}\w${_omb_prompt_reset_color}$(scm_prompt_info)${_omb_prompt_navy} →${_omb_prompt_bold_navy} ${_omb_prompt_reset_color} ";
|
||||
}
|
||||
|
||||
THEME_CLOCK_COLOR=${THEME_CLOCK_COLOR:-"$blue"}
|
||||
THEME_CLOCK_COLOR=${THEME_CLOCK_COLOR:-"$_omb_prompt_navy"}
|
||||
THEME_CLOCK_FORMAT=${THEME_CLOCK_FORMAT:-"%I:%M:%S"}
|
||||
|
||||
_omb_util_add_prompt_command _omb_theme_PROMPT_COMMAND
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#! bash oh-my-bash.module
|
||||
# git theming
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX="${bold_blue}(${yellow}%B"
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%b${bold_blue})${reset_color} "
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX="${_omb_prompt_bold_navy}(${_omb_prompt_olive}%B"
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%b${_omb_prompt_bold_navy})${_omb_prompt_reset_color} "
|
||||
ZSH_THEME_GIT_PROMPT_CLEAN=""
|
||||
ZSH_THEME_GIT_PROMPT_DIRTY="${bold_red}✗"
|
||||
ZSH_THEME_GIT_PROMPT_DIRTY="${_omb_prompt_bold_brown}✗"
|
||||
|
||||
|
||||
# LS colors, made with http://geoff.greer.fm/lscolors/
|
||||
@@ -12,9 +12,9 @@ export LS_COLORS='no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=01;35:do=01;35:bd=40
|
||||
|
||||
function _omb_theme_PROMPT_COMMAND() {
|
||||
|
||||
if [ "$(whoami)" = root ]; then no_color=$red; else no_color=$white; fi
|
||||
if [ "$(whoami)" = root ]; then no_color=$_omb_prompt_brown; else no_color=$_omb_prompt_white; fi
|
||||
|
||||
PS1="${no_color}\u${reset_color}:${blue}\W/${reset_color} \[\$(scm_prompt_info)\]$ "
|
||||
PS1="${no_color}\u${_omb_prompt_reset_color}:${_omb_prompt_navy}\W/${_omb_prompt_reset_color} \[\$(scm_prompt_info)\]$ "
|
||||
RPROMPT='[\t]'
|
||||
}
|
||||
|
||||
|
||||
@@ -1,271 +0,0 @@
|
||||
#! bash oh-my-bash.module
|
||||
|
||||
function __ {
|
||||
echo "$@"
|
||||
}
|
||||
|
||||
function __make_ansi {
|
||||
next=$1; shift
|
||||
echo "\[\e[$(__$next $@)m\]"
|
||||
}
|
||||
|
||||
function __make_echo {
|
||||
next=$1; shift
|
||||
echo "\033[$(__$next $@)m"
|
||||
}
|
||||
|
||||
|
||||
function __reset {
|
||||
next=$1; shift
|
||||
out="$(__$next $@)"
|
||||
echo "0${out:+;${out}}"
|
||||
}
|
||||
|
||||
function __bold {
|
||||
next=$1; shift
|
||||
out="$(__$next $@)"
|
||||
echo "${out:+${out};}1"
|
||||
}
|
||||
|
||||
function __faint {
|
||||
next=$1; shift
|
||||
out="$(__$next $@)"
|
||||
echo "${out:+${out};}2"
|
||||
}
|
||||
|
||||
function __italic {
|
||||
next=$1; shift
|
||||
out="$(__$next $@)"
|
||||
echo "${out:+${out};}3"
|
||||
}
|
||||
|
||||
function __underline {
|
||||
next=$1; shift
|
||||
out="$(__$next $@)"
|
||||
echo "${out:+${out};}4"
|
||||
}
|
||||
|
||||
function __negative {
|
||||
next=$1; shift
|
||||
out="$(__$next $@)"
|
||||
echo "${out:+${out};}7"
|
||||
}
|
||||
|
||||
function __crossed {
|
||||
next=$1; shift
|
||||
out="$(__$next $@)"
|
||||
echo "${out:+${out};}8"
|
||||
}
|
||||
|
||||
|
||||
function __color_normal_fg {
|
||||
echo "3$1"
|
||||
}
|
||||
|
||||
function __color_normal_bg {
|
||||
echo "4$1"
|
||||
}
|
||||
|
||||
function __color_bright_fg {
|
||||
echo "9$1"
|
||||
}
|
||||
|
||||
function __color_bright_bg {
|
||||
echo "10$1"
|
||||
}
|
||||
|
||||
|
||||
function __color_black {
|
||||
echo "0"
|
||||
}
|
||||
|
||||
function __color_red {
|
||||
echo "1"
|
||||
}
|
||||
|
||||
function __color_green {
|
||||
echo "2"
|
||||
}
|
||||
|
||||
function __color_yellow {
|
||||
echo "3"
|
||||
}
|
||||
|
||||
function __color_blue {
|
||||
echo "4"
|
||||
}
|
||||
|
||||
function __color_magenta {
|
||||
echo "5"
|
||||
}
|
||||
|
||||
function __color_cyan {
|
||||
echo "6"
|
||||
}
|
||||
|
||||
function __color_white {
|
||||
echo "7"
|
||||
}
|
||||
|
||||
function __color_rgb {
|
||||
r=$1 && g=$2 && b=$3
|
||||
[[ r == g && g == b ]] && echo $(( $r / 11 + 232 )) && return # gray range above 232
|
||||
echo "8;5;$(( ($r * 36 + $b * 6 + $g) / 51 + 16 ))"
|
||||
}
|
||||
|
||||
function __color {
|
||||
color=$1; shift
|
||||
case "$1" in
|
||||
fg|bg) side="$1"; shift ;;
|
||||
*) side=fg;;
|
||||
esac
|
||||
case "$1" in
|
||||
normal|bright) mode="$1"; shift;;
|
||||
*) mode=normal;;
|
||||
esac
|
||||
[[ $color == "rgb" ]] && rgb="$1 $2 $3"; shift 3
|
||||
|
||||
next=$1; shift
|
||||
out="$(__$next $@)"
|
||||
echo "$(__color_${mode}_${side} $(__color_${color} $rgb))${out:+;${out}}"
|
||||
}
|
||||
|
||||
|
||||
function __black {
|
||||
echo "$(__color black $@)"
|
||||
}
|
||||
|
||||
function __red {
|
||||
echo "$(__color red $@)"
|
||||
}
|
||||
|
||||
function __green {
|
||||
echo "$(__color green $@)"
|
||||
}
|
||||
|
||||
function __yellow {
|
||||
echo "$(__color yellow $@)"
|
||||
}
|
||||
|
||||
function __blue {
|
||||
echo "$(__color blue $@)"
|
||||
}
|
||||
|
||||
function __magenta {
|
||||
echo "$(__color magenta $@)"
|
||||
}
|
||||
|
||||
function __cyan {
|
||||
echo "$(__color cyan $@)"
|
||||
}
|
||||
|
||||
function __white {
|
||||
echo "$(__color white $@)"
|
||||
}
|
||||
|
||||
function __rgb {
|
||||
echo "$(__color rgb $@)"
|
||||
}
|
||||
|
||||
|
||||
function __color_parse {
|
||||
next=$1; shift
|
||||
echo "$(__$next $@)"
|
||||
}
|
||||
|
||||
function color {
|
||||
echo "$(__color_parse make_ansi $@)"
|
||||
}
|
||||
|
||||
function echo_color {
|
||||
echo "$(__color_parse make_echo $@)"
|
||||
}
|
||||
|
||||
|
||||
black="\[\e[0;30m\]"
|
||||
red="\[\e[0;31m\]"
|
||||
green="\[\e[0;32m\]"
|
||||
yellow="\[\e[0;33m\]"
|
||||
blue="\[\e[0;34m\]"
|
||||
purple="\[\e[0;35m\]"
|
||||
cyan="\[\e[0;36m\]"
|
||||
white="\[\e[0;37m\]"
|
||||
orange="\[\e[0;91m\]"
|
||||
|
||||
bold_black="\[\e[30;1m\]"
|
||||
bold_red="\[\e[31;1m\]"
|
||||
bold_green="\[\e[32;1m\]"
|
||||
bold_yellow="\[\e[33;1m\]"
|
||||
bold_blue="\[\e[34;1m\]"
|
||||
bold_purple="\[\e[35;1m\]"
|
||||
bold_cyan="\[\e[36;1m\]"
|
||||
bold_white="\[\e[37;1m\]"
|
||||
bold_orange="\[\e[91;1m\]"
|
||||
|
||||
underline_black="\[\e[30;4m\]"
|
||||
underline_red="\[\e[31;4m\]"
|
||||
underline_green="\[\e[32;4m\]"
|
||||
underline_yellow="\[\e[33;4m\]"
|
||||
underline_blue="\[\e[34;4m\]"
|
||||
underline_purple="\[\e[35;4m\]"
|
||||
underline_cyan="\[\e[36;4m\]"
|
||||
underline_white="\[\e[37;4m\]"
|
||||
underline_orange="\[\e[91;4m\]"
|
||||
|
||||
background_black="\[\e[40m\]"
|
||||
background_red="\[\e[41m\]"
|
||||
background_green="\[\e[42m\]"
|
||||
background_yellow="\[\e[43m\]"
|
||||
background_blue="\[\e[44m\]"
|
||||
background_purple="\[\e[45m\]"
|
||||
background_cyan="\[\e[46m\]"
|
||||
background_white="\[\e[47;1m\]"
|
||||
background_orange="\[\e[101m\]"
|
||||
|
||||
normal="\[\e[0m\]"
|
||||
reset_color="\[\e[39m\]"
|
||||
|
||||
# These colors are meant to be used with `echo -e`
|
||||
echo_black="\033[0;30m"
|
||||
echo_red="\033[0;31m"
|
||||
echo_green="\033[0;32m"
|
||||
echo_yellow="\033[0;33m"
|
||||
echo_blue="\033[0;34m"
|
||||
echo_purple="\033[0;35m"
|
||||
echo_cyan="\033[0;36m"
|
||||
echo_white="\033[0;37;1m"
|
||||
echo_orange="\033[0;91m"
|
||||
|
||||
echo_bold_black="\033[30;1m"
|
||||
echo_bold_red="\033[31;1m"
|
||||
echo_bold_green="\033[32;1m"
|
||||
echo_bold_yellow="\033[33;1m"
|
||||
echo_bold_blue="\033[34;1m"
|
||||
echo_bold_purple="\033[35;1m"
|
||||
echo_bold_cyan="\033[36;1m"
|
||||
echo_bold_white="\033[37;1m"
|
||||
echo_bold_orange="\033[91;1m"
|
||||
|
||||
echo_underline_black="\033[30;4m"
|
||||
echo_underline_red="\033[31;4m"
|
||||
echo_underline_green="\033[32;4m"
|
||||
echo_underline_yellow="\033[33;4m"
|
||||
echo_underline_blue="\033[34;4m"
|
||||
echo_underline_purple="\033[35;4m"
|
||||
echo_underline_cyan="\033[36;4m"
|
||||
echo_underline_white="\033[37;4m"
|
||||
echo_underline_orange="\033[91;4m"
|
||||
|
||||
echo_background_black="\033[40m"
|
||||
echo_background_red="\033[41m"
|
||||
echo_background_green="\033[42m"
|
||||
echo_background_yellow="\033[43m"
|
||||
echo_background_blue="\033[44m"
|
||||
echo_background_purple="\033[45m"
|
||||
echo_background_cyan="\033[46m"
|
||||
echo_background_white="\033[47;1m"
|
||||
echo_background_orange="\033[101m"
|
||||
|
||||
echo_normal="\033[0m"
|
||||
echo_reset_color="\033[39m"
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
# BASED ON: Mr Briggs by Matt Brigg (matt@mattbriggs.net) #
|
||||
# ------------------------------------------------------------------#
|
||||
|
||||
SCM_THEME_PROMPT_DIRTY="${red} ✗${reset_color}"
|
||||
SCM_THEME_PROMPT_AHEAD="${yellow} ↑${reset_color}"
|
||||
SCM_THEME_PROMPT_CLEAN="${green} ✓${reset_color}"
|
||||
SCM_THEME_PROMPT_DIRTY="${_omb_prompt_brown} ✗${_omb_prompt_reset_color}"
|
||||
SCM_THEME_PROMPT_AHEAD="${_omb_prompt_olive} ↑${_omb_prompt_reset_color}"
|
||||
SCM_THEME_PROMPT_CLEAN="${_omb_prompt_green} ✓${_omb_prompt_reset_color}"
|
||||
SCM_THEME_PROMPT_PREFIX=" "
|
||||
SCM_THEME_PROMPT_SUFFIX=""
|
||||
GIT_SHA_PREFIX="${blue}"
|
||||
GIT_SHA_SUFFIX="${reset_color}"
|
||||
GIT_SHA_PREFIX="${_omb_prompt_navy}"
|
||||
GIT_SHA_SUFFIX="${_omb_prompt_reset_color}"
|
||||
|
||||
function git_short_sha() {
|
||||
SHA=$(git rev-parse --short HEAD 2> /dev/null) && echo "$GIT_SHA_PREFIX$SHA$GIT_SHA_SUFFIX"
|
||||
@@ -19,11 +19,11 @@ function git_short_sha() {
|
||||
|
||||
function _omb_theme_PROMPT_COMMAND() {
|
||||
local return_status=""
|
||||
local ruby="${red}$(_omb_prompt_print_ruby_env)${reset_color}"
|
||||
local user_host="${green}\h @ \w${reset_color}"
|
||||
local git_branch="$(git_short_sha)${cyan}$(scm_prompt_info)${reset_color}"
|
||||
local ruby="${_omb_prompt_brown}$(_omb_prompt_print_ruby_env)${_omb_prompt_reset_color}"
|
||||
local user_host="${_omb_prompt_green}\h @ \w${_omb_prompt_reset_color}"
|
||||
local git_branch="$(git_short_sha)${_omb_prompt_teal}$(scm_prompt_info)${_omb_prompt_reset_color}"
|
||||
local prompt_symbol=' '
|
||||
local prompt_char="${purple}>_${reset_color} "
|
||||
local prompt_char="${_omb_prompt_purple}>_${_omb_prompt_reset_color} "
|
||||
|
||||
PS1="\n${user_host}${prompt_symbol}${ruby} ${git_branch} ${return_status}\n${prompt_char}"
|
||||
}
|
||||
|
||||
@@ -19,11 +19,11 @@ VIRTUALENV_THEME_PROMPT_SUFFIX=""
|
||||
# SCM prompts
|
||||
SCM_NONE_CHAR=""
|
||||
SCM_GIT_CHAR="[±] "
|
||||
SCM_GIT_BEHIND_CHAR="${red}↓${normal}"
|
||||
SCM_GIT_AHEAD_CHAR="${bold_green}↑${normal}"
|
||||
SCM_GIT_BEHIND_CHAR="${_omb_prompt_brown}↓${_omb_prompt_normal}"
|
||||
SCM_GIT_AHEAD_CHAR="${_omb_prompt_bold_green}↑${_omb_prompt_normal}"
|
||||
SCM_GIT_UNTRACKED_CHAR="⌀"
|
||||
SCM_GIT_UNSTAGED_CHAR="${bold_yellow}•${normal}"
|
||||
SCM_GIT_STAGED_CHAR="${bold_green}+${normal}"
|
||||
SCM_GIT_UNSTAGED_CHAR="${_omb_prompt_bold_olive}•${_omb_prompt_normal}"
|
||||
SCM_GIT_STAGED_CHAR="${_omb_prompt_bold_green}+${_omb_prompt_normal}"
|
||||
|
||||
SCM_THEME_PROMPT_DIRTY=""
|
||||
SCM_THEME_PROMPT_CLEAN=""
|
||||
@@ -31,8 +31,8 @@ SCM_THEME_PROMPT_PREFIX=""
|
||||
SCM_THEME_PROMPT_SUFFIX=""
|
||||
|
||||
# Git status prompts
|
||||
GIT_THEME_PROMPT_DIRTY=" ${red}✗${normal}"
|
||||
GIT_THEME_PROMPT_CLEAN=" ${bold_green}✓${normal}"
|
||||
GIT_THEME_PROMPT_DIRTY=" ${_omb_prompt_brown}✗${_omb_prompt_normal}"
|
||||
GIT_THEME_PROMPT_CLEAN=" ${_omb_prompt_bold_green}✓${_omb_prompt_normal}"
|
||||
GIT_THEME_PROMPT_PREFIX=""
|
||||
GIT_THEME_PROMPT_SUFFIX=""
|
||||
|
||||
@@ -63,7 +63,7 @@ function winname {
|
||||
|
||||
# Displays the current prompt
|
||||
function _omb_theme_PROMPT_COMMAND() {
|
||||
PS1="\n${icon_start}$(_omb_prompt_print_python_venv)${icon_user}${bold_red}\u${normal}${icon_host}${bold_cyan}\h${normal}${icon_directory}${bold_purple}\W${normal}\$([[ -n \$(git branch 2> /dev/null) ]] && echo \" on ${icon_branch} \")${white}$(scm_prompt_info)${normal}\n${icon_end}"
|
||||
PS1="\n${icon_start}$(_omb_prompt_print_python_venv)${icon_user}${_omb_prompt_bold_brown}\u${_omb_prompt_normal}${icon_host}${_omb_prompt_bold_teal}\h${_omb_prompt_normal}${icon_directory}${_omb_prompt_bold_purple}\W${_omb_prompt_normal}\$([[ -n \$(git branch 2> /dev/null) ]] && echo \" on ${icon_branch} \")${_omb_prompt_white}$(scm_prompt_info)${_omb_prompt_normal}\n${icon_end}"
|
||||
PS2="${icon_end}"
|
||||
}
|
||||
|
||||
|
||||
@@ -33,17 +33,17 @@
|
||||
#*color7: #E5E5E5
|
||||
|
||||
# ----------------------------------------------------------------- COLOR CONF
|
||||
D_DEFAULT_COLOR="${normal}"
|
||||
D_INTERMEDIATE_COLOR="${white}"
|
||||
D_USER_COLOR="${purple}"
|
||||
D_SUPERUSER_COLOR="${red}"
|
||||
D_MACHINE_COLOR="${cyan}"
|
||||
D_DIR_COLOR="${green}"
|
||||
D_SCM_COLOR="${yellow}"
|
||||
D_BRANCH_COLOR="${yellow}"
|
||||
D_CHANGES_COLOR="${white}"
|
||||
D_CMDFAIL_COLOR="${red}"
|
||||
D_VIMSHELL_COLOR="${cyan}"
|
||||
D_DEFAULT_COLOR="${_omb_prompt_normal}"
|
||||
D_INTERMEDIATE_COLOR="${_omb_prompt_white}"
|
||||
D_USER_COLOR="${_omb_prompt_purple}"
|
||||
D_SUPERUSER_COLOR="${_omb_prompt_brown}"
|
||||
D_MACHINE_COLOR="${_omb_prompt_teal}"
|
||||
D_DIR_COLOR="${_omb_prompt_green}"
|
||||
D_SCM_COLOR="${_omb_prompt_olive}"
|
||||
D_BRANCH_COLOR="${_omb_prompt_olive}"
|
||||
D_CHANGES_COLOR="${_omb_prompt_white}"
|
||||
D_CMDFAIL_COLOR="${_omb_prompt_brown}"
|
||||
D_VIMSHELL_COLOR="${_omb_prompt_teal}"
|
||||
|
||||
# ------------------------------------------------------------------ FUNCTIONS
|
||||
case $TERM in
|
||||
|
||||
@@ -2,30 +2,30 @@
|
||||
|
||||
SCM_THEME_PROMPT_DIRTY=''
|
||||
SCM_THEME_PROMPT_CLEAN=''
|
||||
SCM_GIT_CHAR="${bold_cyan}±${normal}"
|
||||
SCM_SVN_CHAR="${bold_cyan}⑆${normal}"
|
||||
SCM_HG_CHAR="${bold_red}☿${normal}"
|
||||
SCM_GIT_CHAR="${_omb_prompt_bold_teal}±${_omb_prompt_normal}"
|
||||
SCM_SVN_CHAR="${_omb_prompt_bold_teal}⑆${_omb_prompt_normal}"
|
||||
SCM_HG_CHAR="${_omb_prompt_bold_brown}☿${_omb_prompt_normal}"
|
||||
SCM_THEME_PROMPT_PREFIX=""
|
||||
SCM_THEME_PROMPT_SUFFIX=""
|
||||
if [ ! -z $RVM_THEME_PROMPT_COLOR ]; then
|
||||
RVM_THEME_PROMPT_COLOR=$(eval echo $`echo ${RVM_THEME_PROMPT_COLOR}`);
|
||||
else
|
||||
RVM_THEME_PROMPT_COLOR="${red}"
|
||||
RVM_THEME_PROMPT_COLOR="${_omb_prompt_brown}"
|
||||
fi
|
||||
RVM_THEME_PROMPT_PREFIX="(${RVM_THEME_PROMPT_COLOR}rb${normal}: "
|
||||
RVM_THEME_PROMPT_PREFIX="(${RVM_THEME_PROMPT_COLOR}rb${_omb_prompt_normal}: "
|
||||
RVM_THEME_PROMPT_SUFFIX=") "
|
||||
if [ ! -z $VIRTUALENV_THEME_PROMPT_COLOR ]; then
|
||||
VIRTUALENV_THEME_PROMPT_COLOR=$(eval echo $`echo ${VIRTUALENV_THEME_PROMPT_COLOR}`);
|
||||
else
|
||||
VIRTUALENV_THEME_PROMPT_COLOR="${green}"
|
||||
VIRTUALENV_THEME_PROMPT_COLOR="${_omb_prompt_green}"
|
||||
fi
|
||||
VIRTUALENV_THEME_PROMPT_PREFIX="(${VIRTUALENV_THEME_PROMPT_COLOR}py${normal}: "
|
||||
VIRTUALENV_THEME_PROMPT_PREFIX="(${VIRTUALENV_THEME_PROMPT_COLOR}py${_omb_prompt_normal}: "
|
||||
VIRTUALENV_THEME_PROMPT_SUFFIX=") "
|
||||
|
||||
if [ ! -z $THEME_PROMPT_HOST_COLOR ]; then
|
||||
THEME_PROMPT_HOST_COLOR=$(eval echo $`echo ${THEME_PROMPT_HOST_COLOR}`);
|
||||
else
|
||||
THEME_PROMPT_HOST_COLOR="$blue"
|
||||
THEME_PROMPT_HOST_COLOR="$_omb_prompt_navy"
|
||||
fi
|
||||
|
||||
doubletime_scm_prompt() {
|
||||
@@ -45,8 +45,8 @@ function _omb_theme_PROMPT_COMMAND() {
|
||||
history -c
|
||||
history -r
|
||||
PS1="
|
||||
$(clock_prompt) $(scm_char) [${THEME_PROMPT_HOST_COLOR}\u@${THEME_PROMPT_HOST}$reset_color] $(_omb_prompt_print_python_venv)$(_omb_prompt_print_ruby_env)\w
|
||||
$(doubletime_scm_prompt)$reset_color $ "
|
||||
$(clock_prompt) $(scm_char) [${THEME_PROMPT_HOST_COLOR}\u@${THEME_PROMPT_HOST}$_omb_prompt_reset_color] $(_omb_prompt_print_python_venv)$(_omb_prompt_print_ruby_env)\w
|
||||
$(doubletime_scm_prompt)$_omb_prompt_reset_color $ "
|
||||
PS2='> '
|
||||
PS4='+ '
|
||||
}
|
||||
@@ -57,16 +57,16 @@ git_prompt_status() {
|
||||
local git_status_output
|
||||
git_status_output=$(git status 2> /dev/null )
|
||||
if [ -n "$(echo $git_status_output | grep 'Changes not staged')" ]; then
|
||||
git_status="${bold_red}$(scm_prompt_info) ✗"
|
||||
git_status="${_omb_prompt_bold_brown}$(scm_prompt_info) ✗"
|
||||
elif [ -n "$(echo $git_status_output | grep 'Changes to be committed')" ]; then
|
||||
git_status="${bold_yellow}$(scm_prompt_info) ^"
|
||||
git_status="${_omb_prompt_bold_olive}$(scm_prompt_info) ^"
|
||||
elif [ -n "$(echo $git_status_output | grep 'Untracked files')" ]; then
|
||||
git_status="${bold_cyan}$(scm_prompt_info) +"
|
||||
git_status="${_omb_prompt_bold_teal}$(scm_prompt_info) +"
|
||||
elif [ -n "$(echo $git_status_output | grep 'nothing to commit')" ]; then
|
||||
git_status="${bold_green}$(scm_prompt_info) ${green}✓"
|
||||
git_status="${_omb_prompt_bold_green}$(scm_prompt_info) ${_omb_prompt_green}✓"
|
||||
else
|
||||
git_status="$(scm_prompt_info)"
|
||||
fi
|
||||
echo "[$git_status${normal}]"
|
||||
echo "[$git_status${_omb_prompt_normal}]"
|
||||
|
||||
}
|
||||
|
||||
@@ -8,9 +8,9 @@ function _omb_theme_PROMPT_COMMAND() {
|
||||
history -c
|
||||
history -r
|
||||
PS1="
|
||||
$(clock_prompt) $(scm_char) [$THEME_PROMPT_HOST_COLOR\u@${THEME_PROMPT_HOST}$reset_color] $(_omb_prompt_print_python_venv)$(_omb_prompt_print_ruby_env)
|
||||
$(clock_prompt) $(scm_char) [$THEME_PROMPT_HOST_COLOR\u@${THEME_PROMPT_HOST}$_omb_prompt_reset_color] $(_omb_prompt_print_python_venv)$(_omb_prompt_print_ruby_env)
|
||||
\w
|
||||
$(doubletime_scm_prompt)$reset_color $ "
|
||||
$(doubletime_scm_prompt)$_omb_prompt_reset_color $ "
|
||||
PS2='> '
|
||||
PS4='+ '
|
||||
}
|
||||
|
||||
@@ -8,9 +8,9 @@ function _omb_theme_PROMPT_COMMAND() {
|
||||
history -c
|
||||
history -r
|
||||
PS1="
|
||||
$(clock_prompt) $(scm_char) [$THEME_PROMPT_HOST_COLOR\u@${THEME_PROMPT_HOST}$reset_color] $(_omb_prompt_print_python_venv)
|
||||
$(clock_prompt) $(scm_char) [$THEME_PROMPT_HOST_COLOR\u@${THEME_PROMPT_HOST}$_omb_prompt_reset_color] $(_omb_prompt_print_python_venv)
|
||||
\w
|
||||
$(doubletime_scm_prompt)$reset_color $ "
|
||||
$(doubletime_scm_prompt)$_omb_prompt_reset_color $ "
|
||||
PS2='> '
|
||||
PS4='+ '
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ dulcie_background() {
|
||||
|
||||
_omb_theme_PROMPT_COMMAND() {
|
||||
color_user_root=$(dulcie_color 169)
|
||||
color_user_nonroot="${green}"
|
||||
color_user_nonroot="${_omb_prompt_green}"
|
||||
color_host_local=$(dulcie_color 230)
|
||||
color_host_remote=$(dulcie_color 214)
|
||||
color_rootdir=$(dulcie_color 117)
|
||||
@@ -48,18 +48,18 @@ _omb_theme_PROMPT_COMMAND() {
|
||||
color_host="${color_host_local}"
|
||||
fi
|
||||
|
||||
DULCIE_USER="${color_user}\u${reset_color}"
|
||||
DULCIE_HOST="${color_host}\h${reset_color}"
|
||||
DULCIE_WORKINGDIR="${color_workingdir}\W${reset_color}"
|
||||
DULCIE_PROMPTCHAR="${color_user}"'\$'"${reset_color}"
|
||||
DULCIE_USER="${color_user}\u${_omb_prompt_reset_color}"
|
||||
DULCIE_HOST="${color_host}\h${_omb_prompt_reset_color}"
|
||||
DULCIE_WORKINGDIR="${color_workingdir}\W${_omb_prompt_reset_color}"
|
||||
DULCIE_PROMPTCHAR="${color_user}"'\$'"${_omb_prompt_reset_color}"
|
||||
|
||||
SCM_THEME_PROMPT_DIRTY=" ${red}✗${reset_color}"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓${normal}"
|
||||
SCM_THEME_PROMPT_DIRTY=" ${_omb_prompt_brown}✗${_omb_prompt_reset_color}"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${_omb_prompt_bold_green}✓${_omb_prompt_normal}"
|
||||
DULCIE_SCM_BACKGROUND="${background_scm}"
|
||||
DULCIE_SCM_DIR_COLOR="${color_rootdir}"
|
||||
SCM_THEME_ROOT_SUFFIX="${reset_color}${SCM_THEME_ROOT_SUFFIX}"
|
||||
SCM_THEME_PROMPT_DIRTY=" $(dulcie_color 1)✗${reset_color}"
|
||||
SCM_THEME_PROMPT_CLEAN=" $(dulcie_color 10)✓${reset_color}"
|
||||
SCM_THEME_ROOT_SUFFIX="${_omb_prompt_reset_color}${SCM_THEME_ROOT_SUFFIX}"
|
||||
SCM_THEME_PROMPT_DIRTY=" $(dulcie_color 1)✗${_omb_prompt_reset_color}"
|
||||
SCM_THEME_PROMPT_CLEAN=" $(dulcie_color 10)✓${_omb_prompt_reset_color}"
|
||||
else
|
||||
DULCIE_USER='\u'
|
||||
DULCIE_HOST='\h'
|
||||
@@ -79,18 +79,18 @@ _omb_theme_PROMPT_COMMAND() {
|
||||
# Open the new terminal in the same directory
|
||||
declare -f __vte_osc7 > /dev/null && __vte_osc7
|
||||
|
||||
PS1="${reset_color}[${DULCIE_USER}@${DULCIE_HOST}$(scm_prompt_info)${reset_color} ${DULCIE_WORKINGDIR}]"
|
||||
PS1="${_omb_prompt_reset_color}[${DULCIE_USER}@${DULCIE_HOST}$(scm_prompt_info)${_omb_prompt_reset_color} ${DULCIE_WORKINGDIR}]"
|
||||
if [[ "${DULCIE_MULTILINE}" -eq "1" ]]; then
|
||||
PS1="${reset_color}[${DULCIE_USER}@${DULCIE_HOST}${reset_color} ${DULCIE_WORKINGDIR}]"
|
||||
PS1="${_omb_prompt_reset_color}[${DULCIE_USER}@${DULCIE_HOST}${_omb_prompt_reset_color} ${DULCIE_WORKINGDIR}]"
|
||||
if [[ "$(scm_prompt_info)" ]]; then
|
||||
SCM_THEME_PROMPT_PREFIX="${DULCIE_SCM_BACKGROUND}|${DULCIE_SCM_DIR_COLOR}"
|
||||
SCM_THEME_PROMPT_SUFFIX="|${normal}"
|
||||
SCM_THEME_PROMPT_SUFFIX="|${_omb_prompt_normal}"
|
||||
PS1="$(scm_prompt_info)\n${PS1}"
|
||||
fi
|
||||
else
|
||||
SCM_THEME_PROMPT_PREFIX=" ${DULCIE_SCM_BACKGROUND}|${DULCIE_SCM_DIR_COLOR}"
|
||||
SCM_THEME_PROMPT_SUFFIX="|${normal}"
|
||||
PS1="${reset_color}[${DULCIE_USER}@${DULCIE_HOST}$(scm_prompt_info)${reset_color} ${DULCIE_WORKINGDIR}]"
|
||||
SCM_THEME_PROMPT_SUFFIX="|${_omb_prompt_normal}"
|
||||
PS1="${_omb_prompt_reset_color}[${DULCIE_USER}@${DULCIE_HOST}$(scm_prompt_info)${_omb_prompt_reset_color} ${DULCIE_WORKINGDIR}]"
|
||||
fi
|
||||
PS1="${PS1}${DULCIE_PROMPTCHAR} "
|
||||
}
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
#! bash oh-my-bash.module
|
||||
|
||||
SCM_THEME_PROMPT_PREFIX="${cyan} on ${green}"
|
||||
SCM_THEME_PROMPT_PREFIX="${_omb_prompt_teal} on ${_omb_prompt_green}"
|
||||
SCM_THEME_PROMPT_SUFFIX=""
|
||||
SCM_THEME_PROMPT_DIRTY=" ${red}with changes"
|
||||
SCM_THEME_PROMPT_DIRTY=" ${_omb_prompt_brown}with changes"
|
||||
SCM_THEME_PROMPT_CLEAN=""
|
||||
|
||||
venv() {
|
||||
if [ ! -z "$VIRTUAL_ENV" ]
|
||||
then
|
||||
local env=$VIRTUAL_ENV
|
||||
echo "${gray} in ${orange}${env##*/} "
|
||||
echo "${gray} in ${_omb_prompt_red}${env##*/} "
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ last_two_dirs() {
|
||||
}
|
||||
|
||||
_omb_theme_PROMPT_COMMAND() {
|
||||
PS1="${yellow}# ${reset_color}$(last_two_dirs)$(scm_prompt_info)${reset_color}$(venv)${reset_color} ${cyan}\n> ${reset_color}"
|
||||
PS1="${_omb_prompt_olive}# ${_omb_prompt_reset_color}$(last_two_dirs)$(scm_prompt_info)${_omb_prompt_reset_color}$(venv)${_omb_prompt_reset_color} ${_omb_prompt_teal}\n> ${_omb_prompt_reset_color}"
|
||||
}
|
||||
|
||||
_omb_util_add_prompt_command _omb_theme_PROMPT_COMMAND
|
||||
|
||||
@@ -1,29 +1,29 @@
|
||||
#! bash oh-my-bash.module
|
||||
|
||||
SCM_THEME_PROMPT_DIRTY=" ${red}✗"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓"
|
||||
SCM_THEME_PROMPT_DIRTY=" ${_omb_prompt_brown}✗"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${_omb_prompt_bold_green}✓"
|
||||
SCM_THEME_PROMPT_PREFIX=" |"
|
||||
SCM_THEME_PROMPT_SUFFIX="${green}|"
|
||||
SCM_THEME_PROMPT_SUFFIX="${_omb_prompt_green}|"
|
||||
|
||||
GIT_THEME_PROMPT_DIRTY=" ${red}✗"
|
||||
GIT_THEME_PROMPT_CLEAN=" ${bold_green}✓"
|
||||
GIT_THEME_PROMPT_PREFIX=" ${green}|"
|
||||
GIT_THEME_PROMPT_SUFFIX="${green}|"
|
||||
GIT_THEME_PROMPT_DIRTY=" ${_omb_prompt_brown}✗"
|
||||
GIT_THEME_PROMPT_CLEAN=" ${_omb_prompt_bold_green}✓"
|
||||
GIT_THEME_PROMPT_PREFIX=" ${_omb_prompt_green}|"
|
||||
GIT_THEME_PROMPT_SUFFIX="${_omb_prompt_green}|"
|
||||
|
||||
RVM_THEME_PROMPT_PREFIX="|"
|
||||
RVM_THEME_PROMPT_SUFFIX="|"
|
||||
|
||||
function get_hour_color {
|
||||
hour_color=$red
|
||||
hour_color=$_omb_prompt_brown
|
||||
min=$(date +%M)
|
||||
if [ "$min" -lt "15" ]; then
|
||||
hour_color=$white
|
||||
hour_color=$_omb_prompt_white
|
||||
elif [ "$min" -lt "30" ]; then
|
||||
hour_color=$green
|
||||
hour_color=$_omb_prompt_green
|
||||
elif [ "$min" -lt "45" ]; then
|
||||
hour_color=$yellow
|
||||
hour_color=$_omb_prompt_olive
|
||||
else
|
||||
hour_color=$red
|
||||
hour_color=$_omb_prompt_brown
|
||||
fi
|
||||
echo "$hour_color"
|
||||
}
|
||||
@@ -34,7 +34,7 @@ __emperor_clock() {
|
||||
}
|
||||
|
||||
function _omb_theme_PROMPT_COMMAND() {
|
||||
PS1="\n$(__emperor_clock)${purple}\h ${reset_color}in ${prompt_color}\w\n${bold_cyan}$(scm_char)${green}$(scm_prompt_info) ${green}→${reset_color} "
|
||||
PS1="\n$(__emperor_clock)${_omb_prompt_purple}\h ${_omb_prompt_reset_color}in ${prompt_color}\w\n${_omb_prompt_bold_teal}$(scm_char)${_omb_prompt_green}$(scm_prompt_info) ${_omb_prompt_green}→${_omb_prompt_reset_color} "
|
||||
}
|
||||
|
||||
THEME_CLOCK_FORMAT=${THEME_CLOCK_FORMAT:-"%H "}
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
#! bash oh-my-bash.module
|
||||
SCM_THEME_PROMPT_DIRTY=" ${red}✗"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓"
|
||||
SCM_THEME_PROMPT_DIRTY=" ${_omb_prompt_brown}✗"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${_omb_prompt_bold_green}✓"
|
||||
SCM_THEME_PROMPT_PREFIX=" |"
|
||||
SCM_THEME_PROMPT_SUFFIX="${green}|"
|
||||
SCM_THEME_PROMPT_SUFFIX="${_omb_prompt_green}|"
|
||||
|
||||
GIT_THEME_PROMPT_DIRTY=" ${red}✗"
|
||||
GIT_THEME_PROMPT_CLEAN=" ${bold_green}✓"
|
||||
GIT_THEME_PROMPT_PREFIX=" ${green}|"
|
||||
GIT_THEME_PROMPT_SUFFIX="${green}|"
|
||||
GIT_THEME_PROMPT_DIRTY=" ${_omb_prompt_brown}✗"
|
||||
GIT_THEME_PROMPT_CLEAN=" ${_omb_prompt_bold_green}✓"
|
||||
GIT_THEME_PROMPT_PREFIX=" ${_omb_prompt_green}|"
|
||||
GIT_THEME_PROMPT_SUFFIX="${_omb_prompt_green}|"
|
||||
|
||||
function _omb_theme_PROMPT_COMMAND() {
|
||||
PS1="\n${yellow}$(_omb_prompt_print_ruby_env) ${purple}\h ${reset_color}in ${green}\w\n${bold_cyan}$(scm_char)${green}$(scm_prompt_info) ${green}→${reset_color} "
|
||||
PS1="\n${_omb_prompt_olive}$(_omb_prompt_print_ruby_env) ${_omb_prompt_purple}\h ${_omb_prompt_reset_color}in ${_omb_prompt_green}\w\n${_omb_prompt_bold_teal}$(scm_char)${_omb_prompt_green}$(scm_prompt_info) ${_omb_prompt_green}→${_omb_prompt_reset_color} "
|
||||
}
|
||||
|
||||
_omb_util_add_prompt_command _omb_theme_PROMPT_COMMAND
|
||||
|
||||
@@ -22,16 +22,16 @@
|
||||
#
|
||||
|
||||
SCM_NONE_CHAR=''
|
||||
SCM_THEME_PROMPT_DIRTY=" ${red}✗"
|
||||
SCM_THEME_PROMPT_DIRTY=" ${_omb_prompt_brown}✗"
|
||||
SCM_THEME_PROMPT_CLEAN=""
|
||||
SCM_THEME_PROMPT_PREFIX="${green}|"
|
||||
SCM_THEME_PROMPT_SUFFIX="${green}|"
|
||||
SCM_THEME_PROMPT_PREFIX="${_omb_prompt_green}|"
|
||||
SCM_THEME_PROMPT_SUFFIX="${_omb_prompt_green}|"
|
||||
SCM_GIT_SHOW_MINIMAL_INFO=true
|
||||
|
||||
CLOCK_THEME_PROMPT_PREFIX=''
|
||||
CLOCK_THEME_PROMPT_SUFFIX=' '
|
||||
THEME_SHOW_CLOCK=${THEME_SHOW_CLOCK:-"true"}
|
||||
THEME_CLOCK_COLOR=${THEME_CLOCK_COLOR:-"$bold_blue"}
|
||||
THEME_CLOCK_COLOR=${THEME_CLOCK_COLOR:-"$_omb_prompt_bold_navy"}
|
||||
THEME_CLOCK_FORMAT=${THEME_CLOCK_FORMAT:-"%I:%M:%S"}
|
||||
|
||||
VIRTUALENV_THEME_PROMPT_PREFIX='('
|
||||
@@ -41,21 +41,21 @@ function _omb_theme_PROMPT_COMMAND() {
|
||||
# This needs to be first to save last command return code
|
||||
local RC="$?"
|
||||
|
||||
local hostname="${bold_black}\u@\h"
|
||||
local hostname="${_omb_prompt_bold_black}\u@\h"
|
||||
local python_venv; _omb_prompt_get_python_venv
|
||||
python_venv=$white$python_venv
|
||||
python_venv=$_omb_prompt_white$python_venv
|
||||
|
||||
# Set return status color
|
||||
if [[ ${RC} == 0 ]]; then
|
||||
ret_status="${bold_green}"
|
||||
ret_status="${_omb_prompt_bold_green}"
|
||||
else
|
||||
ret_status="${bold_red}"
|
||||
ret_status="${_omb_prompt_bold_brown}"
|
||||
fi
|
||||
|
||||
# Append new history lines to history file
|
||||
history -a
|
||||
|
||||
PS1="$(clock_prompt)$python_venv${hostname} ${bold_cyan}\W $(scm_prompt_char_info)${ret_status}→ ${normal}"
|
||||
PS1="$(clock_prompt)$python_venv${hostname} ${_omb_prompt_bold_teal}\W $(scm_prompt_char_info)${ret_status}→ ${_omb_prompt_normal}"
|
||||
}
|
||||
|
||||
_omb_util_add_prompt_command _omb_theme_PROMPT_COMMAND
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#! bash oh-my-bash.module
|
||||
# scm theming
|
||||
SCM_THEME_PROMPT_PREFIX="${yellow}("
|
||||
SCM_THEME_PROMPT_SUFFIX=")${normal}"
|
||||
SCM_THEME_PROMPT_PREFIX="${_omb_prompt_olive}("
|
||||
SCM_THEME_PROMPT_SUFFIX=")${_omb_prompt_normal}"
|
||||
|
||||
SCM_THEME_PROMPT_DIRTY="*"
|
||||
SCM_THEME_PROMPT_CLEAN=""
|
||||
@@ -25,10 +25,10 @@ scm_prompt() {
|
||||
}
|
||||
|
||||
_omb_theme_PROMPT_COMMAND() {
|
||||
ps_host="${green}\h${normal}";
|
||||
ps_user_mark="${bold}\$${normal}";
|
||||
ps_root_mark="${normal}§"
|
||||
ps_path="${normal}\w";
|
||||
ps_host="${_omb_prompt_green}\h${_omb_prompt_normal}";
|
||||
ps_user_mark="${_omb_prompt_bold}\$${_omb_prompt_normal}";
|
||||
ps_root_mark="${_omb_prompt_normal}§"
|
||||
ps_path="${_omb_prompt_normal}\w";
|
||||
|
||||
# make it work
|
||||
case $(id -u) in
|
||||
|
||||
@@ -22,10 +22,10 @@
|
||||
#
|
||||
|
||||
export SCM_NONE_CHAR=''
|
||||
export SCM_THEME_PROMPT_DIRTY=" ${red}✗"
|
||||
export SCM_THEME_PROMPT_DIRTY=" ${_omb_prompt_brown}✗"
|
||||
export SCM_THEME_PROMPT_CLEAN=""
|
||||
export SCM_THEME_PROMPT_PREFIX="${green}|"
|
||||
export SCM_THEME_PROMPT_SUFFIX="${green}|"
|
||||
export SCM_THEME_PROMPT_PREFIX="${_omb_prompt_green}|"
|
||||
export SCM_THEME_PROMPT_SUFFIX="${_omb_prompt_green}|"
|
||||
export SCM_GIT_SHOW_MINIMAL_INFO=true
|
||||
|
||||
export VIRTUALENV_THEME_PROMPT_PREFIX='('
|
||||
@@ -35,21 +35,21 @@ function _omb_theme_PROMPT_COMMAND() {
|
||||
# This needs to be first to save last command return code
|
||||
local RC="$?"
|
||||
|
||||
local hostname="${bold_black}\u"
|
||||
local hostname="${_omb_prompt_bold_black}\u"
|
||||
local python_venv; _omb_prompt_get_python_venv
|
||||
python_venv=$white$python_venv
|
||||
python_venv=$_omb_prompt_white$python_venv
|
||||
|
||||
# Set return status color
|
||||
if [[ ${RC} == 0 ]]; then
|
||||
ret_status="${bold_green}"
|
||||
ret_status="${_omb_prompt_bold_green}"
|
||||
else
|
||||
ret_status="${bold_red}"
|
||||
ret_status="${_omb_prompt_bold_brown}"
|
||||
fi
|
||||
|
||||
# Append new history lines to history file
|
||||
history -a
|
||||
|
||||
PS1="$python_venv${hostname} ${bold_cyan}\w $(scm_prompt_char_info)${ret_status}→ ${normal}"
|
||||
PS1="$python_venv${hostname} ${_omb_prompt_bold_teal}\w $(scm_prompt_char_info)${ret_status}→ ${_omb_prompt_normal}"
|
||||
}
|
||||
|
||||
_omb_util_add_prompt_command _omb_theme_PROMPT_COMMAND
|
||||
|
||||
@@ -7,14 +7,14 @@ OSH_THEME_GIT_PROMPT_CLEAN="✓"
|
||||
_omb_theme_half_way_prompt_scm() {
|
||||
local CHAR=$(scm_char)
|
||||
if [[ $CHAR != "$SCM_NONE_CHAR" ]]; then
|
||||
printf '%s' " on ${blue}$(git_current_branch)$(parse_git_dirty)${normal} "
|
||||
printf '%s' " on ${_omb_prompt_navy}$(git_current_branch)$(parse_git_dirty)${_omb_prompt_normal} "
|
||||
fi
|
||||
}
|
||||
|
||||
_omb_theme_PROMPT_COMMAND() {
|
||||
local ps_username="${purple}\u${normal}"
|
||||
local ps_path="${green}\w${normal}"
|
||||
local ps_user_mark="${orange}λ${normal}"
|
||||
local ps_username="${_omb_prompt_purple}\u${_omb_prompt_normal}"
|
||||
local ps_path="${_omb_prompt_green}\w${_omb_prompt_normal}"
|
||||
local ps_user_mark="${_omb_prompt_red}λ${_omb_prompt_normal}"
|
||||
|
||||
PS1="$ps_username in $ps_path$(_omb_theme_half_way_prompt_scm) $ps_user_mark "
|
||||
}
|
||||
|
||||
@@ -42,22 +42,22 @@ VIRTUAL_PROMPT_ENABLED=1
|
||||
# COLORS ======================================================================
|
||||
ORANGE='\[\e[0;33m\]'
|
||||
|
||||
DEFAULT_COLOR="${white}"
|
||||
DEFAULT_COLOR="${_omb_prompt_white}"
|
||||
|
||||
USER_COLOR="${purple}"
|
||||
SUPERUSER_COLOR="${red}"
|
||||
USER_COLOR="${_omb_prompt_purple}"
|
||||
SUPERUSER_COLOR="${_omb_prompt_brown}"
|
||||
MACHINE_COLOR=$ORANGE
|
||||
IP_COLOR=$ORANGE
|
||||
DIRECTORY_COLOR="${green}"
|
||||
DIRECTORY_COLOR="${_omb_prompt_green}"
|
||||
|
||||
VE_COLOR="${cyan}"
|
||||
RVM_COLOR="${cyan}"
|
||||
VE_COLOR="${_omb_prompt_teal}"
|
||||
RVM_COLOR="${_omb_prompt_teal}"
|
||||
|
||||
REF_COLOR="${purple}"
|
||||
REF_COLOR="${_omb_prompt_purple}"
|
||||
|
||||
# SCM prompts
|
||||
SCM_THEME_PROMPT_DIRTY=" ${bold_red}✗${normal}"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓${normal}"
|
||||
SCM_THEME_PROMPT_DIRTY=" ${_omb_prompt_bold_brown}✗${_omb_prompt_normal}"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${_omb_prompt_bold_green}✓${_omb_prompt_normal}"
|
||||
SCM_THEME_PROMPT_PREFIX=' on '
|
||||
SCM_THEME_PROMPT_SUFFIX=''
|
||||
|
||||
@@ -186,9 +186,9 @@ function _omb_theme_PROMPT_COMMAND() {
|
||||
((UID == 0)) && UC=$SUPERUSER_COLOR
|
||||
|
||||
if [[ $VIRTUAL_PROMPT_ENABLED == 1 ]]; then
|
||||
PS1="$(scm_char) ${UC}\u ${DEFAULT_COLOR}at ${MACHINE_COLOR}\h$(ip_prompt_info) ${DEFAULT_COLOR}in ${DIRECTORY_COLOR}$(limited_pwd)${DEFAULT_COLOR}$(virtual_prompt_info)$(scm_prompt_info)${reset_color} \$ "
|
||||
PS1="$(scm_char) ${UC}\u ${DEFAULT_COLOR}at ${MACHINE_COLOR}\h$(ip_prompt_info) ${DEFAULT_COLOR}in ${DIRECTORY_COLOR}$(limited_pwd)${DEFAULT_COLOR}$(virtual_prompt_info)$(scm_prompt_info)${_omb_prompt_reset_color} \$ "
|
||||
else
|
||||
PS1="$(scm_char) ${UC}\u ${DEFAULT_COLOR}at ${MACHINE_COLOR}\h$(ip_prompt_info) ${DEFAULT_COLOR}in ${DIRECTORY_COLOR}$(limited_pwd)${DEFAULT_COLOR}$(scm_prompt_info)${reset_color} \$ "
|
||||
PS1="$(scm_char) ${UC}\u ${DEFAULT_COLOR}at ${MACHINE_COLOR}\h$(ip_prompt_info) ${DEFAULT_COLOR}in ${DIRECTORY_COLOR}$(limited_pwd)${DEFAULT_COLOR}$(scm_prompt_info)${_omb_prompt_reset_color} \$ "
|
||||
fi
|
||||
PS2='> '
|
||||
PS4='+ '
|
||||
|
||||
@@ -3,17 +3,17 @@ SCM_GIT_CHAR="± "
|
||||
SCM_HG_CHAR="☿ "
|
||||
SCM_SVN_CHAR="⑆ "
|
||||
SCM_NONE_CHAR=""
|
||||
SCM_THEME_PROMPT_DIRTY=" ${red}✗"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓"
|
||||
SCM_THEME_PROMPT_DIRTY=" ${_omb_prompt_brown}✗"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${_omb_prompt_bold_green}✓"
|
||||
SCM_THEME_PROMPT_PREFIX="|"
|
||||
SCM_THEME_PROMPT_SUFFIX="${green}| "
|
||||
SCM_GIT_AHEAD_CHAR="${green}+"
|
||||
SCM_GIT_BEHIND_CHAR="${red}-"
|
||||
SCM_THEME_PROMPT_SUFFIX="${_omb_prompt_green}| "
|
||||
SCM_GIT_AHEAD_CHAR="${_omb_prompt_green}+"
|
||||
SCM_GIT_BEHIND_CHAR="${_omb_prompt_brown}-"
|
||||
|
||||
GIT_THEME_PROMPT_DIRTY=" ${bold_red}✗"
|
||||
GIT_THEME_PROMPT_CLEAN=" ${bold_green}✓"
|
||||
GIT_THEME_PROMPT_PREFIX="${cyan}|"
|
||||
GIT_THEME_PROMPT_SUFFIX="${cyan}| "
|
||||
GIT_THEME_PROMPT_DIRTY=" ${_omb_prompt_bold_brown}✗"
|
||||
GIT_THEME_PROMPT_CLEAN=" ${_omb_prompt_bold_green}✓"
|
||||
GIT_THEME_PROMPT_PREFIX="${_omb_prompt_teal}|"
|
||||
GIT_THEME_PROMPT_SUFFIX="${_omb_prompt_teal}| "
|
||||
|
||||
RVM_THEME_PROMPT_PREFIX="|"
|
||||
RVM_THEME_PROMPT_SUFFIX="| "
|
||||
@@ -34,7 +34,7 @@ function git_prompt_info {
|
||||
|
||||
LAST_PROMPT=""
|
||||
function _omb_theme_PROMPT_COMMAND() {
|
||||
local new_PS1="${bold_cyan}$(scm_char)${yellow}$(_omb_prompt_print_ruby_env)${green}\w $(scm_prompt_info)"
|
||||
local new_PS1="${_omb_prompt_bold_teal}$(scm_char)${_omb_prompt_olive}$(_omb_prompt_print_ruby_env)${_omb_prompt_green}\w $(scm_prompt_info)"
|
||||
local new_prompt=$(PS1="$new_PS1" "$BASH" --norc -i </dev/null 2>&1 | sed -n '${s/^\(.*\)exit$/\1/p;}')
|
||||
|
||||
if [ "$LAST_PROMPT" = "$new_prompt" ]; then
|
||||
@@ -45,7 +45,7 @@ function _omb_theme_PROMPT_COMMAND() {
|
||||
|
||||
local wrap_char=""
|
||||
[[ ${#new_PS1} -gt $(($COLUMNS/1)) ]] && wrap_char="\n"
|
||||
PS1="${new_PS1}${green}${wrap_char}→${reset_color} "
|
||||
PS1="${new_PS1}${_omb_prompt_green}${wrap_char}→${_omb_prompt_reset_color} "
|
||||
}
|
||||
|
||||
_omb_util_add_prompt_command _omb_theme_PROMPT_COMMAND
|
||||
|
||||
@@ -21,23 +21,23 @@ function _omb_theme_PROMPT_COMMAND() {
|
||||
|
||||
local SC
|
||||
if ((status == 0)); then
|
||||
SC="$cyan-$bold_green(${green}^_^$bold_green)";
|
||||
SC="$_omb_prompt_teal-$_omb_prompt_bold_green(${_omb_prompt_green}^_^$_omb_prompt_bold_green)";
|
||||
else
|
||||
SC="$cyan-$bold_green(${red}T_T$bold_green)";
|
||||
SC="$_omb_prompt_teal-$_omb_prompt_bold_green(${_omb_prompt_brown}T_T$_omb_prompt_bold_green)";
|
||||
fi
|
||||
|
||||
local BC=$(battery_percentage)
|
||||
[[ $BC == no && $BC == -1 ]] && BC=
|
||||
BC=${BC:+${cyan}-${green}($BC%)}
|
||||
BC=${BC:+${_omb_prompt_teal}-${_omb_prompt_green}($BC%)}
|
||||
|
||||
PS1=$TITLEBAR"\n${cyan}┌─${bold_white}[\u@\h]${cyan}─${bold_yellow}(\w)$(scm_prompt_info)\n${cyan}└─${bold_green}[\A]$SC$BC${cyan}-${bold_cyan}[${green}${bold_green}\$${bold_cyan}]${green} "
|
||||
PS1=$TITLEBAR"\n${_omb_prompt_teal}┌─${_omb_prompt_bold_white}[\u@\h]${_omb_prompt_teal}─${_omb_prompt_bold_olive}(\w)$(scm_prompt_info)\n${_omb_prompt_teal}└─${_omb_prompt_bold_green}[\A]$SC$BC${_omb_prompt_teal}-${_omb_prompt_bold_teal}[${_omb_prompt_green}${_omb_prompt_bold_green}\$${_omb_prompt_bold_teal}]${_omb_prompt_green} "
|
||||
}
|
||||
|
||||
# scm theming
|
||||
SCM_THEME_PROMPT_DIRTY=" ${red}✗"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓"
|
||||
SCM_THEME_PROMPT_PREFIX="${bold_cyan}("
|
||||
SCM_THEME_PROMPT_SUFFIX="${bold_cyan})${reset_color}"
|
||||
SCM_THEME_PROMPT_DIRTY=" ${_omb_prompt_brown}✗"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${_omb_prompt_bold_green}✓"
|
||||
SCM_THEME_PROMPT_PREFIX="${_omb_prompt_bold_teal}("
|
||||
SCM_THEME_PROMPT_SUFFIX="${_omb_prompt_bold_teal})${_omb_prompt_reset_color}"
|
||||
|
||||
|
||||
_omb_util_add_prompt_command _omb_theme_PROMPT_COMMAND
|
||||
|
||||
@@ -1,33 +1,33 @@
|
||||
#! bash oh-my-bash.module
|
||||
|
||||
SCM_THEME_PROMPT_DIRTY=" ${red}✗"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓"
|
||||
SCM_THEME_PROMPT_PREFIX="(${yellow}"
|
||||
SCM_THEME_PROMPT_SUFFIX="${normal})"
|
||||
SCM_THEME_PROMPT_DIRTY=" ${_omb_prompt_brown}✗"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${_omb_prompt_bold_green}✓"
|
||||
SCM_THEME_PROMPT_PREFIX="(${_omb_prompt_olive}"
|
||||
SCM_THEME_PROMPT_SUFFIX="${_omb_prompt_normal})"
|
||||
|
||||
GIT_THEME_PROMPT_DIRTY=" ${red}✗"
|
||||
GIT_THEME_PROMPT_CLEAN=" ${bold_green}✓"
|
||||
GIT_THEME_PROMPT_PREFIX="(${yellow}"
|
||||
GIT_THEME_PROMPT_SUFFIX="${normal})"
|
||||
GIT_THEME_PROMPT_DIRTY=" ${_omb_prompt_brown}✗"
|
||||
GIT_THEME_PROMPT_CLEAN=" ${_omb_prompt_bold_green}✓"
|
||||
GIT_THEME_PROMPT_PREFIX="(${_omb_prompt_olive}"
|
||||
GIT_THEME_PROMPT_SUFFIX="${_omb_prompt_normal})"
|
||||
|
||||
RVM_THEME_PROMPT_PREFIX=""
|
||||
RVM_THEME_PROMPT_SUFFIX=""
|
||||
|
||||
function _omb_theme_PROMPT_COMMAND() {
|
||||
dtime="$(clock_prompt)"
|
||||
user_host="${green}\u@${cyan}\h${normal}"
|
||||
current_dir="${bold_blue}\w${normal}"
|
||||
rvm_ruby="${bold_red}$(_omb_prompt_print_ruby_env)${normal}"
|
||||
git_branch="$(scm_prompt_info)${normal}"
|
||||
prompt="${bold_green}\$${normal} "
|
||||
arrow="${bold_white}▶${normal} "
|
||||
prompt="${bold_green}\$${normal} "
|
||||
user_host="${_omb_prompt_green}\u@${_omb_prompt_teal}\h${_omb_prompt_normal}"
|
||||
current_dir="${_omb_prompt_bold_navy}\w${_omb_prompt_normal}"
|
||||
rvm_ruby="${_omb_prompt_bold_brown}$(_omb_prompt_print_ruby_env)${_omb_prompt_normal}"
|
||||
git_branch="$(scm_prompt_info)${_omb_prompt_normal}"
|
||||
prompt="${_omb_prompt_bold_green}\$${_omb_prompt_normal} "
|
||||
arrow="${_omb_prompt_bold_white}▶${_omb_prompt_normal} "
|
||||
prompt="${_omb_prompt_bold_green}\$${_omb_prompt_normal} "
|
||||
|
||||
PS1="${dtime}${user_host}:${current_dir} ${rvm_ruby} ${git_branch}
|
||||
$arrow $prompt"
|
||||
}
|
||||
|
||||
THEME_CLOCK_COLOR=${THEME_CLOCK_COLOR:-"$yellow"}
|
||||
THEME_CLOCK_COLOR=${THEME_CLOCK_COLOR:-"$_omb_prompt_olive"}
|
||||
THEME_CLOCK_FORMAT=${THEME_TIME_FORMAT:-"%I:%M:%S "}
|
||||
|
||||
_omb_util_add_prompt_command _omb_theme_PROMPT_COMMAND
|
||||
|
||||
@@ -35,11 +35,11 @@ BRACKET_COLOR=$ORANGE
|
||||
SCM_THEME_PROMPT_PREFIX=""
|
||||
SCM_THEME_PROMPT_SUFFIX=""
|
||||
|
||||
SCM_THEME_PROMPT_DIRTY=" ${bold_red}✗${normal}"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓${normal}"
|
||||
SCM_GIT_CHAR="${bold_green}±${normal}"
|
||||
SCM_SVN_CHAR="${bold_cyan}⑆${normal}"
|
||||
SCM_HG_CHAR="${bold_red}☿${normal}"
|
||||
SCM_THEME_PROMPT_DIRTY=" ${_omb_prompt_bold_brown}✗${_omb_prompt_normal}"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${_omb_prompt_bold_green}✓${_omb_prompt_normal}"
|
||||
SCM_GIT_CHAR="${_omb_prompt_bold_green}±${_omb_prompt_normal}"
|
||||
SCM_SVN_CHAR="${_omb_prompt_bold_teal}⑆${_omb_prompt_normal}"
|
||||
SCM_HG_CHAR="${_omb_prompt_bold_brown}☿${_omb_prompt_normal}"
|
||||
|
||||
#Mysql Prompt
|
||||
export MYSQL_PS1="(\u@\h) [\d]> "
|
||||
@@ -66,7 +66,7 @@ __my_rvm_ruby_version() {
|
||||
is_vim_shell() {
|
||||
if [ ! -z "$VIMRUNTIME" ]
|
||||
then
|
||||
echo "[${cyan}vim shell${normal}]"
|
||||
echo "[${_omb_prompt_teal}vim shell${_omb_prompt_normal}]"
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ modern_scm_prompt() {
|
||||
chroot(){
|
||||
if [ -n "$debian_chroot" ]
|
||||
then
|
||||
my_ps_chroot="${bold_cyan}$debian_chroot${normal}";
|
||||
my_ps_chroot="${_omb_prompt_bold_teal}$debian_chroot${_omb_prompt_normal}";
|
||||
echo "($my_ps_chroot)";
|
||||
fi
|
||||
}
|
||||
@@ -93,7 +93,7 @@ chroot(){
|
||||
my_ve(){
|
||||
if [ -n "$VIRTUAL_ENV" ]
|
||||
then
|
||||
my_ps_ve="${bold_purple}$ve${normal}";
|
||||
my_ps_ve="${_omb_prompt_bold_purple}$ve${_omb_prompt_normal}";
|
||||
echo "($my_ps_ve)";
|
||||
fi
|
||||
echo "";
|
||||
@@ -101,12 +101,12 @@ my_ve(){
|
||||
|
||||
_omb_theme_PROMPT_COMMAND() {
|
||||
|
||||
my_ps_host="$BOLD$ORANGE\h${normal}";
|
||||
my_ps_host="$BOLD$ORANGE\h${_omb_prompt_normal}";
|
||||
# yes, these are the the same for now ...
|
||||
my_ps_host_root="$ORANGE\h${normal}";
|
||||
my_ps_host_root="$ORANGE\h${_omb_prompt_normal}";
|
||||
|
||||
my_ps_user="$BOLD$GREEN\u${normal}"
|
||||
my_ps_root="${bold_red}\u${normal}";
|
||||
my_ps_user="$BOLD$GREEN\u${_omb_prompt_normal}"
|
||||
my_ps_root="${_omb_prompt_bold_brown}\u${_omb_prompt_normal}";
|
||||
|
||||
if [ -n "$VIRTUAL_ENV" ]
|
||||
then
|
||||
@@ -115,11 +115,11 @@ _omb_theme_PROMPT_COMMAND() {
|
||||
|
||||
# nice prompt
|
||||
case "`id -u`" in
|
||||
0) PS1="\n${TITLEBAR}${BRACKET_COLOR}┌─${normal}$(my_ve)$(chroot)[$my_ps_root][$my_ps_host_root]$(modern_scm_prompt)$(__my_rvm_ruby_version)[${green}\w${normal}]$(is_vim_shell)${BRACKET_COLOR}
|
||||
└─▪ ${prompt_symbol} ${normal}"
|
||||
0) PS1="\n${TITLEBAR}${BRACKET_COLOR}┌─${_omb_prompt_normal}$(my_ve)$(chroot)[$my_ps_root][$my_ps_host_root]$(modern_scm_prompt)$(__my_rvm_ruby_version)[${_omb_prompt_green}\w${_omb_prompt_normal}]$(is_vim_shell)${BRACKET_COLOR}
|
||||
└─▪ ${prompt_symbol} ${_omb_prompt_normal}"
|
||||
;;
|
||||
*) PS1="\n${TITLEBAR}${BRACKET_COLOR}┌─${normal}$(my_ve)$(chroot)[$my_ps_user][$my_ps_host]$(modern_scm_prompt)${normal}$(__my_rvm_ruby_version)[${green}\w${normal}]$(is_vim_shell)${BRACKET_COLOR}
|
||||
└─▪ ${prompt_symbol} ${normal}"
|
||||
*) PS1="\n${TITLEBAR}${BRACKET_COLOR}┌─${_omb_prompt_normal}$(my_ve)$(chroot)[$my_ps_user][$my_ps_host]$(modern_scm_prompt)${_omb_prompt_normal}$(__my_rvm_ruby_version)[${_omb_prompt_green}\w${_omb_prompt_normal}]$(is_vim_shell)${BRACKET_COLOR}
|
||||
└─▪ ${prompt_symbol} ${_omb_prompt_normal}"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
# BASED ON: smt by Stephen Tudor (stephen@tudorstudio.com) #
|
||||
# ------------------------------------------------------------------#
|
||||
|
||||
SCM_THEME_PROMPT_DIRTY="${red}⚡${reset_color}"
|
||||
SCM_THEME_PROMPT_AHEAD="${red}!${reset_color}"
|
||||
SCM_THEME_PROMPT_CLEAN="${green}✓${reset_color}"
|
||||
SCM_THEME_PROMPT_DIRTY="${_omb_prompt_brown}⚡${_omb_prompt_reset_color}"
|
||||
SCM_THEME_PROMPT_AHEAD="${_omb_prompt_brown}!${_omb_prompt_reset_color}"
|
||||
SCM_THEME_PROMPT_CLEAN="${_omb_prompt_green}✓${_omb_prompt_reset_color}"
|
||||
SCM_THEME_PROMPT_PREFIX=" "
|
||||
SCM_THEME_PROMPT_SUFFIX=""
|
||||
GIT_SHA_PREFIX=" ${yellow}"
|
||||
GIT_SHA_SUFFIX="${reset_color}"
|
||||
GIT_SHA_PREFIX=" ${_omb_prompt_olive}"
|
||||
GIT_SHA_SUFFIX="${_omb_prompt_reset_color}"
|
||||
|
||||
function git_short_sha() {
|
||||
SHA=$(git rev-parse --short HEAD 2> /dev/null) && echo "$GIT_SHA_PREFIX$SHA$GIT_SHA_SUFFIX"
|
||||
@@ -19,8 +19,8 @@ function git_short_sha() {
|
||||
|
||||
function _omb_theme_PROMPT_COMMAND() {
|
||||
local return_status=""
|
||||
local ruby="${red}$(_omb_prompt_print_ruby_env)${reset_color}"
|
||||
local user_host="${green}\h${reset_color}"
|
||||
local ruby="${_omb_prompt_brown}$(_omb_prompt_print_ruby_env)${_omb_prompt_reset_color}"
|
||||
local user_host="${_omb_prompt_green}\h${_omb_prompt_reset_color}"
|
||||
local current_path="\w"
|
||||
local n_commands="\!"
|
||||
local git_branch="$(git_short_sha)$(scm_prompt_info)"
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#! bash oh-my-bash.module
|
||||
|
||||
SCM_THEME_PROMPT_PREFIX="${cyan}(${green}"
|
||||
SCM_THEME_PROMPT_SUFFIX="${cyan})"
|
||||
SCM_THEME_PROMPT_DIRTY=" ${red}✗"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${green}✓"
|
||||
SCM_THEME_PROMPT_PREFIX="${_omb_prompt_teal}(${_omb_prompt_green}"
|
||||
SCM_THEME_PROMPT_SUFFIX="${_omb_prompt_teal})"
|
||||
SCM_THEME_PROMPT_DIRTY=" ${_omb_prompt_brown}✗"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${_omb_prompt_green}✓"
|
||||
|
||||
_omb_theme_PROMPT_COMMAND() {
|
||||
PS1="$(scm_prompt_info)${reset_color} ${cyan}\W${reset_color} "
|
||||
PS1="$(scm_prompt_info)${_omb_prompt_reset_color} ${_omb_prompt_teal}\W${_omb_prompt_reset_color} "
|
||||
}
|
||||
|
||||
_omb_util_add_prompt_command _omb_theme_PROMPT_COMMAND
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
SCM_THEME_PROMPT_PREFIX=""
|
||||
SCM_THEME_PROMPT_SUFFIX=""
|
||||
|
||||
SCM_THEME_PROMPT_DIRTY=" ${bold_red}✗${normal}"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓${normal}"
|
||||
SCM_GIT_CHAR="${bold_green}±${normal}"
|
||||
SCM_SVN_CHAR="${bold_cyan}⑆${normal}"
|
||||
SCM_HG_CHAR="${bold_red}☿${normal}"
|
||||
SCM_THEME_PROMPT_DIRTY=" ${_omb_prompt_bold_brown}✗${_omb_prompt_normal}"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${_omb_prompt_bold_green}✓${_omb_prompt_normal}"
|
||||
SCM_GIT_CHAR="${_omb_prompt_bold_green}±${_omb_prompt_normal}"
|
||||
SCM_SVN_CHAR="${_omb_prompt_bold_teal}⑆${_omb_prompt_normal}"
|
||||
SCM_HG_CHAR="${_omb_prompt_bold_brown}☿${_omb_prompt_normal}"
|
||||
|
||||
case $TERM in
|
||||
xterm*)
|
||||
@@ -22,7 +22,7 @@ PS3=">> "
|
||||
is_vim_shell() {
|
||||
if [ ! -z "$VIMRUNTIME" ]
|
||||
then
|
||||
echo "[${cyan}vim shell${normal}]"
|
||||
echo "[${_omb_prompt_teal}vim shell${_omb_prompt_normal}]"
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -42,10 +42,10 @@ _omb_theme_PROMPT_COMMAND() {
|
||||
# Yes, the indenting on these is weird, but it has to be like
|
||||
# this otherwise it won't display properly.
|
||||
|
||||
PS1="${TITLEBAR}${bold_red}┌─[${cyan}$(t | wc -l | sed -e's/ *//')${reset_color}]${reset_color}$(modern_scm_prompt)[${cyan}\W${normal}]$(is_vim_shell)
|
||||
${bold_red}└─▪${normal} "
|
||||
PS1="${TITLEBAR}${_omb_prompt_bold_brown}┌─[${_omb_prompt_teal}$(t | wc -l | sed -e's/ *//')${_omb_prompt_reset_color}]${_omb_prompt_reset_color}$(modern_scm_prompt)[${_omb_prompt_teal}\W${_omb_prompt_normal}]$(is_vim_shell)
|
||||
${_omb_prompt_bold_brown}└─▪${_omb_prompt_normal} "
|
||||
else
|
||||
PS1="${TITLEBAR}┌─[${cyan}$(t | wc -l | sed -e's/ *//')${reset_color}]$(modern_scm_prompt)[${cyan}\W${normal}]$(is_vim_shell)
|
||||
PS1="${TITLEBAR}┌─[${_omb_prompt_teal}$(t | wc -l | sed -e's/ *//')${_omb_prompt_reset_color}]$(modern_scm_prompt)[${_omb_prompt_teal}\W${_omb_prompt_normal}]$(is_vim_shell)
|
||||
└─▪ "
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
SCM_THEME_PROMPT_PREFIX=""
|
||||
SCM_THEME_PROMPT_SUFFIX=""
|
||||
|
||||
SCM_THEME_PROMPT_DIRTY=" ${bold_red}✗${normal}"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓${normal}"
|
||||
SCM_GIT_CHAR="${bold_green}±${normal}"
|
||||
SCM_SVN_CHAR="${bold_cyan}⑆${normal}"
|
||||
SCM_HG_CHAR="${bold_red}☿${normal}"
|
||||
SCM_THEME_PROMPT_DIRTY=" ${_omb_prompt_bold_brown}✗${_omb_prompt_normal}"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${_omb_prompt_bold_green}✓${_omb_prompt_normal}"
|
||||
SCM_GIT_CHAR="${_omb_prompt_bold_green}±${_omb_prompt_normal}"
|
||||
SCM_SVN_CHAR="${_omb_prompt_bold_teal}⑆${_omb_prompt_normal}"
|
||||
SCM_HG_CHAR="${_omb_prompt_bold_brown}☿${_omb_prompt_normal}"
|
||||
|
||||
case $TERM in
|
||||
xterm*)
|
||||
@@ -22,7 +22,7 @@ PS3=">> "
|
||||
is_vim_shell() {
|
||||
if [ ! -z "$VIMRUNTIME" ]
|
||||
then
|
||||
echo "[${cyan}vim shell${normal}]"
|
||||
echo "[${_omb_prompt_teal}vim shell${_omb_prompt_normal}]"
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -42,10 +42,10 @@ _omb_theme_PROMPT_COMMAND() {
|
||||
# Yes, the indenting on these is weird, but it has to be like
|
||||
# this otherwise it won't display properly.
|
||||
|
||||
PS1="${TITLEBAR}${bold_red}┌─${reset_color}$(modern_scm_prompt)[${cyan}\W${normal}][$(battery_charge)]$(is_vim_shell)
|
||||
${bold_red}└─▪${normal} "
|
||||
PS1="${TITLEBAR}${_omb_prompt_bold_brown}┌─${_omb_prompt_reset_color}$(modern_scm_prompt)[${_omb_prompt_teal}\W${_omb_prompt_normal}][$(battery_charge)]$(is_vim_shell)
|
||||
${_omb_prompt_bold_brown}└─▪${_omb_prompt_normal} "
|
||||
else
|
||||
PS1="${TITLEBAR}┌─$(modern_scm_prompt)[${cyan}\W${normal}][$(battery_charge)]$(is_vim_shell)
|
||||
PS1="${TITLEBAR}┌─$(modern_scm_prompt)[${_omb_prompt_teal}\W${_omb_prompt_normal}][$(battery_charge)]$(is_vim_shell)
|
||||
└─▪ "
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -20,10 +20,10 @@ function _omb_theme_PROMPT_COMMAND() {
|
||||
}
|
||||
|
||||
# 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}"
|
||||
SCM_THEME_PROMPT_DIRTY=" ${_omb_prompt_brown}✗"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${_omb_prompt_bold_green}✓"
|
||||
SCM_THEME_PROMPT_PREFIX="${_omb_prompt_green}("
|
||||
SCM_THEME_PROMPT_SUFFIX="${_omb_prompt_green})${_omb_prompt_reset_color}"
|
||||
|
||||
|
||||
_omb_util_add_prompt_command _omb_theme_PROMPT_COMMAND
|
||||
|
||||
@@ -6,17 +6,17 @@
|
||||
# for example:
|
||||
# ananas ~/Code/bash-it/themes (master*)»
|
||||
function _omb_theme_PROMPT_COMMAND() {
|
||||
PS1="${bold_blue}[$(hostname)]${normal} \w${normal} ${bold_white}[$(git_prompt_info)]${normal}» "
|
||||
PS1="${_omb_prompt_bold_navy}[$(hostname)]${_omb_prompt_normal} \w${_omb_prompt_normal} ${_omb_prompt_bold_white}[$(git_prompt_info)]${_omb_prompt_normal}» "
|
||||
}
|
||||
|
||||
_omb_util_add_prompt_command _omb_theme_PROMPT_COMMAND
|
||||
|
||||
## git-theme
|
||||
# feel free to change git chars.
|
||||
GIT_THEME_PROMPT_DIRTY="${bold_blue}*${bold_white}"
|
||||
GIT_THEME_PROMPT_DIRTY="${_omb_prompt_bold_navy}*${_omb_prompt_bold_white}"
|
||||
GIT_THEME_PROMPT_CLEAN=""
|
||||
GIT_THEME_PROMPT_PREFIX="${bold_blue}(${bold_white}"
|
||||
GIT_THEME_PROMPT_SUFFIX="${bold_blue})"
|
||||
GIT_THEME_PROMPT_PREFIX="${_omb_prompt_bold_navy}(${_omb_prompt_bold_white}"
|
||||
GIT_THEME_PROMPT_SUFFIX="${_omb_prompt_bold_navy})"
|
||||
|
||||
## alternate chars
|
||||
#
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
# since 'fasd' is messing with the $PROMPT_COMMAND
|
||||
|
||||
|
||||
PROMPT_END_CLEAN="${green}→${reset_color}"
|
||||
PROMPT_END_DIRTY="${red}→${reset_color}"
|
||||
PROMPT_END_CLEAN="${_omb_prompt_green}→${_omb_prompt_reset_color}"
|
||||
PROMPT_END_DIRTY="${_omb_prompt_brown}→${_omb_prompt_reset_color}"
|
||||
|
||||
function prompt_end() {
|
||||
echo -e "$PROMPT_END"
|
||||
@@ -32,15 +32,15 @@ _omb_theme_PROMPT_COMMAND() {
|
||||
#history -a
|
||||
#history -c
|
||||
#history -r
|
||||
PS1="($(clock_prompt)) $(scm_char) [${blue}\u${reset_color}@${green}\H${reset_color}] ${yellow}\w${reset_color}$(scm_prompt_info) ${reset_color}\n$(prompt_end) "
|
||||
PS1="($(clock_prompt)) $(scm_char) [${_omb_prompt_navy}\u${_omb_prompt_reset_color}@${_omb_prompt_green}\H${_omb_prompt_reset_color}] ${_omb_prompt_olive}\w${_omb_prompt_reset_color}$(scm_prompt_info) ${_omb_prompt_reset_color}\n$(prompt_end) "
|
||||
PS2='> '
|
||||
PS4='+ '
|
||||
}
|
||||
|
||||
_omb_util_add_prompt_command _omb_theme_PROMPT_COMMAND
|
||||
|
||||
SCM_THEME_PROMPT_DIRTY=" ${bold_red}✗${normal}"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓${normal}"
|
||||
SCM_THEME_PROMPT_DIRTY=" ${_omb_prompt_bold_brown}✗${_omb_prompt_normal}"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${_omb_prompt_bold_green}✓${_omb_prompt_normal}"
|
||||
SCM_THEME_PROMPT_PREFIX=" ("
|
||||
SCM_THEME_PROMPT_SUFFIX=")"
|
||||
RVM_THEME_PROMPT_PREFIX=" ("
|
||||
|
||||
@@ -21,36 +21,36 @@ function randomize_nwinkler {
|
||||
declare -a AVAILABLE_COLORS
|
||||
|
||||
AVAILABLE_COLORS=(
|
||||
$black
|
||||
$red
|
||||
$green
|
||||
$yellow
|
||||
$blue
|
||||
$purple
|
||||
$cyan
|
||||
$white
|
||||
$orange
|
||||
$bold_black
|
||||
$bold_red
|
||||
$bold_green
|
||||
$bold_yellow
|
||||
$bold_blue
|
||||
$bold_purple
|
||||
$bold_cyan
|
||||
$bold_white
|
||||
$bold_orange
|
||||
"$_omb_prompt_black"
|
||||
"$_omb_prompt_brown"
|
||||
"$_omb_prompt_green"
|
||||
"$_omb_prompt_olive"
|
||||
"$_omb_prompt_navy"
|
||||
"$_omb_prompt_purple"
|
||||
"$_omb_prompt_teal"
|
||||
"$_omb_prompt_white"
|
||||
"$_omb_prompt_red"
|
||||
"$_omb_prompt_bold_black"
|
||||
"$_omb_prompt_bold_brown"
|
||||
"$_omb_prompt_bold_green"
|
||||
"$_omb_prompt_bold_olive"
|
||||
"$_omb_prompt_bold_navy"
|
||||
"$_omb_prompt_bold_purple"
|
||||
"$_omb_prompt_bold_teal"
|
||||
"$_omb_prompt_bold_white"
|
||||
"$_omb_prompt_bold_red"
|
||||
|
||||
# # Uncomment these to allow underlines:
|
||||
# "$_omb_prompt_underline_black"
|
||||
# "$_omb_prompt_underline_brown"
|
||||
# "$_omb_prompt_underline_green"
|
||||
# "$_omb_prompt_underline_olive"
|
||||
# "$_omb_prompt_underline_navy"
|
||||
# "$_omb_prompt_underline_purple"
|
||||
# "$_omb_prompt_underline_teal"
|
||||
# "$_omb_prompt_underline_white"
|
||||
# "$_omb_prompt_underline_red"
|
||||
)
|
||||
# Uncomment these to allow underlines:
|
||||
#$underline_black
|
||||
#$underline_red
|
||||
#$underline_green
|
||||
#$underline_yellow
|
||||
#$underline_blue
|
||||
#$underline_purple
|
||||
#$underline_cyan
|
||||
#$underline_white
|
||||
#$underline_orange
|
||||
#)
|
||||
|
||||
USERNAME_COLOR=${AVAILABLE_COLORS[$RANDOM % ${#AVAILABLE_COLORS[@]} ]}
|
||||
HOSTNAME_COLOR=${AVAILABLE_COLORS[$RANDOM % ${#AVAILABLE_COLORS[@]} ]}
|
||||
@@ -83,8 +83,8 @@ else
|
||||
echo
|
||||
fi
|
||||
|
||||
PROMPT_END_CLEAN="${green}→${reset_color}"
|
||||
PROMPT_END_DIRTY="${red}→${reset_color}"
|
||||
PROMPT_END_CLEAN="${_omb_prompt_green}→${_omb_prompt_reset_color}"
|
||||
PROMPT_END_DIRTY="${_omb_prompt_brown}→${_omb_prompt_reset_color}"
|
||||
|
||||
function prompt_end() {
|
||||
echo -e "$PROMPT_END"
|
||||
@@ -99,15 +99,15 @@ _omb_theme_PROMPT_COMMAND() {
|
||||
history -a
|
||||
history -c
|
||||
history -r
|
||||
PS1="($(clock_prompt)${reset_color}) $(scm_char) [${USERNAME_COLOR}\u${reset_color}@${HOSTNAME_COLOR}\H${reset_color}] ${PATH_COLOR}\w${reset_color}$(scm_prompt_info) ${reset_color}\n$(prompt_end) "
|
||||
PS1="($(clock_prompt)${_omb_prompt_reset_color}) $(scm_char) [${USERNAME_COLOR}\u${_omb_prompt_reset_color}@${HOSTNAME_COLOR}\H${_omb_prompt_reset_color}] ${PATH_COLOR}\w${_omb_prompt_reset_color}$(scm_prompt_info) ${_omb_prompt_reset_color}\n$(prompt_end) "
|
||||
PS2='> '
|
||||
PS4='+ '
|
||||
}
|
||||
|
||||
_omb_util_add_prompt_command _omb_theme_PROMPT_COMMAND
|
||||
|
||||
SCM_THEME_PROMPT_DIRTY=" ${bold_red}✗${normal}"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓${normal}"
|
||||
SCM_THEME_PROMPT_DIRTY=" ${_omb_prompt_bold_brown}✗${_omb_prompt_normal}"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${_omb_prompt_bold_green}✓${_omb_prompt_normal}"
|
||||
SCM_THEME_PROMPT_PREFIX=" ("
|
||||
SCM_THEME_PROMPT_SUFFIX=")"
|
||||
RVM_THEME_PROMPT_PREFIX=" ("
|
||||
|
||||
@@ -5,7 +5,7 @@ _omb_theme_PROMPT_COMMAND() {
|
||||
history -a
|
||||
history -c
|
||||
history -r
|
||||
PS1="($(clock_prompt)) $(scm_char) [$blue\u$reset_color@$green\H$reset_color] $yellow\w${reset_color}$(scm_prompt_info)$(_omb_prompt_print_ruby_env) $reset_color "
|
||||
PS1="($(clock_prompt)) $(scm_char) [$_omb_prompt_navy\u$_omb_prompt_reset_color@$_omb_prompt_green\H$_omb_prompt_reset_color] $_omb_prompt_olive\w${_omb_prompt_reset_color}$(scm_prompt_info)$(_omb_prompt_print_ruby_env) $_omb_prompt_reset_color "
|
||||
PS2='> '
|
||||
PS4='+ '
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
source "$OSH/themes/powerline/powerline.base.sh"
|
||||
|
||||
function __powerline_last_status_prompt {
|
||||
[[ "$1" -ne 0 ]] && echo "$(set_color ${LAST_STATUS_THEME_PROMPT_COLOR} -) ${1} ${normal}"
|
||||
[[ "$1" -ne 0 ]] && echo "$(set_color ${LAST_STATUS_THEME_PROMPT_COLOR} -) ${1} ${_omb_prompt_normal}"
|
||||
}
|
||||
|
||||
function __powerline_right_segment {
|
||||
@@ -20,7 +20,7 @@ function __powerline_right_segment {
|
||||
separator_color="$(set_color ${params[1]} ${LAST_SEGMENT_COLOR})"
|
||||
(( padding += 1 ))
|
||||
fi
|
||||
RIGHT_PROMPT+="${separator_color}${separator_char}${normal}$(set_color - ${params[1]}) ${params[0]} ${normal}$(set_color - ${COLOR})${normal}"
|
||||
RIGHT_PROMPT+="${separator_color}${separator_char}${_omb_prompt_normal}$(set_color - ${params[1]}) ${params[0]} ${_omb_prompt_normal}$(set_color - ${COLOR})${_omb_prompt_normal}"
|
||||
RIGHT_PROMPT_LENGTH=$(( ${#params[0]} + RIGHT_PROMPT_LENGTH + padding ))
|
||||
LAST_SEGMENT_COLOR="${params[1]}"
|
||||
(( SEGMENTS_AT_RIGHT += 1 ))
|
||||
@@ -43,7 +43,7 @@ function __powerline_prompt_command {
|
||||
local info="$(__powerline_${segment}_prompt)"
|
||||
[[ -n "${info}" ]] && __powerline_left_segment "${info}"
|
||||
done
|
||||
[[ -n "${LEFT_PROMPT}" ]] && LEFT_PROMPT+="$(set_color ${LAST_SEGMENT_COLOR} -)${separator_char}${normal}"
|
||||
[[ -n "${LEFT_PROMPT}" ]] && LEFT_PROMPT+="$(set_color ${LAST_SEGMENT_COLOR} -)${separator_char}${_omb_prompt_normal}"
|
||||
|
||||
## right prompt ##
|
||||
if [[ -n "${POWERLINE_RIGHT_PROMPT}" ]]; then
|
||||
|
||||
@@ -12,6 +12,6 @@ function __powerline_left_segment {
|
||||
if [[ "${SEGMENTS_AT_LEFT}" -gt 0 ]]; then
|
||||
separator="${separator_char}"
|
||||
fi
|
||||
LEFT_PROMPT+="${separator}$(set_color ${params[1]} -) ${params[0]} ${normal}"
|
||||
LEFT_PROMPT+="${separator}$(set_color ${params[1]} -) ${params[0]} ${_omb_prompt_normal}"
|
||||
(( SEGMENTS_AT_LEFT += 1 ))
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ function __powerline_left_segment {
|
||||
local params=( $1 )
|
||||
IFS="${OLD_IFS}"
|
||||
|
||||
LEFT_PROMPT+="${separator}$(set_color - ${params[1]}) ${params[0]} ${normal}"
|
||||
LEFT_PROMPT+="${separator}$(set_color - ${params[1]}) ${params[0]} ${_omb_prompt_normal}"
|
||||
LAST_SEGMENT_COLOR=${params[1]}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ function __powerline_prompt_command {
|
||||
[[ -n "${info}" ]] && __powerline_left_segment "${info}"
|
||||
done
|
||||
[[ "${last_status}" -ne 0 ]] && __powerline_left_segment $(__powerline_last_status_prompt ${last_status})
|
||||
[[ -n "${LEFT_PROMPT}" ]] && LEFT_PROMPT+="$(set_color ${LAST_SEGMENT_COLOR} -) ${normal}"
|
||||
[[ -n "${LEFT_PROMPT}" ]] && LEFT_PROMPT+="$(set_color ${LAST_SEGMENT_COLOR} -) ${_omb_prompt_normal}"
|
||||
|
||||
PS1="${LEFT_PROMPT} "
|
||||
|
||||
|
||||
@@ -130,9 +130,9 @@ function __powerline_left_segment {
|
||||
local separator=""
|
||||
|
||||
if [[ "${SEGMENTS_AT_LEFT}" -gt 0 ]]; then
|
||||
separator="$(set_color ${LAST_SEGMENT_COLOR} ${params[1]})${separator_char}${normal}"
|
||||
separator="$(set_color ${LAST_SEGMENT_COLOR} ${params[1]})${separator_char}${_omb_prompt_normal}"
|
||||
fi
|
||||
LEFT_PROMPT+="${separator}$(set_color - ${params[1]}) ${params[0]} ${normal}"
|
||||
LEFT_PROMPT+="${separator}$(set_color - ${params[1]}) ${params[0]} ${_omb_prompt_normal}"
|
||||
LAST_SEGMENT_COLOR=${params[1]}
|
||||
(( SEGMENTS_AT_LEFT += 1 ))
|
||||
}
|
||||
@@ -160,7 +160,7 @@ function __powerline_prompt_command {
|
||||
[[ -n "${info}" ]] && __powerline_left_segment "${info}"
|
||||
done
|
||||
[[ "${last_status}" -ne 0 ]] && __powerline_left_segment $(__powerline_last_status_prompt ${last_status})
|
||||
[[ -n "${LEFT_PROMPT}" ]] && LEFT_PROMPT+="$(set_color ${LAST_SEGMENT_COLOR} -)${separator_char}${normal}"
|
||||
[[ -n "${LEFT_PROMPT}" ]] && LEFT_PROMPT+="$(set_color ${LAST_SEGMENT_COLOR} -)${separator_char}${_omb_prompt_normal}"
|
||||
|
||||
PS1="${LEFT_PROMPT} "
|
||||
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
# based of the candy theme, but minimized by odbol
|
||||
function _omb_theme_PROMPT_COMMAND() {
|
||||
PS1="$(clock_prompt) ${reset_color}${white}\w${reset_color}$(scm_prompt_info)${blue} →${bold_blue} ${reset_color} ";
|
||||
PS1="$(clock_prompt) ${_omb_prompt_reset_color}${_omb_prompt_white}\w${_omb_prompt_reset_color}$(scm_prompt_info)${_omb_prompt_navy} →${_omb_prompt_bold_navy} ${_omb_prompt_reset_color} ";
|
||||
}
|
||||
|
||||
THEME_CLOCK_COLOR=${THEME_CLOCK_COLOR:-"$blue"}
|
||||
THEME_CLOCK_COLOR=${THEME_CLOCK_COLOR:-"$_omb_prompt_navy"}
|
||||
THEME_CLOCK_FORMAT=${THEME_CLOCK_FORMAT:-"%I:%M:%S"}
|
||||
|
||||
_omb_util_add_prompt_command _omb_theme_PROMPT_COMMAND
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
#! bash oh-my-bash.module
|
||||
|
||||
SCM_THEME_PROMPT_DIRTY=" ${red}✗"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${green}✓"
|
||||
SCM_THEME_PROMPT_PREFIX=" ${blue}scm:( "
|
||||
SCM_THEME_PROMPT_SUFFIX="${blue} )"
|
||||
SCM_THEME_PROMPT_DIRTY=" ${_omb_prompt_brown}✗"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${_omb_prompt_green}✓"
|
||||
SCM_THEME_PROMPT_PREFIX=" ${_omb_prompt_navy}scm:( "
|
||||
SCM_THEME_PROMPT_SUFFIX="${_omb_prompt_navy} )"
|
||||
|
||||
GIT_THEME_PROMPT_DIRTY=" ${red}✗"
|
||||
GIT_THEME_PROMPT_CLEAN=" ${green}✓"
|
||||
GIT_THEME_PROMPT_PREFIX="${green}git:( "
|
||||
GIT_THEME_PROMPT_SUFFIX="${green} )"
|
||||
GIT_THEME_PROMPT_DIRTY=" ${_omb_prompt_brown}✗"
|
||||
GIT_THEME_PROMPT_CLEAN=" ${_omb_prompt_green}✓"
|
||||
GIT_THEME_PROMPT_PREFIX="${_omb_prompt_green}git:( "
|
||||
GIT_THEME_PROMPT_SUFFIX="${_omb_prompt_green} )"
|
||||
|
||||
function git_prompt_info {
|
||||
git_prompt_vars
|
||||
@@ -16,7 +16,7 @@ function git_prompt_info {
|
||||
}
|
||||
|
||||
function _omb_theme_PROMPT_COMMAND() {
|
||||
PS1="\h: \W $(scm_prompt_info)${reset_color} $ "
|
||||
PS1="\h: \W $(scm_prompt_info)${_omb_prompt_reset_color} $ "
|
||||
}
|
||||
|
||||
_omb_util_add_prompt_command _omb_theme_PROMPT_COMMAND
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
SCM_THEME_PROMPT_PREFIX="|"
|
||||
SCM_THEME_PROMPT_SUFFIX=""
|
||||
|
||||
SCM_THEME_PROMPT_DIRTY=" ${bold_red}✗${normal}"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${green}✓${normal}"
|
||||
SCM_GIT_CHAR="${green}±${normal}"
|
||||
SCM_SVN_CHAR="${bold_cyan}⑆${normal}"
|
||||
SCM_HG_CHAR="${bold_red}☿${normal}"
|
||||
SCM_THEME_PROMPT_DIRTY=" ${_omb_prompt_bold_brown}✗${_omb_prompt_normal}"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${_omb_prompt_green}✓${_omb_prompt_normal}"
|
||||
SCM_GIT_CHAR="${_omb_prompt_green}±${_omb_prompt_normal}"
|
||||
SCM_SVN_CHAR="${_omb_prompt_bold_teal}⑆${_omb_prompt_normal}"
|
||||
SCM_HG_CHAR="${_omb_prompt_bold_brown}☿${_omb_prompt_normal}"
|
||||
|
||||
### TODO: openSUSE has already colors enabled, check if those differs from stock
|
||||
# LS colors, made with http://geoff.greer.fm/lscolors/
|
||||
@@ -25,12 +25,12 @@ scm_prompt() {
|
||||
}
|
||||
|
||||
_omb_theme_PROMPT_COMMAND() {
|
||||
ps_host="${bold_blue}\h${normal}";
|
||||
ps_user="${green}\u${normal}";
|
||||
ps_user_mark="${green} $ ${normal}";
|
||||
ps_root="${red}\u${red}";
|
||||
ps_root_mark="${red} # ${normal}"
|
||||
ps_path="${yellow}\w${normal}";
|
||||
ps_host="${_omb_prompt_bold_navy}\h${_omb_prompt_normal}";
|
||||
ps_user="${_omb_prompt_green}\u${_omb_prompt_normal}";
|
||||
ps_user_mark="${_omb_prompt_green} $ ${_omb_prompt_normal}";
|
||||
ps_root="${_omb_prompt_brown}\u${_omb_prompt_brown}";
|
||||
ps_root_mark="${_omb_prompt_brown} # ${_omb_prompt_normal}"
|
||||
ps_path="${_omb_prompt_olive}\w${_omb_prompt_normal}";
|
||||
|
||||
# make it work
|
||||
case $(id -u) in
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
#! bash oh-my-bash.module
|
||||
|
||||
SCM_THEME_PROMPT_DIRTY=" ${bold_red}⊘${normal}"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓${normal}"
|
||||
SCM_THEME_PROMPT_PREFIX="${reset_color}( "
|
||||
SCM_THEME_PROMPT_SUFFIX=" ${reset_color})"
|
||||
SCM_THEME_PROMPT_DIRTY=" ${_omb_prompt_bold_brown}⊘${_omb_prompt_normal}"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${_omb_prompt_bold_green}✓${_omb_prompt_normal}"
|
||||
SCM_THEME_PROMPT_PREFIX="${_omb_prompt_reset_color}( "
|
||||
SCM_THEME_PROMPT_SUFFIX=" ${_omb_prompt_reset_color})"
|
||||
|
||||
GIT_THEME_PROMPT_DIRTY=" ${bold_red}⊘${normal}"
|
||||
GIT_THEME_PROMPT_CLEAN=" ${bold_green}✓${normal}"
|
||||
GIT_THEME_PROMPT_PREFIX="${reset_color}( "
|
||||
GIT_THEME_PROMPT_SUFFIX=" ${reset_color})"
|
||||
GIT_THEME_PROMPT_DIRTY=" ${_omb_prompt_bold_brown}⊘${_omb_prompt_normal}"
|
||||
GIT_THEME_PROMPT_CLEAN=" ${_omb_prompt_bold_green}✓${_omb_prompt_normal}"
|
||||
GIT_THEME_PROMPT_PREFIX="${_omb_prompt_reset_color}( "
|
||||
GIT_THEME_PROMPT_SUFFIX=" ${_omb_prompt_reset_color})"
|
||||
|
||||
STATUS_THEME_PROMPT_BAD="${bold_red}❯${reset_color}${normal} "
|
||||
STATUS_THEME_PROMPT_OK="${bold_green}❯${reset_color}${normal} "
|
||||
STATUS_THEME_PROMPT_BAD="${_omb_prompt_bold_brown}❯${_omb_prompt_reset_color}${_omb_prompt_normal} "
|
||||
STATUS_THEME_PROMPT_OK="${_omb_prompt_bold_green}❯${_omb_prompt_reset_color}${_omb_prompt_normal} "
|
||||
|
||||
function _omb_theme_PROMPT_COMMAND() {
|
||||
local ret_status="$( [ $? -eq 0 ] && echo -e "$STATUS_THEME_PROMPT_OK" || echo -e "$STATUS_THEME_PROMPT_BAD")"
|
||||
PS1="\n${blue}\w $(scm_prompt_info)\n${ret_status} "
|
||||
PS1="\n${_omb_prompt_navy}\w $(scm_prompt_info)\n${ret_status} "
|
||||
}
|
||||
|
||||
_omb_util_add_prompt_command _omb_theme_PROMPT_COMMAND
|
||||
|
||||
@@ -11,9 +11,9 @@ _omb_theme_PROMPT_COMMAND() {
|
||||
history -c
|
||||
history -r
|
||||
# displays user@server in purple
|
||||
# PS1="$red$(scm_char) $purple\u@\h$reset_color:$blue\w$yellow$(scm_prompt_info)$(_omb_prompt_print_ruby_env) $black\$$reset_color "
|
||||
# PS1="$_omb_prompt_brown$(scm_char) $_omb_prompt_purple\u@\h$_omb_prompt_reset_color:$_omb_prompt_navy\w$_omb_prompt_olive$(scm_prompt_info)$(_omb_prompt_print_ruby_env) $_omb_prompt_black\$$_omb_prompt_reset_color "
|
||||
# no user@server
|
||||
PS1="$red$(scm_char) $blue\w$yellow$(scm_prompt_info)$(_omb_prompt_print_ruby_env) $black\$$reset_color "
|
||||
PS1="$_omb_prompt_brown$(scm_char) $_omb_prompt_navy\w$_omb_prompt_olive$(scm_prompt_info)$(_omb_prompt_print_ruby_env) $_omb_prompt_black\$$_omb_prompt_reset_color "
|
||||
PS2='> '
|
||||
PS4='+ '
|
||||
}
|
||||
@@ -21,9 +21,9 @@ _omb_theme_PROMPT_COMMAND() {
|
||||
_omb_util_add_prompt_command _omb_theme_PROMPT_COMMAND
|
||||
|
||||
SCM_NONE_CHAR='·'
|
||||
SCM_THEME_PROMPT_DIRTY=" ${red}✗"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${green}✓"
|
||||
SCM_THEME_PROMPT_DIRTY=" ${_omb_prompt_brown}✗"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${_omb_prompt_green}✓"
|
||||
SCM_THEME_PROMPT_PREFIX=" ("
|
||||
SCM_THEME_PROMPT_SUFFIX="${yellow})"
|
||||
SCM_THEME_PROMPT_SUFFIX="${_omb_prompt_olive})"
|
||||
RVM_THEME_PROMPT_PREFIX=" ("
|
||||
RVM_THEME_PROMPT_SUFFIX=")"
|
||||
|
||||
@@ -3,21 +3,21 @@
|
||||
|
||||
# set colors for use throughout the prompt
|
||||
# i like things consistent
|
||||
OMB_THEME_BRACKET_COLOR="${OMB_THEME_BRACKET_COLOR-${blue}}"
|
||||
OMB_THEME_STRING_COLOR="${OMB_THEME_STRING_COLOR-${green}}"
|
||||
OMB_THEME_BRACKET_COLOR="${OMB_THEME_BRACKET_COLOR-${_omb_prompt_navy}}"
|
||||
OMB_THEME_STRING_COLOR="${OMB_THEME_STRING_COLOR-${_omb_prompt_green}}"
|
||||
|
||||
SCM_THEME_PROMPT_PREFIX=""
|
||||
SCM_THEME_PROMPT_SUFFIX=""
|
||||
|
||||
SCM_THEME_PROMPT_DIRTY=" ${bold_red}✗${normal}"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓${normal}"
|
||||
SCM_GIT_CHAR="${OMB_THEME_STRING_COLOR}±${normal}"
|
||||
SCM_SVN_CHAR="${bold_cyan}⑆${normal}"
|
||||
SCM_HG_CHAR="${bold_red}☿${normal}"
|
||||
SCM_THEME_PROMPT_DIRTY=" ${_omb_prompt_bold_brown}✗${_omb_prompt_normal}"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${_omb_prompt_bold_green}✓${_omb_prompt_normal}"
|
||||
SCM_GIT_CHAR="${OMB_THEME_STRING_COLOR}±${_omb_prompt_normal}"
|
||||
SCM_SVN_CHAR="${_omb_prompt_bold_teal}⑆${_omb_prompt_normal}"
|
||||
SCM_HG_CHAR="${_omb_prompt_bold_brown}☿${_omb_prompt_normal}"
|
||||
|
||||
PROMPT_CHAR="${OMB_THEME_BRACKET_COLOR}➞ ${normal}"
|
||||
PROMPT_CHAR="${OMB_THEME_BRACKET_COLOR}➞ ${_omb_prompt_normal}"
|
||||
if [[ $OSTYPE == *darwin* ]]; then
|
||||
PROMPT_CHAR="${OMB_THEME_BRACKET_COLOR}➞ ${normal}"
|
||||
PROMPT_CHAR="${OMB_THEME_BRACKET_COLOR}➞ ${_omb_prompt_normal}"
|
||||
fi
|
||||
|
||||
#Mysql Prompt
|
||||
@@ -35,12 +35,12 @@ __my_rvm_ruby_version() {
|
||||
[ "${gemset}" != "" ] && gemset="@${gemset}"
|
||||
local full="${version}${gemset}"
|
||||
[ "${full}" != "" ] \
|
||||
&& echo "${OMB_THEME_BRACKET_COLOR}[${OMB_THEME_STRING_COLOR}${full}${OMB_THEME_BRACKET_COLOR}]${normal}"
|
||||
&& echo "${OMB_THEME_BRACKET_COLOR}[${OMB_THEME_STRING_COLOR}${full}${OMB_THEME_BRACKET_COLOR}]${_omb_prompt_normal}"
|
||||
}
|
||||
|
||||
is_vim_shell() {
|
||||
if [ -n "${VIMRUNTIME}" ] ; then
|
||||
echo "${OMB_THEME_BRACKET_COLOR}[${OMB_THEME_STRING_COLOR}vim shell${OMB_THEME_BRACKET_COLOR}]${normal}"
|
||||
echo "${OMB_THEME_BRACKET_COLOR}[${OMB_THEME_STRING_COLOR}vim shell${OMB_THEME_BRACKET_COLOR}]${_omb_prompt_normal}"
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ todo_txt_count() {
|
||||
local count=$(todo.sh ls \
|
||||
| awk '/TODO: [0-9]+ of ([0-9]+) tasks shown/ { print $4 }')
|
||||
if is_integer "${count}" ; then # did we get a sane answer back
|
||||
echo "${OMB_THEME_BRACKET_COLOR}[${OMB_THEME_STRING_COLOR}T:$count${OMB_THEME_BRACKET_COLOR}]$normal"
|
||||
echo "${OMB_THEME_BRACKET_COLOR}[${OMB_THEME_STRING_COLOR}T:$count${OMB_THEME_BRACKET_COLOR}]$_omb_prompt_normal"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
@@ -66,22 +66,22 @@ modern_scm_prompt() {
|
||||
if [ ! "${CHAR}" = "${SCM_NONE_CHAR}" ] ; then
|
||||
printf "%s" \
|
||||
"${OMB_THEME_BRACKET_COLOR}[${CHAR}${OMB_THEME_BRACKET_COLOR}]" \
|
||||
"[${OMB_THEME_STRING_COLOR}$(scm_prompt_info)${OMB_THEME_BRACKET_COLOR}]$normal"
|
||||
"[${OMB_THEME_STRING_COLOR}$(scm_prompt_info)${OMB_THEME_BRACKET_COLOR}]$_omb_prompt_normal"
|
||||
printf "\n"
|
||||
fi
|
||||
}
|
||||
|
||||
_omb_theme_PROMPT_COMMAND() {
|
||||
local my_host="${OMB_THEME_STRING_COLOR}\h${normal}";
|
||||
local my_user="${OMB_THEME_STRING_COLOR}\u${normal}";
|
||||
local my_path="${OMB_THEME_STRING_COLOR}\w${normal}";
|
||||
local my_host="${OMB_THEME_STRING_COLOR}\h${_omb_prompt_normal}";
|
||||
local my_user="${OMB_THEME_STRING_COLOR}\u${_omb_prompt_normal}";
|
||||
local my_path="${OMB_THEME_STRING_COLOR}\w${_omb_prompt_normal}";
|
||||
local bracket_c="${OMB_THEME_BRACKET_COLOR}"
|
||||
|
||||
local line2 ; line2="${bracket_c}└─$(todo_txt_count)${PROMPT_CHAR}"
|
||||
# nice prompt
|
||||
case "$(id -u)" in
|
||||
0)
|
||||
my_user="${bold_red}\u${normal}";
|
||||
my_user="${_omb_prompt_bold_brown}\u${_omb_prompt_normal}";
|
||||
line2="${bracket_c}└─${PROMPT_CHAR}"
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -8,9 +8,9 @@ export PROMPT_DIRTRIM=3
|
||||
|
||||
function _omb_theme_PROMPT_COMMAND() {
|
||||
if [[ ${EUID} == 0 ]] ; then
|
||||
PS1="[$(clock_prompt)]${yellow}[${red}\u@\h ${green}\w${yellow}]${red}$(__git_ps1 "(%s)")${normal}\\$ "
|
||||
PS1="[$(clock_prompt)]${_omb_prompt_olive}[${_omb_prompt_brown}\u@\h ${_omb_prompt_green}\w${_omb_prompt_olive}]${_omb_prompt_brown}$(__git_ps1 "(%s)")${_omb_prompt_normal}\\$ "
|
||||
else
|
||||
PS1="[$(clock_prompt)]${yellow}[${cyan}\u@\h ${green}\w${yellow}]${red}$(__git_ps1 "(%s)")${normal}\\$ "
|
||||
PS1="[$(clock_prompt)]${_omb_prompt_olive}[${_omb_prompt_teal}\u@\h ${_omb_prompt_green}\w${_omb_prompt_olive}]${_omb_prompt_brown}$(__git_ps1 "(%s)")${_omb_prompt_normal}\\$ "
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ case $TERM in
|
||||
esac
|
||||
|
||||
function _omb_theme_PROMPT_COMMAND() {
|
||||
PS1="${TITLEBAR}${orange}${reset_color}${green}\w${bold_blue}\[\$(scm_prompt_info)\]${normal} "
|
||||
PS1="${TITLEBAR}${_omb_prompt_red}${_omb_prompt_reset_color}${_omb_prompt_green}\w${_omb_prompt_bold_navy}\[\$(scm_prompt_info)\]${_omb_prompt_normal} "
|
||||
}
|
||||
|
||||
# scm themeing
|
||||
|
||||
@@ -15,7 +15,7 @@ function _omb_theme_sirup_rubygem {
|
||||
|
||||
function _omb_theme_PROMPT_COMMAND {
|
||||
# Check http://github.com/Sirupsen/dotfiles for screenshot
|
||||
PS1="$blue\W/$bold_blue$(_omb_theme_sirup_rubygem)$bold_green$(__git_ps1 " (%s)") ${normal}$ "
|
||||
PS1="$_omb_prompt_navy\W/$_omb_prompt_bold_navy$(_omb_theme_sirup_rubygem)$_omb_prompt_bold_green$(__git_ps1 " (%s)") ${_omb_prompt_normal}$ "
|
||||
}
|
||||
|
||||
_omb_util_add_prompt_command _omb_theme_PROMPT_COMMAND
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
SCM_THEME_PROMPT_PREFIX=""
|
||||
SCM_THEME_PROMPT_SUFFIX=""
|
||||
|
||||
SCM_THEME_PROMPT_DIRTY=" ${bold_red}✗${normal}"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓${normal}"
|
||||
SCM_GIT_CHAR="${bold_cyan}±${normal}"
|
||||
SCM_SVN_CHAR="${bold_green}⑆${normal}"
|
||||
SCM_HG_CHAR="${bold_red}☿${normal}"
|
||||
SCM_THEME_PROMPT_DIRTY=" ${_omb_prompt_bold_brown}✗${_omb_prompt_normal}"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${_omb_prompt_bold_green}✓${_omb_prompt_normal}"
|
||||
SCM_GIT_CHAR="${_omb_prompt_bold_teal}±${_omb_prompt_normal}"
|
||||
SCM_SVN_CHAR="${_omb_prompt_bold_green}⑆${_omb_prompt_normal}"
|
||||
SCM_HG_CHAR="${_omb_prompt_bold_brown}☿${_omb_prompt_normal}"
|
||||
|
||||
#Mysql Prompt
|
||||
export MYSQL_PS1="(\u@\h) [\d]> "
|
||||
@@ -33,14 +33,14 @@ __my_rvm_ruby_version() {
|
||||
__my_venv_prompt() {
|
||||
if [ ! -z "$VIRTUAL_ENV" ]
|
||||
then
|
||||
echo "[${blue}@${normal}${VIRTUAL_ENV##*/}]"
|
||||
echo "[${_omb_prompt_navy}@${_omb_prompt_normal}${VIRTUAL_ENV##*/}]"
|
||||
fi
|
||||
}
|
||||
|
||||
is_vim_shell() {
|
||||
if [ ! -z "$VIMRUNTIME" ]
|
||||
then
|
||||
echo "[${cyan}vim shell${normal}]"
|
||||
echo "[${_omb_prompt_teal}vim shell${_omb_prompt_normal}]"
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -57,11 +57,11 @@ modern_scm_prompt() {
|
||||
_omb_theme_PROMPT_COMMAND() {
|
||||
|
||||
case $HOSTNAME in
|
||||
"clappy"* ) my_ps_host="${green}\h${normal}";
|
||||
"clappy"* ) my_ps_host="${_omb_prompt_green}\h${_omb_prompt_normal}";
|
||||
;;
|
||||
"icekernel") my_ps_host="${red}\h${normal}";
|
||||
"icekernel") my_ps_host="${_omb_prompt_brown}\h${_omb_prompt_normal}";
|
||||
;;
|
||||
* ) my_ps_host="${green}\h${normal}";
|
||||
* ) my_ps_host="${_omb_prompt_green}\h${_omb_prompt_normal}";
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -71,10 +71,10 @@ _omb_theme_PROMPT_COMMAND() {
|
||||
|
||||
# nice prompt
|
||||
case "`id -u`" in
|
||||
0) PS1="${TITLEBAR}[$my_ps_root][$my_ps_host]$(modern_scm_prompt)$(__my_rvm_ruby_version)[${cyan}\w${normal}]$(is_vim_shell)
|
||||
0) PS1="${TITLEBAR}[$my_ps_root][$my_ps_host]$(modern_scm_prompt)$(__my_rvm_ruby_version)[${_omb_prompt_teal}\w${_omb_prompt_normal}]$(is_vim_shell)
|
||||
$ "
|
||||
;;
|
||||
*) PS1="${TITLEBAR}[$my_ps_user][$my_ps_host]$(modern_scm_prompt)$(__my_rvm_ruby_version)$(__my_venv_prompt)[${cyan}\w${normal}]$(is_vim_shell)
|
||||
*) PS1="${TITLEBAR}[$my_ps_user][$my_ps_host]$(modern_scm_prompt)$(__my_rvm_ruby_version)$(__my_venv_prompt)[${_omb_prompt_teal}\w${_omb_prompt_normal}]$(is_vim_shell)
|
||||
$ "
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -19,7 +19,7 @@ case $TERM in
|
||||
esac
|
||||
|
||||
function _omb_theme_PROMPT_COMMAND() {
|
||||
PROMPT='${green}\u${normal}@${green}\h${normal}:${blue}\w${normal}${red}$(prompt_char)$(git_prompt_info)${normal}\$ '
|
||||
PROMPT='${_omb_prompt_green}\u${_omb_prompt_normal}@${_omb_prompt_green}\h${_omb_prompt_normal}:${_omb_prompt_navy}\w${_omb_prompt_normal}${_omb_prompt_brown}$(prompt_char)$(git_prompt_info)${_omb_prompt_normal}\$ '
|
||||
}
|
||||
|
||||
_omb_util_add_prompt_command _omb_theme_PROMPT_COMMAND
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
#! bash oh-my-bash.module
|
||||
|
||||
SCM_THEME_PROMPT_PREFIX=" ${purple}"
|
||||
SCM_THEME_PROMPT_SUFFIX=" ${normal}"
|
||||
SCM_THEME_PROMPT_DIRTY=" ${red}✗"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${green}✓"
|
||||
SCM_THEME_PROMPT_PREFIX=" ${_omb_prompt_purple}"
|
||||
SCM_THEME_PROMPT_SUFFIX=" ${_omb_prompt_normal}"
|
||||
SCM_THEME_PROMPT_DIRTY=" ${_omb_prompt_brown}✗"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${_omb_prompt_green}✓"
|
||||
SCM_GIT_SHOW_DETAILS="false"
|
||||
|
||||
function _omb_theme_PROMPT_COMMAND() {
|
||||
PS1="${yellow}\u${normal}${cyan}@\h${normal}${purple} ${normal}${green}\w${normal}$(scm_prompt_info)> "
|
||||
PS1="${_omb_prompt_olive}\u${_omb_prompt_normal}${_omb_prompt_teal}@\h${_omb_prompt_normal}${_omb_prompt_purple} ${_omb_prompt_normal}${_omb_prompt_green}\w${_omb_prompt_normal}$(scm_prompt_info)> "
|
||||
}
|
||||
|
||||
_omb_util_add_prompt_command _omb_theme_PROMPT_COMMAND
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
# Based on 'bobby' theme with the addition of python_venv
|
||||
#
|
||||
|
||||
SCM_THEME_PROMPT_DIRTY=" ${red}✗"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${green}✓"
|
||||
SCM_THEME_PROMPT_PREFIX=" ${yellow}|${reset_color}"
|
||||
SCM_THEME_PROMPT_SUFFIX="${yellow}|"
|
||||
SCM_THEME_PROMPT_DIRTY=" ${_omb_prompt_brown}✗"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${_omb_prompt_green}✓"
|
||||
SCM_THEME_PROMPT_PREFIX=" ${_omb_prompt_olive}|${_omb_prompt_reset_color}"
|
||||
SCM_THEME_PROMPT_SUFFIX="${_omb_prompt_olive}|"
|
||||
|
||||
RVM_THEME_PROMPT_PREFIX="|"
|
||||
RVM_THEME_PROMPT_SUFFIX="|"
|
||||
@@ -14,7 +14,7 @@ VIRTUALENV_THEME_PROMPT_PREFIX='|'
|
||||
VIRTUALENV_THEME_PROMPT_SUFFIX='|'
|
||||
|
||||
function _omb_theme_PROMPT_COMMAND() {
|
||||
PS1="\n${green}$(_omb_prompt_print_python_venv)${red}$(_omb_prompt_print_ruby_env) ${reset_color}\h ${orange}in ${reset_color}\w\n${yellow}$(scm_char)$(scm_prompt_info) ${yellow}→${white} "
|
||||
PS1="\n${_omb_prompt_green}$(_omb_prompt_print_python_venv)${_omb_prompt_brown}$(_omb_prompt_print_ruby_env) ${_omb_prompt_reset_color}\h ${_omb_prompt_red}in ${_omb_prompt_reset_color}\w\n${_omb_prompt_olive}$(scm_char)$(scm_prompt_info) ${_omb_prompt_olive}→${_omb_prompt_white} "
|
||||
}
|
||||
|
||||
_omb_util_add_prompt_command _omb_theme_PROMPT_COMMAND
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
#! bash oh-my-bash.module
|
||||
SCM_THEME_PROMPT_DIRTY=" ${red}✗"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓"
|
||||
SCM_THEME_PROMPT_DIRTY=" ${_omb_prompt_brown}✗"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${_omb_prompt_bold_green}✓"
|
||||
SCM_THEME_PROMPT_PREFIX=" |"
|
||||
SCM_THEME_PROMPT_SUFFIX="${green}|"
|
||||
SCM_THEME_PROMPT_SUFFIX="${_omb_prompt_green}|"
|
||||
|
||||
GIT_THEME_PROMPT_DIRTY=" ${red}✗"
|
||||
GIT_THEME_PROMPT_CLEAN=" ${bold_green}✓"
|
||||
GIT_THEME_PROMPT_PREFIX=" ${green}|"
|
||||
GIT_THEME_PROMPT_SUFFIX="${green}|"
|
||||
GIT_THEME_PROMPT_DIRTY=" ${_omb_prompt_brown}✗"
|
||||
GIT_THEME_PROMPT_CLEAN=" ${_omb_prompt_bold_green}✓"
|
||||
GIT_THEME_PROMPT_PREFIX=" ${_omb_prompt_green}|"
|
||||
GIT_THEME_PROMPT_SUFFIX="${_omb_prompt_green}|"
|
||||
|
||||
RVM_THEME_PROMPT_PREFIX="|"
|
||||
RVM_THEME_PROMPT_SUFFIX="|"
|
||||
@@ -18,9 +18,9 @@ function _omb_theme_PROMPT_COMMAND() {
|
||||
else
|
||||
status=💔
|
||||
fi
|
||||
PS1="\n${yellow}$(_omb_prompt_print_ruby_env) ${purple}\h ${reset_color}in ${green}\w $status \n${bold_cyan} ${blue}|$(clock_prompt)|${green}$(scm_prompt_info) ${green}→${reset_color} "
|
||||
PS1="\n${_omb_prompt_olive}$(_omb_prompt_print_ruby_env) ${_omb_prompt_purple}\h ${_omb_prompt_reset_color}in ${_omb_prompt_green}\w $status \n${_omb_prompt_bold_teal} ${_omb_prompt_navy}|$(clock_prompt)|${_omb_prompt_green}$(scm_prompt_info) ${_omb_prompt_green}→${_omb_prompt_reset_color} "
|
||||
}
|
||||
|
||||
THEME_CLOCK_COLOR=${THEME_CLOCK_COLOR:-"$blue"}
|
||||
THEME_CLOCK_COLOR=${THEME_CLOCK_COLOR:-"$_omb_prompt_navy"}
|
||||
|
||||
_omb_util_add_prompt_command _omb_theme_PROMPT_COMMAND
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
## git-theme
|
||||
# feel free to change git chars.
|
||||
GIT_THEME_PROMPT_DIRTY="${bold_yellow}*${normal}"
|
||||
GIT_THEME_PROMPT_DIRTY="${_omb_prompt_bold_olive}*${_omb_prompt_normal}"
|
||||
GIT_THEME_PROMPT_CLEAN=""
|
||||
GIT_THEME_PROMPT_PREFIX=""
|
||||
GIT_THEME_PROMPT_SUFFIX=""
|
||||
@@ -18,7 +18,7 @@ function _omb_theme_PROMPT_COMMAND() {
|
||||
# user:host:pwd git-branch(*)$
|
||||
# for example:
|
||||
# noqqe:deathstar:themes master*$
|
||||
PS1="${no_color}\u:$(hostname)${normal}:${bold_yellow}\W/${normal} $(git_prompt_info)${reset_color}$ "
|
||||
PS1="${no_color}\u:$(hostname)${_omb_prompt_normal}:${_omb_prompt_bold_olive}\W/${_omb_prompt_normal} $(git_prompt_info)${_omb_prompt_reset_color}$ "
|
||||
}
|
||||
|
||||
_omb_util_add_prompt_command _omb_theme_PROMPT_COMMAND
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
SCM_THEME_PROMPT_PREFIX=""
|
||||
SCM_THEME_PROMPT_SUFFIX=""
|
||||
|
||||
SCM_THEME_PROMPT_DIRTY=" ${bold_red}✗${normal}"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓${normal}"
|
||||
SCM_GIT_CHAR="${bold_green}±${normal}"
|
||||
SCM_SVN_CHAR="${bold_cyan}⑆${normal}"
|
||||
SCM_HG_CHAR="${bold_red}☿${normal}"
|
||||
SCM_THEME_PROMPT_DIRTY=" ${_omb_prompt_bold_brown}✗${_omb_prompt_normal}"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${_omb_prompt_bold_green}✓${_omb_prompt_normal}"
|
||||
SCM_GIT_CHAR="${_omb_prompt_bold_green}±${_omb_prompt_normal}"
|
||||
SCM_SVN_CHAR="${_omb_prompt_bold_teal}⑆${_omb_prompt_normal}"
|
||||
SCM_HG_CHAR="${_omb_prompt_bold_brown}☿${_omb_prompt_normal}"
|
||||
|
||||
#Mysql Prompt
|
||||
export MYSQL_PS1="(\u@\h) [\d]> "
|
||||
@@ -33,7 +33,7 @@ __my_rvm_ruby_version() {
|
||||
is_vim_shell() {
|
||||
if [ ! -z "$VIMRUNTIME" ]
|
||||
then
|
||||
echo "[${cyan}vim shell${normal}]"
|
||||
echo "[${_omb_prompt_teal}vim shell${_omb_prompt_normal}]"
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ modern_scm_prompt() {
|
||||
chroot(){
|
||||
if [ -n "$debian_chroot" ]
|
||||
then
|
||||
my_ps_chroot="${bold_cyan}$debian_chroot${normal}";
|
||||
my_ps_chroot="${_omb_prompt_bold_teal}$debian_chroot${_omb_prompt_normal}";
|
||||
echo "($my_ps_chroot)";
|
||||
fi
|
||||
}
|
||||
@@ -60,7 +60,7 @@ chroot(){
|
||||
my_ve(){
|
||||
if [ -n "$VIRTUAL_ENV" ]
|
||||
then
|
||||
my_ps_ve="${bold_purple}$ve${normal}";
|
||||
my_ps_ve="${_omb_prompt_bold_purple}$ve${_omb_prompt_normal}";
|
||||
echo "($my_ps_ve)";
|
||||
fi
|
||||
echo "";
|
||||
@@ -68,12 +68,12 @@ my_ve(){
|
||||
|
||||
_omb_theme_PROMPT_COMMAND() {
|
||||
|
||||
my_ps_host="${green}\h${normal}";
|
||||
my_ps_host="${_omb_prompt_green}\h${_omb_prompt_normal}";
|
||||
# yes, these are the the same for now ...
|
||||
my_ps_host_root="${green}\h${normal}";
|
||||
my_ps_host_root="${_omb_prompt_green}\h${_omb_prompt_normal}";
|
||||
|
||||
my_ps_user="${bold_green}\u${normal}"
|
||||
my_ps_root="${bold_red}\u${normal}";
|
||||
my_ps_user="${_omb_prompt_bold_green}\u${_omb_prompt_normal}"
|
||||
my_ps_root="${_omb_prompt_bold_brown}\u${_omb_prompt_normal}";
|
||||
|
||||
if [ -n "$VIRTUAL_ENV" ]
|
||||
then
|
||||
@@ -82,10 +82,10 @@ _omb_theme_PROMPT_COMMAND() {
|
||||
|
||||
# nice prompt
|
||||
case "`id -u`" in
|
||||
0) PS1="${TITLEBAR}┌─$(my_ve)$(chroot)[$my_ps_root][$my_ps_host_root]$(modern_scm_prompt)$(__my_rvm_ruby_version)[${cyan}\w${normal}]$(is_vim_shell)
|
||||
0) PS1="${TITLEBAR}┌─$(my_ve)$(chroot)[$my_ps_root][$my_ps_host_root]$(modern_scm_prompt)$(__my_rvm_ruby_version)[${_omb_prompt_teal}\w${_omb_prompt_normal}]$(is_vim_shell)
|
||||
└─▪ "
|
||||
;;
|
||||
*) PS1="${TITLEBAR}┌─$(my_ve)$(chroot)[$my_ps_user][$my_ps_host]$(modern_scm_prompt)$(__my_rvm_ruby_version)[${cyan}\w${normal}]$(is_vim_shell)
|
||||
*) PS1="${TITLEBAR}┌─$(my_ve)$(chroot)[$my_ps_user][$my_ps_host]$(modern_scm_prompt)$(__my_rvm_ruby_version)[${_omb_prompt_teal}\w${_omb_prompt_normal}]$(is_vim_shell)
|
||||
└─▪ "
|
||||
;;
|
||||
esac
|
||||
|
||||
Reference in New Issue
Block a user