From 3b861f796f21980ac2b5863e0e442e64708f4a5b Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Wed, 29 Feb 2012 20:05:57 -0600 Subject: start making shell stuff more portable --- bashrc | 157 ++--------------------------------------------------------------- 1 file changed, 4 insertions(+), 153 deletions(-) (limited to 'bashrc') diff --git a/bashrc b/bashrc index 01931e6..d411b14 100644 --- a/bashrc +++ b/bashrc @@ -5,28 +5,7 @@ # anything or bad things will happen ! # }}} # environment {{{ -export PATH="${HOME}/.bin/marathon:${HOME}/.bin/nethack:${HOME}/.bin:/usr/local/sbin:/usr/local/bin:/usr/lib/ccache/bin:$PATH" -export MPD_HOST=bishamon -export LUA_CPATH='/usr/local/lib/lua/5.1/?.so;/usr/local/lib/lua/5.1/?/init.so;./?.so' -export LUA_PATH='/usr/local/share/lua/5.1/?.lua;/usr/local/share/lua/5.1/?/init.lua;?.lua' -export MANPAGER="${HOME}/.bin/vimmanpager" -export EDITOR=$(which vim) -export SVN_SSH="${HOME}/.bin/ssh" -export DARCS_SSH="${HOME}/.bin/ssh" -export DARCS_SCP="${HOME}/.bin/scp" -export DARCS_SFTP="${HOME}/.bin/sftp" -export GIT_SSH="${HOME}/.bin/ssh" -export RSYNC_RSH="${HOME}/.bin/ssh" -export PERL5LIB="${HOME}/perl5/local/:${HOME}/perl5/local/lib/perl5/site_perl/5.10.0/i686-linux" -export CVS_RSH="${HOME}/.bin/ssh" -export TEXINPUTS=".:${HOME}/conf/tex:" -export LESS='-QR' -export NOPASTE_SERVICES="Codepeek Shadowcat Pastie Husk" -export PERL_CPANM_OPT="-q --mirror file://${HOME}/perl5/minicpan/ --mirror http://mirrors.kernel.org/cpan/ --mirror http://search.cpan.org/CPAN --prompt" -type -P git > /dev/null 2>&1 && export GIT_EXEC_PATH="${HOME}/.bin/git:"`git --exec-path` -[ -x /usr/bin/lesspipe ] && export LESSOPEN='|/usr/bin/lesspipe %s' -[ -x /usr/bin/lesspipe.sh ] && export LESSOPEN='|/usr/bin/lesspipe.sh %s' -[ -f $HOME/perl5/perlbrew/etc/bashrc ] && source $HOME/perl5/perlbrew/etc/bashrc +[ -f "$HOME/.env" ] && source $HOME/.env # }}} # Test for an interactive shell. {{{ # There is no need to set anything past this point for scp and rcp, and it's @@ -51,140 +30,12 @@ case ${TERM} in ;; esac # }}} # aliases {{{ -# adding options to common commands {{{ -alias ls="ls --color=auto --group-directories-first" -alias grep="grep --color=auto" -alias rm="rm -i" -alias cp="cp -i" -alias mv="mv -i" -alias bc="bc -lq" -alias truecrypt="sudo truecrypt -t" -alias prove="prove -rj5" -alias cpan-outdated="cpan-outdated --mirror file://${HOME}/perl5/minicpan/" -alias netstat="netstat -a --inet --numeric-port" -# }}} -# games {{{ -alias nao="(TERM=rxvt telnet nethack.alt.org)" -alias cao="(TERM=rxvt /usr/bin/ssh -C -i ${HOME}/.ssh/cao_key joshua@crawl.akrasiac.org)" -alias cdo="ssh -C -i ${HOME}/.ssh/cao_key crawl@crawl.develz.org" -alias scn="(TERM=xterm-color telnet slashem.crash-override.net)" -alias spork="telnet sporkhack.nineball.org" -alias cgoban="javaws http://files.gokgs.com/javaBin/cgoban.jnlp" -alias counterstrike="wine c:\\Program\ Files\\Sierra\\Half-Life\\hl.exe -game cstrike -console -numericping -nojoy -noipx" -alias halflife="wine c:\\Program\ Files\\Sierra\\Half-Life\\hl.exe" # -console breaks -alias starcraft='wine c:\\Program\ Files\ \(x86\)\\Starcraft\\StarCraft.exe' -# }}} -# termcast {{{ -alias tc="telnet termcast.org" -# }}} -# shells {{{ -alias bishamon='ssh bishamon' -alias apt="ssh ${USER}@apt.tozt.net" -alias jjaro="ssh ${USER}@jjaro.net" -alias tozt="ssh -t ${USER}@tozt.net tmux a" -alias henzell="ssh henzell@crawl.akrasiac.org" -# }}} -# tmux sessions {{{ -alias main='tmux a -t main' -alias work='tmux a -t work' -alias docs='tmux a -t docs' -alias misc='tmux a -t misc' -# }}} -# other {{{ -alias wgetff='wget --user-agent="Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.3) Gecko/20070404 Firefox/2.0.0.3"' -alias dotperl="rsync -av lib/* ${HOME}/perl5/local/" -alias clean_packages='sudo pacman -Rsn $(pacman -Qqdt)' -alias pm="find lib -type f | sort" -alias bootstrap_cpanm="wget -O- -q http://xrl.us/cpanm | perl - App::cpanminus" -function web { - local port=$1 - if [[ -z $port ]]; then - plackup -MPlack::App::Directory -e'Plack::App::Directory->new' - else - plackup -MPlack::App::Directory -e'Plack::App::Directory->new' --port $port - fi -} -function perldoc { - if type -P cpandoc > /dev/null 2>&1; then - cpandoc "$@" - else - command perldoc "$@" - fi -} -function incoming { - cpanm http://pause.cpan.org/incoming/$1.tar.gz -} -function webcam { - local width=$1 - local height=$2 - if [[ -z $width ]]; then width=640; fi - if [[ -z $height ]]; then height=480; fi - mplayer tv:// -tv driver=v4l2:width=$width:height=$height:device=/dev/video0 -fps 15 -vf screenshot -} -function webcam_record { - local width=$1 - if [[ -z $width ]]; then width=640; else shift; fi - local height=$1 - if [[ -z $height ]]; then height=480; else shift; fi - mencoder tv:// -tv driver=v4l2:width=$width:height=$height:device=/dev/video0:forceaudio:adevice=/dev/dsp -ovc lavc -oac mp3lame -lameopts cbr:br=64:mode=3 -o $1 -} -function luado { # thanks rici - local e=$1 - shift - lua /dev/fd/3 $* 4<&0- <<<$e 3<&0- 0<&4- -} -function moose { - perl -Moose -E "$*" -} -function setfont { - printf '\e]710;%s\007' "$1" -} -function mem_usage { - ps -eo size,ucmd | sort -rn | head -n$([ -z "$1" ] && echo 20 || echo $1) -} -function opened_files { - strace $* 2>&1 | grep -E '^open\(' | \ - grep -v ENOENT | \ - grep -v O_DIRECTORY | \ - cut -f2 -d"\"" | \ - grep -vE '^/proc/' | \ - grep -v '^/sys/' | \ - grep -v '^/dev/' -} -function alert { - echo "DISPLAY=$DISPLAY xmessage -center -default okay $1" | at $2 -} -function nopaste_moose { - nopaste --chan=#moose --services=Shadowcat --desc="$1" -} -function gist { - nopaste --services=Gist --desc="$1" -} -function fm22avi { - fceux --playmov $1.fm2 --sound 1 --soundq 1 --soundrate 48000 --nospritelim 1 --pal 0 --xscale 1 --yscale 1 --opengl 0 --special 0 $2 --videolog "mencoder - -o $1.avi -ovc x264 -x264encopts qp=0 -oac mp3lame -lameopts mode=3:preset=128 -noskip -nocache -mc 0 -aspect 4/3 NESVSETTINGS" -} -function pdfcat { - local out=$1 - shift - gs -q -sPAPERSIZE=letter -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=$out $* -} -function svup { - svc -u "$HOME/.services/$1" - svstat "$HOME/.services/$1" -} -function svdn { - svc -d "$HOME/.services/$1" - svstat "$HOME/.services/$1" -} -function svst { - svstat "$HOME/.services/$1" -} -# }}} +[ -f "$HOME/.aliases" ] && source $HOME/.aliases # }}} # external files {{{ [ -f /etc/bash_completion ] && source /etc/bash_completion [ -f /etc/profile.d/bash-completion ] && source /etc/profile.d/bash-completion -source ~/.bash/cdhist.sh +source ~/.sh/cdhist.sh # }}} # bash configuration {{{ shopt -s extglob @@ -204,7 +55,7 @@ else export PROMPT_COMMAND="${PROMPT_COMMAND};history -a" fi # prompt {{{ -export PROMPT_COMMAND="__err=\$?;$PROMPT_COMMAND;PS1=\"\$(fancy-prompt --prompt-escape "\$__err")\"" +export PROMPT_COMMAND="__err=\$?;$PROMPT_COMMAND;PS1=\"\$(fancy-prompt --prompt-escape bash "\$__err")\"" # }}} # set the correct perl {{{ if type -a perlbrew > /dev/null 2>&1; then -- cgit v1.2.3-54-g00ecf