-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbashrc
More file actions
35 lines (28 loc) · 1.15 KB
/
Copy pathbashrc
File metadata and controls
35 lines (28 loc) · 1.15 KB
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
# scp protect from echo in .bashrc
[ -z "$PS1" ] && return
#or
[ -t 0 ] || return
### BASH HISTORY
# add time to histfile
HISTTIMEFORMAT="%d/%m/%y %T "
# ignore duplicates #ignoreboth for also removing lines with space in front
HISTCONTROL=ignoredups
### PS1 User set for system wide bashrc (>/etc/bashrc)
# change PS1 var if root (toilet line can be commented or remove as toilet is used for ascii art ^^)
#> type toilet >/dev/null || ( echo "... Installing libcaca" && sudo apt install toilet figlet; )
if [ $(id -u) -eq 0 ];
then
PS1='\[\033[1;30m\][\[\033[1;32m\]\u\[\033[1;30m\]@\[\033[0;34m\]\h\[\033[1;30m\]] \[\033[0;36m\]\w \[\033[1;30m\]#\[\033[0m\]'
toilet -f smslant --metal "root #" && echo
echo
else
PS1='\[\033[1;30m\][\[\033[1;34m\]\u\[\033[1;30m\]@\[\033[0;35m\]\h\[\033[1;30m\]] \[\033[0;36m\]\w \[\033[1;30m\]$\[\033[0m\]'
toilet -f smslant --gay "$USER"
echo
fi
### Bourne Again Functions
# die function
_DIE () { echo $1; exit 1; }
# show time bash or script was started
_EXECTIME(){ printf '%02dh:%02dm:%02ds\n' $(($SECONDS/3600)) $((SECONDS%3600/60)) $((SECONDS%60)) ; }
alias fn2profile='. $(type -p functions2profile.sh)'