Last active
December 13, 2022 07:24
-
-
Save jazlopez/441aaa845b9de7a2dbf5b78db0f0b771 to your computer and use it in GitHub Desktop.
fino.zsh-theme customization
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Use with a dark background and 256-color terminal! | |
| # Meant for people with rbenv and git. Tested only on OS X 10.7. | |
| # You can set your computer name in the ~/.box-name file if you want. | |
| # Borrowing shamelessly from these oh-my-zsh themes: | |
| # bira | |
| # robbyrussell | |
| # | |
| # Also borrowing from http://stevelosh.com/blog/2010/02/my-extravagant-zsh-prompt/ | |
| function virtualenv_prompt_info { | |
| [[ -n ${VIRTUAL_ENV} ]] || return | |
| echo "${ZSH_THEME_VIRTUALENV_PREFIX:=[}${VIRTUAL_ENV:t}${ZSH_THEME_VIRTUALENV_SUFFIX:=]}" | |
| } | |
| function prompt_char { | |
| command git branch &>/dev/null && echo "±" || echo '○' | |
| } | |
| function box_name { | |
| local box="${SHORT_HOST:-$HOST}" | |
| [[ -f ~/.box-name ]] && box="$(< ~/.box-name)" | |
| echo "${box:gs/%/%%}" | |
| } | |
| local ruby_env='$(ruby_prompt_info)' | |
| local git_info='$(git_prompt_info)' | |
| local virtualenv_info='$(virtualenv_prompt_info)' | |
| local prompt_char='$(prompt_char)' | |
| local weather='$(curl --connect-timeout 1 -s "wttr.in/?format=3")' | |
| local ip_address='$(curl --connect-timeout 1 -s -4 "icanhazip.com")' | |
| PROMPT="╭─ %b${weather} | ${FG[040]} ${ip_address} %{$reset_color%} | %n [software engineer-jlopez.mx]%{$reset_color%} | |
| │ at: ${FG[239]}%B${FG[226]}%~%b${git_info} | |
| ╰─${prompt_char}%{$reset_color%} " | |
| ZSH_THEME_GIT_PROMPT_PREFIX=" ${FG[239]}on%{$reset_color%} ${FG[255]}" | |
| ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" | |
| ZSH_THEME_GIT_PROMPT_DIRTY="${FG[202]}✘✘✘" | |
| ZSH_THEME_GIT_PROMPT_CLEAN="${FG[040]}✔" | |
| ZSH_THEME_RUBY_PROMPT_PREFIX=" ${FG[239]}using${FG[243]} ‹" | |
| ZSH_THEME_RUBY_PROMPT_SUFFIX="›%{$reset_color%}" | |
| export VIRTUAL_ENV_DISABLE_PROMPT=1 | |
| ZSH_THEME_VIRTUALENV_PREFIX=" ${FG[239]}using${FG[243]} «" | |
| ZSH_THEME_VIRTUALENV_SUFFIX="»%{$reset_color%}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment