add bash aliases
[cinan.git] / .bashrc
blob497ebdcee8f310dc30d37f363ed29873a643a723
1 # check the window size after each command and, if necessary,
2 # update the values of LINES and COLUMNS.
3 shopt -s checkwinsize
5 # Colour Codes
6 export Cyan="\[\e[m\]\[\e[0;36m\]"
7 export Red="\[\e[m\]\[\e[0;31m\]"
8 export LightCyan="\[\e[m\]\[\e[1;36m\]"
9 export LightRed="\[\e[m\]\[\e[1;31m\]"
10 export white="\[\e[0;37m\]"
12 # Code for a cool Prompt
13 function pre_prompt
15     newPWD="${PWD}"
16     let promptsize=$(echo -n "╒═[ $newPWD ]}╗" | wc -c | tr -d " ")
17     width=$COLUMNS
18     let fillsize=${width}-${promptsize}-1
19     let helping=$fillsize
20     fill=""
21     
22     while [ "$fillsize" -gt "0" ]
23     do
24         fill="${fill}═"
25         let fillsize=${fillsize}-${promptsize}
26     done
27     
28     if [ $helping == $fillsize ]
29     then
30         let cutt=3-${fillsize}
31         newPWD="...$(echo -n $PWD | sed -e "s/\(^.\{$cutt\}\)\(.*\)/\2/")"
32     fi
35 # Set prompt colour
36 if [ `id -u` -eq 0 ]
37 then
38     cText="${LightRed}"
39     cBorder="${Red}"
40 else
41     cText="${LightCyan}"
42     cBorder="${Cyan}"
45 PROMPT_COMMAND=pre_prompt
47 # Display Prompt
48 PS1="  ${cBorder}╒═${cBorder}═[ ${cText}\$newPWD${cBorder} ]\${fill}╕\n  ${cBorder}└${cBorder}> ${white}"
50 # To enable the settings / commands in this file for login shells as well,
51 # this file has to be sourced in /etc/profile.
53 # If not running interactively, don't do anything
54 [ -z "$PS1" ] && return
56 # set variable identifying the chroot you work in (used in the prompt below)
57 #if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
58 #    debian_chroot=$(cat /etc/debian_chroot)
59 #fi
61 # set a fancy prompt (non-color, overwrite the one in /etc/profile)
62 #PS1='\[\e[0;32m\]\u@\h:\w\$\[\e[1;37m\] '
63 #PS1='\[\e[0;36m\]\w\$\[\e[0;37m\] '
64 #export PROMPT_COMMAND='cwd=${PWD%/}; thisdir="$(echo $cwd | sed '\''s/.*\///'\'')"; dirparts="${cwd:0:$((${#cwd} - ${#thisdir}))}"; dirparts="$(echo ${dirparts%/} | sed '\''s/\//\\[\\e[0;33m\\]\/\\[\\e[32m\\]/g'\'')"; rc=${PWD%/}; rc=${rc:0:1}; PS1="\[\e]0;${cwd}/\007\e[1;36m\][\[\e[0;36m\]$(date "+%I:%M:%S %p")\[\e[1m\]] ${dirparts}\[\e[0;33m\]${rc}\[\e[1;34m\]${thisdir}\[\e[0;33m\]/\[\e[1;33m\] %\[\e[0m\] "'
66 # enable bash completion in interactive shells
67 if [ -f /etc/bash_completion ]; then
68     . /etc/bash_completion
71 export TERM=xterm-256color
73 alias ls="ls --color"
74 alias editt="sudo vi /usr/share/themes/openbox_cinan/openbox-3/themerc"
75 #alias pal="xterm -hold -bg black -fg white -geometry 37x12 -e pal"
76 alias pacman="pacman-color"
77 alias du="du -hs"
78 alias df="df -h"
79 alias grep="grep --colour"
80 alias rubysearch="ruby ~/skripty/search_interface.rb"
81 alias vi="vim -u ~/.vimrc"
82 alias more="less"
83 alias rtorrent="rtorrent -o http_capath=/etc/ssl/certs"
84 alias smplayer="smplayer 2>/dev/null"
85 alias f="cd /media/data/filmy"
86 alias F="cd /media/data"
87 alias d="cd /media/data2"
88 alias D="cd /media/data2/download"