Skip to content

Instantly share code, notes, and snippets.

@jotson
Created November 7, 2012 18:36
Show Gist options
  • Save jotson/4033472 to your computer and use it in GitHub Desktop.
Save jotson/4033472 to your computer and use it in GitHub Desktop.
Current bash prompt
###########################################################3
# Custom prompt with elapsed timer for last command
function command_timer_start {
timer=${timer:-$SECONDS}
}
function command_timer_stop {
last_command_elapsed_time=$(($SECONDS - $timer))
unset timer
}
trap 'command_timer_start' DEBUG
PROMPT_COMMAND=command_timer_stop
# Fun prompt characters ‖ • ⚬ ‣ ⁂ ⁝ ⁞ ⊙ ⌨ ⌦ ⌘ ⌖ ⎔ ☞ ☬ ☢ ♥ ♡ ⚈ ⚆ ⚙ ⚪ ⚫ ✩ ✪ ✹ ✲ ⟫ ⁕ ⁎ ⁘ ⁖ ⁑ ▸ ▹ ☕ ☠ ☢ ☣ ☥
PS1='\[\e[01;32m\]⚫ [${last_command_elapsed_time}s] \[\e[01;32m\]\u@\h \[\e[01;35m\]\d \t \[\e[01;34m\]\w\n\[\e[01;32m\]⚪ \[\e[00m\]'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment