Created
November 2, 2021 20:56
-
-
Save ctubbsii/384134fbfbc790c3101dbe20e357ed9c to your computer and use it in GitHub Desktop.
Fun bash prompt (~/.bashrc.d/01-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
#! /usr/bin/bash | |
function getdecor() { | |
local decors='๐ฅ๐ฏ๐ฅ๐๐ฏ๐๐ฃ๐๐ฆ๐๐๐๐๐๐๐๐๐๐ญ๐ฎ๐ฏ๐ท๐ธ๐น๐บ๐ป๐ผ๐ฝ๐พ๐๐๐๐ ๐๐๐๐๐๐๐๐๐๐ฃ๐ฅ๐ฑ๐ฒ๐๐๐๐๐ ๐ฃ๐ฎ๐ฏ๐ณ๐ธ๐น๐ป๐๐๐๐น๐ ๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐ข๐ฃ๐ค๐ง๐จ๐ฌ๐ฒ๐ณ๐พ๐๐๐ป๐ฝ๐ ๐ก๐ข๐ฃ๐ค๐ฅ๐ฆ๐ง๐ฎ๐ฏ๐ฐ๐ฒ๐ป๐๐๐๐ก๐ฃ๐ ๐๐๐๐๐๐๐ฅ๐ซ๐ฌ๐ญ๐ฎ๐ฑ๐บ๐๐๐ผ๐ฝ๐พ๐ฟ๐๐ง๐จ๐ฉ๐ซ๐ฝ๐ถ๐ธ๐น๐บ๐ค๐ฅ๐ฅ๐ฅ๐ฅ ๐ฅ๐ฅ๐ฅ๐ฅ๐ฅ๐ฅ๐ฆ๐ฆ ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ ๐ฆจ๐งฌ๐งฒ๐ช๐ช๐ช๐ช' | |
local res=${decors:$(( RANDOM % ${#decors} )):1} | |
[[ -n $SSH_CLIENT || -n $SSH_TTY ]] && res='@' | |
echo "$res" | |
} | |
case "$-" in | |
*i*) # Do interactive shell stuff below | |
PROMPT_COLOR=6 | |
# Git stuff | |
export GIT_PS1_SHOWDIRTYSTATE=1 | |
export GIT_PS1_SHOWSTASHSTATE=1 | |
export GIT_PS1_SHOWUNTRACKEDFILES=1 | |
export GIT_PS1_SHOWUPSTREAM="auto" | |
export GIT_PS1_HIDE_IF_PWD_IGNORED=1 | |
PS1='\[\e[0;31m\][\[\e[0;32m\]\u\[\e[0;31m\]$(getdecor)\[\e[0;3'${PROMPT_COLOR}'m\]\h\[\e[m\] \W\[\e[0;31m\]]\[\e[m\]$ ' | |
GIT_PROMPT_FILE=/usr/share/git-core/contrib/completion/git-prompt.sh | |
if [[ -r "${GIT_PROMPT_FILE}" ]]; then | |
# shellcheck source=/dev/null | |
. "${GIT_PROMPT_FILE}" | |
PS1=${PS1:0:${#PS1} - 2}'\[\e[0;33m\]$(__git_ps1)\[\e[m\]$ ' | |
fi | |
;; | |
*) # Skip interactive customizations to shell | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment