]> code.delx.au - dotfiles/blob - .bash/interactive
vncviewer alias
[dotfiles] / .bash / interactive
1 #! bash
2
3 # Sets up the shell for interactive commands
4
5 # Use the terminfo backspace character as the erase character. This is not
6 # enabled by default because terminfo is often broken.
7 #stty erase $(tput kbs)
8
9 # The contents of /etc/debian_chroot will be printed in the prompt. You can
10 # create this file in chroot environments to know where you are.
11 if [ -z "$debian_chroot" -a -r /etc/debian_chroot ]; then
12 debian_chroot=$(cat /etc/debian_chroot)
13 fi
14
15 # Prompt: user@host:directory$
16 PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\n\$ '
17
18 # Check for unsupported TERM variable
19 if ! tput init &> /dev/null; then
20 echo "Warning! TERM=$TERM unsupported, using TERM=xterm"
21 export TERM=xterm
22 fi
23
24 # The all important colours!
25 ssource "${HOME}/.bash/colors"
26
27 # xterm titlebar displays 'hostname:workingdir'
28 if tput hs || tput tsl &> /dev/null; then
29 PROMPT_COMMAND='tput tsl; echo -n "$(hostname| cut -d. -f1):${PWD/$HOME/~}"; tput fsl;'
30 fi
31
32 # screen window displays current command
33 case "${TERM}" in
34 screen*)
35 PROMPT_COMMAND="$PROMPT_COMMAND echo -ne '\033k\033\\'"
36 ;;
37 esac
38
39 # Useful aliases
40 alias ls='ls --color=auto'
41 alias ll='ls -hlF'
42 alias la='ls -ha'
43 alias l='ls -halF'
44 alias ld='ls -ld'
45 alias f='find . -iname'
46 alias webshare='python -c "import SimpleHTTPServer; SimpleHTTPServer.test()"'
47 alias rm='rm -i'
48 alias less='less -R'
49 alias grep='grep --color=auto --exclude "*.svn-base"'
50 alias scp='scp -o ControlPath=none'
51 alias bc='bc -ql'
52 alias vv='vncviewer -encodings "tight hextile copyrect"'
53
54 # Bash should check the terminal size after every command terminates
55 shopt -s checkwinsize
56 # Don't attempt to tab-complete an empty line
57 shopt -s no_empty_cmd_completion
58
59 # Local customisations
60 ssource "${HOME}/.bash/interactive_local"
61
62 # Load bash completion if available
63 [ -r "/etc/bash_completion" ] && source "/etc/bash_completion"
64