Skip to content

Bash Customization

Update Bash

Update Bash using homebrew:

sh
brew upgrade && brew install bash

Update PATH in ~/.profile file and include following line at the end:

sh
exec bash

Install Oh My Bash

sh
chmod 744 ohMyBashScript.sh && ./ohMyBashScript.sh
  • Now, create a custom theme file using:
sh
mkdir -p ~/.oh-my-bash/custom/themes/piratedev/ && vi ~/.oh-my-bash/custom/themes/piratedev/piratedev.theme.sh
  • Add the following content to it:
sh
#! bash oh-my-bash.module

# Change this on every machine
MACHINE_NAME="Mac Mini"

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=" ${_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="|"

__bobby_clock() {
  printf "$(clock_prompt) "

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

function _omb_theme_PROMPT_COMMAND() {
    PS1="\n${_omb_prompt_bold_yellow}$(if [ "${VIRTUAL_ENV:-default}" != "default" ]; then echo "(${VIRTUAL_ENV##*/}) " ; fi)${_omb_prompt_bold_blue}($MACHINE_NAME) ${_omb_prompt_bold_red}\d ${_omb_prompt_bold_red}\t $(clock_char) $(battery_char) ${_omb_prompt_bold_blue}\u${_omb_prompt_gray}@${_omb_prompt_bold_teal}\h ${_omb_prompt_white}in ${_omb_prompt_bold_green}\w\n${_omb_prompt_bold_yellow}$(scm_prompt_char_info) ${_omb_prompt_brown}$AWS_PROFILE ${_omb_prompt_green}→${_omb_prompt_reset_color} "
}

THEME_SHOW_CLOCK_CHAR=${THEME_SHOW_CLOCK_CHAR:-"true"}
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
  • Change OSH_THEME to piratedev in .bashrc file:
shell
vi ~/.bashrc
  • Apply changes by sourcing .bashrc file:
shell
source ~/.bashrc

iTerm2 Changes

  • Change shell to bash:
    • chsh -s /bin/bash
    • Go to Apple logo -> System Settings -> Users & Groups -> Right-click on user image -> Advanced Options -> Change Login Shell to /bin/bash.
  • Bash Customization
    • Links Color: #2469b2
    • Cyan normal: #3bb0c3
    • Cyan bright: #67c5d6
    • Blue normal: #3a84c4
    • Blue bright: #64acdc
    • Red normal: #b93824
    • Red bright: #e67c78
    • Green normal: #339569
    • Green bright: #69b995
    • Background: #1c2128
  • Setup windows arrangment and save it with a name.