# Paul Gorman's .bashrc # .bashrc is for non-login shells, like xterms. # Use .bash_profile for login shells, like virtual consoles. # If not running interactively, don't do anything: [ -z "$PS1" ] && return # Let me run X apps with sudo, God damn it! export XAUTHORITY=~/.Xauthority # In bash(1), search "history is initialized" HISTFILE=~/.bash_history HISTFILESIZE=5000 HISTSIZE=250 HISTCONTROL=ignoredups:ignorespace HISTIGNORE="?:??:exit:pwd:clear" HISTTIMEFORMAT="%Y %b %d (%a) %H:%M.%S " shopt -s cmdhist histappend histreedit cdspell checkwinsize shopt -u histverify export PATH=~/bin:$PATH export EDITOR=vim export GIT_EDITOR=vim export SYSTEMD_PAGER=cat PS1="\[\e[7m\]---- \h !\! \w \$ \[\e[0m\] " bind '"\e[A": history-search-backward' bind '"\e[B": history-search-forward' # emacs command prompt editing, even though I'm a vim guy: set -o vi # Aliases if [ -f ~/.bash_aliases ]; then . ~/.bash_aliases fi if [ -x /usr/bin/dircolors ]; then test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" test -r ~/.dir_colors && eval "$(dircolors -b ~/.dir_colors)" || eval "$(dircolors -b)" alias ls='ls --color=auto' fi alias l="ls -F --group-directories-first" alias ll="ls -lhF" alias la="ls -aF" alias rm="rm -I" alias mv="mv -i" alias rdp="rdesktop -5KPz -r clipboard:CLIPBOARD -a16 -x 0x81 -g 95%" alias rot13="tr '[A-Za-z]' '[N-ZA-Mn-za-m]'" alias h='history 60 | sort -k2 | uniq -f1 | sort -bn' alias d='date +%Y%m%d' alias wi='timeout 2s whois' # Colorize man pages man() { env LESS_TERMCAP_mb=$'\E[01;31m' \ LESS_TERMCAP_md=$'\E[01;38;5;74m' \ LESS_TERMCAP_me=$'\E[0m' \ LESS_TERMCAP_se=$'\E[0m' \ LESS_TERMCAP_so=$'\E[30;47m' \ LESS_TERMCAP_ue=$'\E[0m' \ LESS_TERMCAP_us=$'\E[04;38;5;146m' \ man "$@" } # Make less more friendly for non-text input files, see lesspipe(1) [ -x /usr/bin/lesspipe ] && eval "$(lesspipe)" # Enable programmable completion features, if not already enabled: if ! shopt -oq posix; then if [ -f /usr/share/bash-completion/bash_completion ]; then . /usr/share/bash-completion/bash_completion elif [ -f /etc/bash_completion ]; then . /etc/bash_completion fi fi bind 'TAB:menu-complete' bind 'set show-all-if-ambiguous on' # Set xterm title: PROMPT_COMMAND='echo -ne "\033]0;${HOSTNAME} ${PWD}\007"' # Relies on cron job: # 30 * * * * curl -s http://tgftp.nws.noaa.gov/data/observations/metar/decoded/KVLL.TXT > ~/.weathercurl # cat ~/.weathercurl | sed -n '/Temperature/p;/Sky/p;/Humidity/p' | cowsay -n # Check mail: echo "q" | mail | sed -n "2p" | awk '{ s = ""; for (i = 2; i <= NF; i++) s = s $i " "; print s }'