Skip to content

Instantly share code, notes, and snippets.

@alicanalbayrak
Forked from canmogol/acm.bash.sh
Created April 4, 2017 07:20
Show Gist options
  • Save alicanalbayrak/ff7c6a6fbf174ad8bb0f3e1c7ca28d39 to your computer and use it in GitHub Desktop.
Save alicanalbayrak/ff7c6a6fbf174ad8bb0f3e1c7ca28d39 to your computer and use it in GitHub Desktop.
Bash primary prompt
#!/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