Skip to content
This repository has been archived by the owner on Apr 15, 2020. It is now read-only.

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
genehack committed Dec 14, 2008
1 parent 805de04 commit 8e226ec
Show file tree
Hide file tree
Showing 15 changed files with 41 additions and 678 deletions.
12 changes: 0 additions & 12 deletions Xdefaults

This file was deleted.

40 changes: 11 additions & 29 deletions aliases
Original file line number Diff line number Diff line change
@@ -1,39 +1,21 @@
# -*- sh -*-
### genehack bash aliases

# $Id$
# $URL$

# prevent some mistakes
alias cp="cp -i"
alias mv="mv -i"
alias rm="rm -i"

# modify ls
#if shopt -q login_shell ; then
if [ $OS_TYPE = 'linux' ]; then
eval `dircolors -b`
alias ls='/bin/ls --color=auto --classify'
elif [ $GENEHACK_LOCATION = 'LAPTOP' ]; then
eval `/opt/local/bin/dircolors -b`
alias ls='/opt/local/bin/ls --color=auto --classify'
fi
#fi
alias grep='grep --color=auto'

if [ -e /Applications/Emacs.app/Contents/MacOS/Emacs ]; then
alias emacs='/Applications/Emacs.app/Contents/MacOS/Emacs'
if [ $OS_TYPE = 'linux' ]; then
eval `dircolors -b`
alias ls='/bin/ls --color=auto --classify'
elif [ $GENEHACK_LOCATION = 'LAPTOP' ]; then
eval `/opt/local/bin/dircolors -b`
alias ls='/opt/local/bin/ls --color=auto --classify'
fi

# ssh shortcuts
alias gho='ssh genehack.org'
alias ghc='ssh genehack.com'
alias ghn='ssh genehack.net'

# development
alias cp="cp -i"
alias find-common='cut -f1 -d" " ~/.bash_history | sort | uniq -c | sort -nr | head -n 25'
alias grep='grep --color=auto'
alias mv="mv -i"
alias pe-extern='svn pe svn:externals'
alias pe-ignore='svn pe svn:ignore'
alias ps-id='svn ps svn:keywords "Id URL"'
alias rm="rm -i"

alias find-common='cut -f1 -d" " ~/.bash_history | sort | uniq -c | sort -nr | head -n 25'

6 changes: 0 additions & 6 deletions bash_logout
Original file line number Diff line number Diff line change
@@ -1,7 +1 @@
# -*- sh -*-
# ~/.bash_logout: executed by bash(1) when login shell exits.

# $Id$
# $URL$

clear
4 changes: 0 additions & 4 deletions bash_profile
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
# -*- sh -*-
### genehack .bash_profile

# $Id$
# $URL$

# how bash decides which config files to read, from the INVOCATION
# section of the bash(1) man page:
Expand Down
134 changes: 22 additions & 112 deletions bashrc
Original file line number Diff line number Diff line change
@@ -1,27 +1,12 @@
# -*- sh -*-
### genehack .bashrc
if [ -f /etc/bashrc ]; then . /etc/bashrc; fi

# $Id$
# $URL$

## globals
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi

## OS
OS=`uname`
if [ $OS = 'Linux' ]; then
export OS_TYPE='linux'
elif [ $OS = 'Darwin' ]; then
export OS_TYPE='darwin'
elif [ $OS = 'FreeBSD' ]; then
export OS_TYPE='freebsd'
else
export OS_TYPE='UNKNOWN'
if [ $OS = 'Linux' ]; then export OS_TYPE='linux'
elif [ $OS = 'Darwin' ]; then export OS_TYPE='darwin'
elif [ $OS = 'FreeBSD' ]; then export OS_TYPE='freebsd'
else export OS_TYPE='UNKNOWN'
fi

## $HOSTNAME
if [ $OS_TYPE = 'darwin' -o $OS_TYPE = 'freebsd' ]; then
export HOSTNAME=`/bin/hostname -s`
export DOMAIN=`/bin/hostname | cut -f2- -d.`
Expand All @@ -33,116 +18,43 @@ else
fi


