Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # ~/.bashrc: executed by bash(1) for non-login shells.
- # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
- # for examples
- export EDITOR="gedit"
- # If not running interactively, don't do anything
- [ -z "$PS1" ] && return
- # don't put duplicate lines in the history. See bash(1) for more options
- export HISTCONTROL=ignoredups
- # ... and ignore same sucessive entries.
- export HISTCONTROL=ignoreboth
- # check the window size after each command and, if necessary,
- # update the values of LINES and COLUMNS.
- shopt -s checkwinsize
- # make less more friendly for non-text input files, see lesspipe(1)
- [ -x /usr/bin/lesspipe ] && eval "$(lesspipe)"
- # set a fancy prompt (non-color, unless we know we "want" color)
- # Define some colors first:
- red='\[\033[0;31m\]'
- RED='\[\033[1;31m\]'
- green='\[\033[0;32m\]'
- GREEN='\[\033[1;32m\]'
- yellow='\[\033[0;33m\]'
- YELLOW='\[\033[1;33m\]'
- blue='\[\033[0;34m\]'
- coldblue="\[\033[0;38;5;33m\]"
- BLUE='\[\033[1;34m\]'
- magenta='\[\033[0;35m\]'
- MAGENTA='\[\033[1;35m\]'
- cyan='\[\033[0;36m\]'
- CYAN='\[\033[1;36m\]'
- white='\[\033[0;37m\]'
- WHITE='\[\033[1;37m\]'
- NC='\[\033[0m\]' # No Color
- function pre_prompt {
- newPWD="${PWD}"
- user="whoami"
- host=$(echo -n $HOSTNAME | sed -e "s/[\.].*//")
- datenow=$(date "+%a, %d %b %y")
- let promptsize=$(echo -n "--[$user@$host]---[${PWD}]---" \
- | wc -c | tr -d " ")
- let fillsize=${COLUMNS}-${promptsize}
- fill=""
- while [ "$fillsize" -gt "0" ]
- do
- fill="${fill}—"
- let fillsize=${fillsize}-1
- done
- if [ "$fillsize" -lt "0" ]
- then
- let cutt=3-${fillsize}
- newPWD="...$(echo -n $PWD | sed -e "s/\(^.\{$cutt\}\)\(.*\)/\2/")"
- fi
- }
- PROMPT_COMMAND=pre_prompt
- #export black="\[\033[0;38;5;0m\]"
- #export red="\[\033[0;38;5;1m\]"
- #export green="\[\033[0;38;5;2m\]"
- #export yellow="\[\033[0;38;5;3m\]"
- #export blue="\[\033[0;38;5;4m\]"
- #export magenta="\[\033[0;38;5;55m\]"
- #export cyan="\[\033[0;38;5;6m\]"
- #export white="\[\033[0;38;5;7m\]"
- #export coldblue="\[\033[0;38;5;33m\]"
- #export smoothblue="\[\033[0;38;5;111m\]"
- #export iceblue="\[\033[0;38;5;45m\]"
- #export turqoise="\[\033[0;38;5;50m\]"
- #export smoothgreen="\[\033[0;38;5;42m\]"
- PS1="$cyan┌──[$RED\u@\h$cyan]─\${fill}─[$BLUE\$newPWD\
- $cyan]──\n$cyan└──[$YELLOW\$(date \"+%H:%M:%S\")$cyan]─$YELLOW\$$NC "
- # Comment in the above and uncomment this below for a color prompt
- #PS1="$RED[ \u ] $NC$green\h $NC$yellow[\w]$NC > "
- #\[\033]0;\${TERM} [\u@\h] \w\007\]
- # Alias definitions.
- # You may want to put all your additions into a separate file like
- # ~/.bash_aliases, instead of adding them here directly.
- # See /usr/share/doc/bash-doc/examples in the bash-doc package.
- # user-defined aliases
- alias ll='ls -alh'
- alias lx='ls -alhX'
- alias rm='rm -vi'
- alias cp='cp -vi'
- alias mv='mv -vi'
- alias df='df -h'
- alias mplayers='mplayer -vc ffh264vdpau,ffmpeg12vdpau,ffvc1vdpau,ffwmv3vdpau, -vo vdpau '
- alias du='du -mhc'
- alias vobcopy='vobcopy -m -v -i'
- #if [ -f ~/.bash_aliases ]; then
- # . ~/.bash_aliases
- #fi
- # enable color support of ls and also add handy aliases
- if [ "$TERM" != "dumb" ]; then
- eval "`dircolors -b`"
- alias ls='ls --color=auto'
- #alias dir='ls --color=auto --format=vertical'
- #alias vdir='ls --color=auto --format=long'
- fi
- # some more ls aliases
- #alias ll='ls -l'
- #alias la='ls -A'
- #alias l='ls -CF'
- # enable programmable completion features (you don't need to enable
- # this, if it's already enabled in /etc/bash.bashrc and /etc/profile
- # sources /etc/bash.bashrc).
- if [ -f /etc/bash_completion ]; then
- . /etc/bash_completion
- fi
Advertisement
Add Comment
Please, Sign In to add comment