diff --git a/dot_bashrc b/dot_bashrc new file mode 100644 index 0000000..9b6fe02 --- /dev/null +++ b/dot_bashrc @@ -0,0 +1,30 @@ +[ -z "$PS1" ] && return +HISTCONTROL=ignoredups:ignorespace +shopt -s histappend +HISTSIZE=5000 +HISTFILESIZE=5000 +if [ -x /usr/bin/dircolors ]; then + test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" + alias ls='ls --color=auto' + alias grep='grep --color=auto' + alias fgrep='fgrep --color=auto' + alias egrep='egrep --color=auto' +fi +if [ -f ~/.bash_aliases ]; then + . ~/.bash_aliases +fi + + +# From https://twitter.com/ahakcil/status/1230854797613522944 +ps1_state(){ + ret=$? + if [ $ret -eq 0 ]; then + echo -e "[$(date +%H:%M:%S)]\xF0\x9F\x94\xA5" + else + echo -e "[$(date +%H:%M:%S)]\xF0\x9F\x94\xB4->$ret " + fi +} +PS1='${debian_chroot:+($debian_chroot)}$(ps1_state)\[\033[01;31m\]\u\[\033[00m\][ \[\033[01;34m\]\w\[\033[00m\] ]\$ ' + +# From https://twitter.com/n00py1/status/1230755337797394434 +script -f /logs/$(date +"%d-%b-%y_%H-%M-%S")_shell.log \ No newline at end of file