Created
May 15, 2014 18:22
-
-
Save r3b/934b144ab53bd8b6706a to your computer and use it in GitHub Desktop.
Prettifying the bash shell
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
alias vb="VBoxManage" | |
alias ls='ls -GFh' | |
export CLICOLOR=1 | |
export LSCOLORS=ExFxBxDxCxegedabagacad | |
fill="--- " | |
reset_style='\[\033[00m\]' | |
red_style='\[\033[00;31m\]' | |
status_style=$reset_style'\[\033[0;90m\]' # gray color; use 0;37m for lighter color | |
prompt_style=$reset_style | |
command_style=$reset_style'\[\033[1;29m\]' # bold black | |
# Prompt variable: | |
PS1="$status_style"'$fill \t\n'"$prompt_style"'${debian_chroot:+($debian_chroot)}\e[01;30m\h\e[01;36m:\e[00;34m\W \e[01;34m'"$command_style " | |
# Reset color for command output | |
# (this one is invoked every time before a command is executed): | |
trap 'echo -ne "\033[00m"' DEBUG | |
function prompt_command { | |
# create a $fill of all screen width minus the time string and a space: | |
let fillsize=${COLUMNS}-9 | |
fill="" | |
while [ "$fillsize" -gt "0" ] | |
do | |
fill="-${fill}" # fill with underscores to work on | |
let fillsize=${fillsize}-1 | |
done | |
# If this is an xterm set the title to user@host:dir | |
case "$TERM" in | |
xterm*|rxvt*) | |
bname=`basename "${PWD/$HOME/~}"` | |
echo -ne "\n\033]0;${bname}: ${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007" | |
;; | |
*) | |
;; | |
esac | |
} | |
PROMPT_COMMAND=prompt_command |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment