Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean b* themes #1790

Merged
merged 10 commits into from
Jan 26, 2021
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions clean_files.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ themes/barbuk
themes/atomic
themes/axin
themes/base.theme.bash
themes/bakke
themes/binaryanomaly
themes/bira
themes/bobby
themes/bobby-python
themes/brainy
themes/brunton

# plugins
#
Expand Down
11 changes: 6 additions & 5 deletions themes/bakke/bakke.theme.bash
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
# shellcheck shell=bash

SCM_THEME_PROMPT_DIRTY=" ${red}✗"
SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓"
SCM_THEME_PROMPT_PREFIX=" |"
Expand All @@ -13,10 +14,10 @@ RVM_THEME_PROMPT_PREFIX="|"
RVM_THEME_PROMPT_SUFFIX="|"

function prompt_command() {
#PS1="${bold_cyan}$(scm_char)${green}$(scm_prompt_info)${purple}$(ruby_version_prompt) ${yellow}\h ${reset_color}in ${green}\w ${reset_color}\n${green}→${reset_color} "
#PS1="\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:$(virtualenv_prompt) ${reset_color} ${yellow}\w ${green}$(scm_prompt_info)\n${reset_color}→ "
#PS1="${bold_cyan}$(scm_char)${green}$(scm_prompt_info)${purple}$(ruby_version_prompt) ${yellow}\h ${reset_color}in ${green}\w ${reset_color}\n${green}→${reset_color} "
#PS1="\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:$(virtualenv_prompt) ${reset_color} ${yellow}\w ${green}$(scm_prompt_info)\n${reset_color}→ "
}

safe_append_prompt_command prompt_command
88 changes: 43 additions & 45 deletions themes/binaryanomaly/binaryanomaly.theme.bash
Original file line number Diff line number Diff line change
@@ -1,80 +1,78 @@
#!/usr/bin/env bash

# shellcheck shell=bash

# Detect whether a reboot is required
function show_reboot_required() {
if [ ! -z "$_bf_prompt_reboot_info" ]; then
if [ -f /var/run/reboot-required ]; then
printf "Reboot required!"
fi
fi
if [ -n "$_bf_prompt_reboot_info" ]; then
if [ -f /var/run/reboot-required ]; then
printf "Reboot required!"
fi
fi
}

# Set different host color for local and remote sessions
function set_host_color() {
# Detect if connection is through SSH
if [[ ! -z $SSH_CLIENT ]]; then
printf "${lime_yellow}"
else
printf "${light_orange}"
fi
# Detect if connection is through SSH
if [[ -n $SSH_CLIENT ]]; then
printf '%s' "${lime_yellow}"
else
printf '%s' "${light_orange}"
fi
}

# Set different username color for users and root
function set_user_color() {
case $(id -u) in
0)
printf "${red}"
;;
*)
printf "${cyan}"
;;
esac
case $(id -u) in
0)
printf '%s' "${red}"
;;
*)
printf '%s' "${cyan}"
;;
esac
}

scm_prompt() {
CHAR=$(scm_char)
if [ $CHAR = $SCM_NONE_CHAR ]
then
return
else
echo "[$(scm_char)$(scm_prompt_info)]"
fi
CHAR=$(scm_char)
if [ "$CHAR" = "$SCM_NONE_CHAR" ]; then
return
else
echo "[$(scm_char)$(scm_prompt_info)]"
fi
}

# Define custom colors we need
# non-printable bytes in PS1 need to be contained within \[ \].
# Otherwise, bash will count them in the length of the prompt
function set_custom_colors() {
dark_grey="\[$(tput setaf 8)\]"
light_grey="\[$(tput setaf 248)\]"
dark_grey="\[$(tput setaf 8)\]"
light_grey="\[$(tput setaf 248)\]"

light_orange="\[$(tput setaf 172)\]"
bright_yellow="\[$(tput setaf 220)\]"
lime_yellow="\[$(tput setaf 190)\]"
light_orange="\[$(tput setaf 172)\]"
bright_yellow="\[$(tput setaf 220)\]"
lime_yellow="\[$(tput setaf 190)\]"

powder_blue="\[$(tput setaf 153)\]"
powder_blue="\[$(tput setaf 153)\]"
}

__ps_time() {
echo "$(clock_prompt)${normal}\n"
printf '%s' "$(clock_prompt)${normal}\n"
}

function prompt_command() {
ps_reboot="${bright_yellow}$(show_reboot_required)${normal}\n"
ps_reboot="${bright_yellow}$(show_reboot_required)${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${normal}"
ps_uh_separator="${dark_grey}@${normal}"
ps_hostname="$(set_host_color)\h${normal}"

ps_path="${yellow}\w${normal}"
ps_scm_prompt="${light_grey}$(scm_prompt)"
ps_path="${yellow}\w${normal}"
ps_scm_prompt="${light_grey}$(scm_prompt)"

ps_user_mark="${normal} ${normal}"
ps_user_input="${normal}"
ps_user_mark="${normal} ${normal}"
ps_user_input="${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"
# 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"
}

# Initialize custom colors
Expand Down
10 changes: 5 additions & 5 deletions themes/bira/bira.theme.bash
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
# shellcheck shell=bash

SCM_THEME_PROMPT_PREFIX=" ${yellow}‹"
SCM_THEME_PROMPT_SUFFIX="›${reset_color}"
Expand All @@ -9,14 +9,14 @@ VIRTUALENV_THEME_PROMPT_SUFFIX="›${reset_color}"
bold="\[\e[1m\]"

if [ ${UID} -eq 0 ]; then
user_host="${bold_red}\u@\h${normal}${reset_color}"
user_host="${bold_red}\u@\h${normal}${reset_color}"
else
user_host="${bold_green}\u@\h${normal}${reset_color}"
user_host="${bold_green}\u@\h${normal}${reset_color}"
fi

function prompt_command() {
local current_dir=" ${bold_blue}\w${normal}${reset_color}"
PS1="╭─${user_host}${current_dir}$(virtualenv_prompt)$(scm_prompt_info)\n╰─${bold}\\$ ${normal}"
local current_dir=" ${bold_blue}\w${normal}${reset_color}"
PS1="╭─${user_host}${current_dir}$(virtualenv_prompt)$(scm_prompt_info)\n╰─${bold}\\$ ${normal}"
}

safe_append_prompt_command prompt_command
17 changes: 9 additions & 8 deletions themes/bobby-python/bobby-python.theme.bash
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
# shellcheck shell=bash

SCM_THEME_PROMPT_DIRTY=" ${red}✗"
SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓"
SCM_THEME_PROMPT_PREFIX=" |"
Expand All @@ -12,13 +13,13 @@ GIT_THEME_PROMPT_SUFFIX="${green}|"
CONDAENV_THEME_PROMPT_SUFFIX="|"

function prompt_command() {
PS1="\n${yellow}$(python_version_prompt) " # Name of virtual env followed by python version
PS1+="${purple}\h "
PS1+="${reset_color}in "
PS1+="${green}\w\n"
PS1+="${bold_cyan}$(scm_char)"
PS1+="${green}$(scm_prompt_info) "
PS1+="${green}→${reset_color} "
PS1="\n${yellow}$(python_version_prompt) " # Name of virtual env followed by python version
PS1+="${purple}\h "
PS1+="${reset_color}in "
PS1+="${green}\w\n"
PS1+="${bold_cyan}$(scm_char)"
PS1+="${green}$(scm_prompt_info) "
PS1+="${green}→${reset_color} "
}

safe_append_prompt_command prompt_command
24 changes: 12 additions & 12 deletions themes/bobby/bobby.theme.bash
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
# shellcheck shell=bash

SCM_THEME_PROMPT_DIRTY=" ${red}✗"
SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓"
Expand All @@ -14,21 +14,21 @@ RVM_THEME_PROMPT_PREFIX="|"
RVM_THEME_PROMPT_SUFFIX="|"

__bobby_clock() {
printf "$(clock_prompt) "
printf '%s' "$(clock_prompt) "

if [ "${THEME_SHOW_CLOCK_CHAR}" == "true" ]; then
printf "$(clock_char) "
fi
if [ "${THEME_SHOW_CLOCK_CHAR}" == "true" ]; then
printf '%s' "$(clock_char) "
fi
}

function prompt_command() {
PS1="\n$(battery_char) $(__bobby_clock)"
PS1+="${yellow}$(ruby_version_prompt) "
PS1+="${purple}\h "
PS1+="${reset_color}in "
PS1+="${green}\w\n"
PS1+="${bold_cyan}$(scm_prompt_char_info) "
PS1+="${green}→${reset_color} "
PS1="\n$(battery_char) $(__bobby_clock)"
PS1+="${yellow}$(ruby_version_prompt) "
PS1+="${purple}\h "
PS1+="${reset_color}in "
PS1+="${green}\w\n"
PS1+="${bold_cyan}$(scm_prompt_char_info) "
PS1+="${green}→${reset_color} "
}

THEME_SHOW_CLOCK_CHAR=${THEME_SHOW_CLOCK_CHAR:-"true"}
Expand Down
Loading