## SET UP GENEHACK_LOCATION VARIABLE AND OTHER SECRET STUFF
if [ -e $HOME/.bash_private ]; then
. $HOME/.bash_private
fi
if [ -e $HOME/.bash_private ]; then . $HOME/.bash_private; fi

## BASH COMPLETION
if [ -e /etc/bash_completion ]; then
. /etc/bash_completion;
fi
if [ -e $HOME/.bash_completion.d ]; then
for file in $HOME/.bash_completion.d/* ; do
. $file
done
fi
if [ -e /etc/bash_completion ]; then . /etc/bash_completion; fi

if [ -e $HOME/.aliases ]; then . $HOME/.aliases; fi

## ALIASES
if [ -e $HOME/.aliases ]; then
. $HOME/.aliases
fi

## EDITORS
export EDITOR=/opt/emacs/bin/emacsclient
export GIT_EDITOR='/opt/emacs/bin/emacsclient -c'
export GIT_EDITOR=vim
export VISUAL=/opt/emacs/bin/emacsclient

## FETCHMAIL
# if we're on a mail reading machine, set FETCHMAILHOME
if [ -e $HOME/private/fetchmailrc ]; then
export FETCHMAILHOME=$HOME/private
if [ -d /opt/local/bin ]; then
export PATH=/opt/local/bin:$PATH
fi

## FUNCTIONS
# ganked from <http://www.enigmacurry.com/2007/05/24/multi-tty-emacs-on-gentoo-and-ubuntu/>
SERVERNAME=genehack
start_emacs () {
#Attempt to connect to an existing server
emacsclient -s $SERVERNAME $*
if [ $? -ne 0 ]; then
#Start a new emacs server and connect
preload_emacs $SERVERNAME 0
emacsclient -s $SERVERNAME $*
fi
}


## PATHS
if [ $GENEHACK_LOCATION = "LAPTOP" ]; then
if [ -d /opt/local/bin ]; then
export PATH=/opt/local/bin:$PATH
fi
if [ -e /opt/perl/5.10.0/bin ]; then
export PATH=/opt/perl/5.10.0/bin:$PATH
elif [ -e /opt/perl/5.8.8/bin ]; then
export PATH=/opt/perl/5.8.8/bin:$PATH
fi
if [ -e /opt/perl/bin ]; then export PATH=/opt/perl/bin:$PATH
elif [ -e /opt/local/perl/bin ]; then export PATH=/opt/local/perl/bin:$PATH
elif [ -e /opt/perl/5.10.0/bin ]; then export PATH=/opt/perl/5.10.0/bin:$PATH
elif [ -e /opt/perl/5.8.8/bin ]; then export PATH=/opt/perl/5.8.8/bin:$PATH
fi

for PKG in awesome emacs git perl subversion ; do

for PKG in awesome emacs git subversion ; do
if [ -e /opt/$PKG ]; then
export PATH=/opt/$PKG/bin:$PATH
fi
done

if [ -e /opt/local/perl/bin ]; then
export PATH=/opt/local/perl/bin:$PATH
fi

if [ -e $HOME/local/bin ]; then export PATH=$HOME/local/bin:$PATH; fi
if [ -e $HOME/local/man ]; then export MANPATH=$HOME/local/man:$MANPATH; fi

# stack things to get the right order:
# start with system stuff
# /sw before system stuff
# ~/local before /sw
# ~/bin before ~/local
if [ -e /sw ]; then
if [ -e /sw/bin ]; then
export PATH=/sw/bin:$PATH
fi
if [ -e /sw/man ]; then
export MANPATH=/sw/man:$MANPATH
fi
fi
if [ -e $HOME/local ]; then
if [ -e $HOME/local/bin ]; then
export PATH=$HOME/local/bin:$PATH
fi
if [ -e $HOME/local/man ]; then
export MANPATH=$HOME/local/man:$MANPATH
fi
fi
if [ -e $HOME/bin ]; then
export PATH=$HOME/bin:$PATH
fi
if [ -e $HOME/man ]; then
export MANPATH=$HOME/man:$MANPATH
fi
if [ -e $HOME/bin ]; then export PATH=$HOME/bin:$PATH; fi
if [ -e $HOME/man ]; then export MANPATH=$HOME/man:$MANPATH; fi

## KEYCHAIN
if shopt -q login_shell ; then
#`/usr/bin/which keychain 2>&1 >/dev/null`
`which keychain 2>&1 >/dev/null`
if [ $? = 0 ]; then
#if [ $GENEHACK_LOCATION = "HOME" ]; then
# keychain -q B1CFBD6F 2>/dev/null
#fi
if [ -e ~/.keychain/${HOSTNAME}-sh-gpg ]; then
. ~/.keychain/${HOSTNAME}-sh-gpg > /dev/null
export GPG_TTY=`tty`
fi

if [ -e ~/.ssh/id_dsa ]; then
keychain -q ~/.ssh/id_dsa 2>/dev/null
fi
Expand All @@ -152,8 +64,6 @@ if shopt -q login_shell ; then
fi
fi


## SET PROMPT
setprompt() {
local load etc

Expand Down Expand Up @@ -190,12 +100,12 @@ else
PROMPT_COMMAND=setprompt
fi

## SHELL OPTIONS
export HISTFILESIZE=1000000000
export HISTIGNORE="&:ls:[bf]g:ext"
export HISTSIZE=1000000
export LC_ALL=POSIX
export RI='-f ansi'

shopt -s cdspell
shopt -s dotglob
shopt -s no_empty_cmd_completion
Expand Down
5 changes: 0 additions & 5 deletions cvsrc

This file was deleted.

3 changes: 0 additions & 3 deletions module-starter/config

This file was deleted.

3 changes: 0 additions & 3 deletions sbin/build-color
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#! /bin/sh

# $Id$
# $URL$

COLOR_BIN=$HOME/bin/color

if [ ! -d $HOME/bin ]; then
Expand Down
16 changes: 3 additions & 13 deletions sbin/make-etc-links
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
#! /bin/bash

# $Id$
# $URL$

ln -sfv ~/etc/sbin/make-etc-links ~/bin

echo

for i in \
Xdefaults \
Xmodmap \
aliases \
awesomerc \
bash_logout \
bash_profile \
bashrc \
conkyrc \
cvsrc \
screenrc \
; do
ln -sfv ~/etc/$i ~/.$i
Expand All @@ -32,13 +27,8 @@ ln -sfv ~/etc/subversion/config ~/.subversion/config
ln -sfv ~/etc/subversion/servers ~/.subversion/servers
ln -sfv ~/etc/vim/vimrc ~/.vimrc

echo
rm -f ~/.vim
ln -sfv ~/etc/vim ~/.vim

rm -f ~/.module-starter
if [ $GENEHACK_LOCATION = "WORK" ]; then
ln -sfv ~/etc/module-starter-work ~/.module-starter
else
ln -sfv ~/etc/module-starter ~/.module-starter
fi
echo

rm -f ~/.vim && ln -sfv ~/etc/vim ~/.vim
13 changes: 4 additions & 9 deletions screenrc
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
# $Id$

startup_message off

screen -t TOP 0 top
screen -t sh 1 bash

#blankerprg watch -n 60 clear && "figlet -c `date \"+%A%n%B %d, %G%n%I:%M%P\"`" && cowsay `fortune`
idle 3600 blanker
hardstatus alwayslastline "%{.kY} <%H> %{.bW} %-w%{.rW}%n %t%{-}%+w %=%{.kR} [%l] %{.kw} %D %d %M %Y %c:%s"

screen -t emacs 1 emacs
screen -t sh 2 bash
screen -t sh 3 bash

bindkey -k kb stuff ^H
alwayslastline "%{.kY} <%H> %{.bW} %-w%{.rW}%n %t%{-}%+w %=%{.kR} [%l] %{.kw} %D %d %M %Y %c:%s"

select 1
Loading

0 comments on commit 8e226ec

Please sign in to comment.