Skip to content

Commit

Permalink
[master] Adding theme files
Browse files Browse the repository at this point in the history
  • Loading branch information
victorfsf committed Nov 9, 2017
1 parent 827575e commit 8173181
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 0 deletions.
72 changes: 72 additions & 0 deletions guri.zsh-theme
Original file line number Diff line number Diff line change
@@ -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'
8 changes: 8 additions & 0 deletions profile.config
Original file line number Diff line number Diff line change
@@ -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
Binary file added screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8173181

Please sign in to comment.