-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathset_prompt
executable file
·59 lines (47 loc) · 1.63 KB
/
set_prompt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/bash
# invoke this file from your .bashrc and it will set the prompt PS1.
# I have it and colour.bash in a subdirectory ~/.bash, so the .bashrc
# contains the following, with the 'source' line not comented, of course.
#
# # Set prompt
# source /home/legrady/.bash/set_prompt
#
# The 'source line below similarly uses a fully-qualified path.
#
# The version in /root use 'RED' 'BLACK' for the color, and a dollar
# sign for the POINTER.
source colour.bash
# echo "End of defining functions"
POINTER=$(echo -e "-\xe2\x9e\xa4")
#echo "Pointer is $POINTER"
ANSI_color 'GREEN' 'BLACK'
PSCOLOR=$ANSI_SEQUENCE
ANSI_color 'BRIGHT' 'WHITE' 'BLACK'
PS_SEP_COLOR=$ANSI_SEQUENCE
NOCOLOR="\[\e[00m\]"
#echo -e "PSCOLOR=$PSCOLOR sample $NOCOLOR PS_SEP_COLOR=$PS_SEP_COLOR sample $NOCOLOR NOCOLOR=$NOCOLOR"
#echo "defined colors"
PS_SEP=$PS_SEP_COLOR
#PS_SEP+='|'
PS_SEP+=$(echo -e "\xe2\x94\x83")
PS_OPEN=$PS_SEP_COLOR
PS_OPEN+='['
PS_CLOSE=$PS_SEP_COLOR
PS_CLOSE+=']'
#echo "PS_SEP = $PS_SEP; PS_OPEN = $PS_OPEN; PS_CLOSE = $PS_CLOSE"
#echo "defined separators"
DATE="${PSCOLOR}\d"
TIME="${PSCOLOR}\t"
USER="${PSCOLOR}\u@\h"
WHERE="${PSCOLOR}\w"
#echo "defined components"
PS1="${PS_SEP} ${DATE} ${PS_SEP} ${TIME} ${PS_OPEN}${USER}${PS_CLOSE} ${WHERE} ${PS_SEP} ${NOCOLOR}\n${PS_SEP}${PSCOLOR}${POINTER} ${NOCOLOR} "
#echo "PS1 is $PS1"
#echo "end of file"
# (c) April, 2015 Tom Legrady <[email protected]>
#
# Released under
# Artistic License (http://dev.perl.org/licenses/artistic.html)
# GNU Lublic License v3 (http://www.gnu.org/licenses/).
# Use it, just don't claim you wrote it.
# END OF FILE --------------------------------------------------