diff --git a/guri.zsh-theme b/guri.zsh-theme new file mode 100644 index 0000000..3d14c76 --- /dev/null +++ b/guri.zsh-theme @@ -0,0 +1,72 @@ + +get_pwd() { + if [[ "$PWD" == "$HOME" ]]; then + echo "~" + else + echo "$(basename $PWD)" + fi +} + +get_folder_level() { + echo "$(expr $(grep -o '/' <<< "$PWD" | grep -c .) - 1)" +} + +ssh_prompt_info() { + if [[ -n "$SSH_CONNECTION" ]]; then + echo "$fg[magenta]%n@%m » " + fi +} + +level_prompt_info() { + echo "$fg_bold[cyan]$(get_folder_level)»$reset_color $(ssh_prompt_info)$fg[blue]$(get_pwd)" +} + +git_prompt_info() { + ref=$(git symbolic-ref HEAD 2> /dev/null) || return 0 + command git -c gc.auto=0 fetch &>/dev/null 2>&1 &| + local index=$(command git status --porcelain -b 2> /dev/null) + local git_status + if $(echo "$index" | grep '^## .*ahead* .*behind' &> /dev/null); then + git_status=" $ZSH_THEME_GIT_PROMPT_DIVERGED" + elif $(echo "$index" | grep '^## .*ahead' &> /dev/null); then + git_status=" $ZSH_THEME_GIT_PROMPT_AHEAD" + elif $(echo "$index" | grep '^## .*behind' &> /dev/null); then + git_status=" $ZSH_THEME_GIT_PROMPT_BEHIND" + fi + printf "$fg_bold[white]" + printf "$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_PREFIX$(current_branch)" + printf "$ZSH_THEME_GIT_PROMPT_SUFFIX$git_status$reset_color" +} + +docker_machine_prompt_info() { + if [[ -n "$DOCKER_MACHINE_NAME" ]]; then + echo "$fg[green] @$DOCKER_MACHINE_NAME" + fi +} + +virtualenv_indicator() { + if [[ -z "$VIRTUAL_ENV" ]]; then + psvar[1]="" + psvar[2]="" + else + psvar[1]="${VIRTUAL_ENV##*/} " + psvar[2]=" v$(python --version 2>&1 | sed -e "s/Python //")" + fi +} + +local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ )" + +ZSH_THEME_GIT_PROMPT_PREFIX="  " +ZSH_THEME_GIT_PROMPT_SUFFIX="" +ZSH_THEME_GIT_PROMPT_DIRTY="$fg[red]" +ZSH_THEME_GIT_PROMPT_CLEAN="$fg[white]" +ZSH_THEME_GIT_PROMPT_AHEAD="$fg[green]⇡" +ZSH_THEME_GIT_PROMPT_BEHIND="$fg[magenta]⇣" +ZSH_THEME_GIT_PROMPT_DIVERGED="$ZSH_THEME_GIT_PROMPT_AHEAD$ZSH_THEME_GIT_PROMPT_BEHIND" +VIRTUAL_ENV_DISABLE_PROMPT="yes" + +add-zsh-hook precmd virtualenv_indicator + +PROMPT=' +$(level_prompt_info)$(git_prompt_info)$fg[yellow]%2v$(docker_machine_prompt_info) +$reset_color%1v${ret_status}$reset_color' diff --git a/profile.config b/profile.config new file mode 100644 index 0000000..cf9a133 --- /dev/null +++ b/profile.config @@ -0,0 +1,8 @@ +# Terminator's profile config (colors and font used on the screenshot) + +background_color = "#282a36" +background_image = None +font = Fira Mono for Powerline Medium 10 +foreground_color = "#eff0eb" +palette = "#282a36:#ff5c57:#5af78e:#f3f99d:#57c7ff:#ff6ac1:#9aedfe:#f1f1f0:#686868:#ff5c57:#5af78e:#f3f99d:#57c7ff:#ff6ac1:#9aedfe:#eff0eb" +use_system_font = False diff --git a/screenshot.png b/screenshot.png new file mode 100644 index 0000000..baa4a68 Binary files /dev/null and b/screenshot.png differ