Created
August 5, 2016 10:13
-
-
Save canmogol/93faf6fab9001f1cf946c411013df14f to your computer and use it in GitHub Desktop.
Bash primary prompt
This file contains hidden or 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
#!/bin/bash | |
reset=$(tput sgr0) | |
bold=$(tput bold) | |
black=$(tput setaf 0) | |
red=$(tput setaf 1) | |
green=$(tput setaf 2) | |
yellow=$(tput setaf 3) | |
blue=$(tput setaf 4) | |
magenta=$(tput setaf 5) | |
cyan=$(tput setaf 6) | |
white=$(tput setaf 7) | |
user_color=$green | |
[ "$UID" -eq 0 ] && { user_color=$red; } | |
PS1="\[\e]0;\w\a\]\[$reset\][\[$blue\]\t\[$reset\]]\[$user_color\]\u@\H(\l)\\[$white\]:\[$cyan\]\w\[$reset\][\[$yellow\]\$?\[$reset\]]\[$white\]\\[$reset\]\$\n\[$red\]→\[$reset\] " |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment