Skip to content

Instantly share code, notes, and snippets.

@scherler
Last active November 30, 2015 23:27
Show Gist options
  • Save scherler/99f99e8ac0749578b338 to your computer and use it in GitHub Desktop.
Save scherler/99f99e8ac0749578b338 to your computer and use it in GitHub Desktop.
cb.zsh-theme
setopt prompt_subst
function get_RAM {
local FREE_RAM=`free -m | awk '{if (NR==3) print $4}' | xargs -i echo 'scale=1;{}/1000' | bc`
local TOTAL_RAM=`free -m | awk '{if (NR==2) print $2}'| xargs -i echo 'scale=1;{}/1000' | bc`
echo "%{$fg_bold[red]%}$FREE_RAM"
}
PROMPT='%(?,%{$fg_bold[green]%},%{$fg_bold[red]%})◎ % '
RPS1='$(get_RAM)G %{$fg[green]%}%3~ $(git_prompt_info)%{$fg[yellow]%}%* %{$fg[blue]%}%n%{$reset_color%}'
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[blue]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX=""
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%}✔"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}✘"
oh-my.zsh my personal stuff
For now the theme.
Just place the content in a cb.zsh-theme file in $ZSH/themes/ and activate it in .zshrc with
ZSH_THEME="cb"
@scherler
Copy link
Author

cb theme

The first is free RAM the other self explaining.

@scherler
Copy link
Author

I plan to make the ram color depend on the percentage left, so e.g. red for under 15%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment