mirror of
https://mau.dev/andreijiroh-dev/dotfiles.git
synced 2025-05-16 02:23:09 +00:00
feat(bashrc): use prompt from projectsegfault (I'm not sure if it is)
Signed-off-by: Andrei Jiroh Halili <ajhalili2006@andreijiroh.eu.org>
This commit is contained in:
parent
7c21cd2dc4
commit
ec414976a4
1 changed files with 0 additions and 0 deletions
57
.config/bash/prompt
Normal file
57
.config/bash/prompt
Normal file
|
@ -0,0 +1,57 @@
|
|||
__sig() {
|
||||
# Giant switch case for getting the name of the signal (`kill -l`)
|
||||
a=0
|
||||
for i in $@; do
|
||||
a=$((a+1))
|
||||
case $i in
|
||||
126) printf ACCES ;;
|
||||
127) printf NOENT ;;
|
||||
129) printf HUP ;;
|
||||
130) printf INT ;;
|
||||
131) printf QUIT ;;
|
||||
132) printf ILL ;;
|
||||
133) printf TRAP ;;
|
||||
134) printf ABRT ;;
|
||||
135) printf BUS ;;
|
||||
136) printf FPE ;;
|
||||
137) printf KILL ;;
|
||||
138) printf USR1 ;;
|
||||
139) printf SEGV ;;
|
||||
140) printf USR2 ;;
|
||||
141) printf PIPE ;;
|
||||
142) printf ALRM ;;
|
||||
143) printf TERM ;;
|
||||
144) printf STKFLT ;;
|
||||
145) printf CHLD ;;
|
||||
146) printf CONT ;;
|
||||
147) printf STOP ;;
|
||||
148) printf TSTP ;;
|
||||
149) printf TTIN ;;
|
||||
150) printf TTOU ;;
|
||||
151) printf URG ;;
|
||||
152) printf XCPU ;;
|
||||
153) printf XFSZ ;;
|
||||
154) printf VTALRM ;;
|
||||
155) printf PROF ;;
|
||||
156) printf WINCH ;;
|
||||
157) printf IO ;;
|
||||
158) printf PWR ;;
|
||||
159) printf SYS ;;
|
||||
16[3-9]|1[7-8][0-9]|19[0-2]) printf RT$(($i-128)) ;; # Savagery
|
||||
*) printf $i ;; # Print exit code if not in list
|
||||
esac
|
||||
done
|
||||
}
|
||||
sig() {
|
||||
PLC=(${PIPESTATUS[@]})
|
||||
printf "$(__sig ${PLC[@]})"
|
||||
}
|
||||
NO_COLOUR="\[\033[0m\]"
|
||||
# Bold Colours
|
||||
RED="\[\033[01;31m\]"
|
||||
GREEN="\[\033[01;32m\]"
|
||||
YELLOW="\[\033[01;33m\]"
|
||||
BLUE="\[\033[01;34m\]"
|
||||
|
||||
PS1="[${RED}\$(sig)${NO_COLOUR}] [\t] [${RED}\u${NO_COLOUR}@${GREEN}\h${NO_COLOUR}|${BLUE}\w${NO_COLOUR}] [${YELLOW}#\#${NO_COLOUR}] ${GREEN}\$ ${NO_COLOUR}"
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue