With OSX Catalina they want you to use zsh for the shell and I had a bash profile (that I “borrowed”) that I like. But I’m not a shell expert and I don’t know how to convert it. Below is the .bash_profile I would like to convert.
#!/bin/bash
export TERM=xterm-256color
export CLICOLOR=1
export LSCOLORS=Fafacxdxbxegedabagacad
GREEN=$(tput setaf 2);
YELLOW=$(tput setaf 3);
RESET=$(tput sgr0);
function get_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* (.*)/ (1)/'
}
function random_element {
declare -a array=("$@")
r=$((RANDOM % ${#array[@]}))
printf "%sn" "${array[$r]}"
}
setEmoji () {
EMOJI="$*"
PS1="${YELLOW}w${GREEN}$(get_branch)${RESET} ${EMOJI}n$ ";
}
newRandomEmoji () {
setEmoji "$(random_element ๐
๐ฝ ๐ฅ ๐ ๐ป โ ๐พ ๐ ๐ ๐ฐ ๐ ๐ ๐ ๐ค ๐ ๐ผ ๐ช ๐ฆ ๐ฅ ๐ฎ ๐ ๐ฏ โ๏ธ ๐ ๐ณ ๐ฟ ๐ฅณ ๐คฉ ๐คฏ ๐ค ๐จโ๐ป ๐ฆธโ ๐งโ ๐งโ ๐งโ ๐จโ๐ ๐จโ๐ฌ ๐บ ๐ฆ ๐ถ ๐ต ๐ป ๐ฆ ๐ ๐ฆ ๐ฆ ๐ฆ ๐ฆ ๐ฆ ๐ ๐ฆ ๐ ๐ข ๐ ๐ ๐ฆ โจ โ๏ธ โก๏ธ ๐ฅ ๐ซ ๐งฌ ๐ฎ โ๏ธ ๐ ๐ญ โช๏ธ ๐ฑ)"
}
newRandomEmoji
newRandomEmoji
alias jestify="PS1="๐n$ "";
alias cypressify="PS1="๐n$ "";
# history size
HISTSIZE=5000
HISTFILESIZE=10000
# PATH ALTERATIONS
## Node
PATH="/usr/local/bin:$PATH:./node_modules/.bin";
# Custom bins
PATH="$PATH:$HOME/.bin";
CDPATH=.:$HOME:$HOME/code:$HOME/Desktop
alias ll="ls -la"
alias cls="clear"
alias pj="cd ~/Projects"
Namely I can do without the random emoji (it was just fun). But I want the color prompt. I liked having the branch listed in the prompt so I always knew if I was in a git repo and what branch was currently checked out.
I appreciate any help.