Skip to content

Instantly share code, notes, and snippets.

@FunnyQ
Created April 3, 2018 04:29
Show Gist options
  • Save FunnyQ/b1face2d6542bb5727cd99fabc9f9f3b to your computer and use it in GitHub Desktop.
Save FunnyQ/b1face2d6542bb5727cd99fabc9f9f3b to your computer and use it in GitHub Desktop.
Rails development caching indicator for zsh with POWERLEVEL9K
# define a function that checking `caching-dev.txt` exists in tmp/
rails_cache_enabled(){
if [[ -e tmp/caching-dev.txt ]]; then
echo -n "\ue00a Caching "
fi
}
# create a custom prompt theme element
POWERLEVEL9K_CUSTOM_RAILS_CACHE_ENABLED="rails_cache_enabled"
POWERLEVEL9K_CUSTOM_RAILS_CACHE_ENABLED_BACKGROUND=154
POWERLEVEL9K_CUSTOM_RAILS_CACHE_ENABLED_FOREGROUND=208
# then add that to left or right prompt elements
# e.g. POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(custom_git_last_commit_time rbenv custom_rails_cache_enabled time_joined)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment