summaryrefslogtreecommitdiff
path: root/bash/prompt
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2020-11-02 19:16:54 +0100
committerAnton Khirnov <anton@khirnov.net>2020-11-02 19:16:54 +0100
commit0efa5121a2169b1833217d27a900a701803a1c1b (patch)
treeb73c10a9eb4e4d2f470ba24822d5cce75cad47fa /bash/prompt
parentae8f4927c640fda9f7f8475bc5a91f06bac2dcfb (diff)
Add profile+bashrc
Diffstat (limited to 'bash/prompt')
-rwxr-xr-xbash/prompt86
1 files changed, 86 insertions, 0 deletions
diff --git a/bash/prompt b/bash/prompt
new file mode 100755
index 0000000..8651b6b
--- /dev/null
+++ b/bash/prompt
@@ -0,0 +1,86 @@
+[ -r /usr/lib/git-core/git-sh-prompt ] && . /usr/lib/git-core/git-sh-prompt
+
+# define a fallback for __git_ps1 if git is not installed
+if [ "x$(type -t __git_ps1)" != "xfunction" ]; then
+ __git_ps1() {
+ echo ""
+ }
+fi
+
+__prompt_func() {
+ ################################################
+ # THERE SHOULD BE NO NEED TO EDIT THIS SECTION #
+ ################################################
+
+ #$normal will reset the colour to the default, use it to stop using a certain colour (see "prompt parts")
+ local normal="\[\e[0m\]"
+
+ # # # # # # #
+ #BACKGROUNDS
+ # # # # # # #
+ local blackbg=";40m\]"
+ local redbg=";41m\]"
+ local greenbg=";42m\]"
+ local brownbg=";43m\]"
+ local bluebg=";44m\]"
+ local purplebg=";45m\]"
+ local cyanbg=";46m\]"
+ local greybg=";47m\]"
+
+ ############################################################################################
+ # THERE SHOULD BE NO NEED TO EDIT THIS SECTION (UNLESS YOU DO NOT WANT A BLACK BACKGROUND) #
+ ############################################################################################
+ # # # # # # #
+ #FOREGROUNDS
+ # # # # # # #
+ local black="\[\e[0;30$blackbg"
+ local redfaint="\[\e[0;31$blackbg"
+ local greenfaint="\[\e[0;32$blackbg"
+ local brownfaint="\[\e[0;33$blackbg"
+ local bluefaint="\[\e[0;34$blackbg"
+ local purplefaint="\[\e[0;35$blackbg"
+ local cyanfaint="\[\e[0;36$blackbg"
+ local greyfaint="\[\e[0;37$blackbg"
+
+ local grey="\[\e[1;30$blackbg"
+ local red="\[\e[1;31$blackbg"
+ local green="\[\e[1;32$blackbg"
+ local yellow="\[\e[1;33$blackbg"
+ local blue="\[\e[1;34$blackbg"
+ local pink="\[\e[1;35$blackbg"
+ local cyan="\[\e[1;36$blackbg"
+ local white="\[\e[1;37$blackbg"
+
+ ##################################
+ # EDIT THIS STUFF TO YOUR LIKING #
+ ##################################
+ # # # # # # #
+ #PROMPT PARTS
+ # # # # # # #
+ local prompt_opening_brace="$cyan[$normal"
+ local prompt_closing_brace="$cyan]$normal"
+
+ local prompt_date="\d"
+ local prompt_hostname_short="$blue\h$normal"
+ local prompt_hostname_long="\H"
+ local prompt_jobs="\j"
+ local prompt_terminal="\l"
+ local prompt_shellname="\s"
+ local prompt_time_24="\t"
+ local prompt_time_12="\T"
+ local prompt_time_12_am_pm="\@"
+ local prompt_username="$greenfaint\u$normal"
+ local prompt_version="\v"
+ local prompt_version_patchlevel="\V"
+ local prompt_pwd_long="$cyanfaint\w$normal"
+ local prompt_pwd_short="$red\W$normal"
+ local prompt_history_number="\!"
+ local prompt_session_number="\#"
+ local prompt_usertype_sign="\\$"
+ local prompt_git_branch="$white\$(__git_ps1)$normal"
+
+ # # # # # # # #
+ #FINAL PROMPT
+ # # # # # # # #
+ echo -n "$prompt_opening_brace $prompt_username@$prompt_hostname_short $prompt_pwd_long$prompt_git_branch$prompt_closing_brace$prompt_usertype_sign "
+}