Created
November 7, 2012 18:36
-
-
Save jotson/4033472 to your computer and use it in GitHub Desktop.
Current bash prompt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
###########################################################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