Commits

Anonymous committed ed25048

Removing shell scripts, cleanup

Comments (0)

Files changed (20)

.bash/alias.bash

-#!/usr/bin/env bash
-
-#
-# Universal aliases
-#
-
-#alias tmuxa="tmux attach"
-#alias tmuxn="tmux new"
-alias tmux="~/.bash/tmux.sh"
-alias cd="pushd . > /dev/null; cd"
-alias pd="popd &> /dev/null"
-alias df="df -h"
-alias du="du -h"
-alias nao="telnet nethack.alt.org"
-alias ecc="emacsclient -n -c"
-alias ec="emacsclient -nw"
-alias mg="mg -n"
-alias halt="halt -p"

.bash/emacs.bash

-#!/usr/bin/env bash
-
-# Start the emacs daemon if it isn't running
-
-if [ ! -S /tmp/emacs${UID}/server ] && [ -x $(which emacs) ]; then
-    emacs --daemon
-fi

.bash/gnustep.bash

-#!/usr/bin/env bash
-
-#
-# Source the GNUstep make files for compiling Objective-C projects
-#
-
-if [ -d /usr/local/GNUstep ]; then
-    source /usr/local/GNUstep/System/Makefiles/GNUstep.sh
-elif [ -d /usr/GNUstep ]; then
-    source /usr/GNUstep/System/Makefiles/GNUstep.sh
-fi

.bash/go.bash

-#!/usr/bin/env bash
-
-#
-# Setting necessary Go variables
-#
-
-if [ -d $HOME/src/go ]; then
-    OS=$(uname -s)
-    ARCH=$(uname -m)
-# Only the os that Go claims to support
-    case $OS in
-	Linux)
-            export GOOS="linux"
-            ;;
-	FreeBSD)
-            export GOOS="freebsd"
-            ;;
-	Darwin)
-            export GOOS="darwin"
-            ;;
-    esac
-# Hopefully this catches all the possible variations of x86/amd64
-# Maybe someday ARM will be here too
-    case $ARCH in
-	i386)
-            export GOARCH="386"
-            ;;
-	i686)
-            export GOARCH="386"
-            ;;      
-	x86_64)
-            export GOARCH="amd64"
-            ;;
-	amd64)
-            export GOARCH="amd64"
-            ;;
-    esac
-    unset $ARCH $OS
-
-    if [ -n $GOARCH -a -n $GOOS ]; then
-        export GOROOT=$HOME/src/go
-        export GOBIN=$HOME/bin
-    fi
-fi

.bash/have.bash

-#!/usr/bin/env bash
-
-#
-# Setting a good value for $EDITOR, $BROWSER, $PAGER
-#
-have() { type "$@" >/dev/null 2>&1; }
-
-EDITOR="vi"   
-have vim && EDITOR="vim"
-have mg && EDITOR="mg"
-have emacsclient && EDITOR="emacsclient -nw -a mg"
-export EDITOR
-
-BROWSER="lynx"
-have elinks && BROWSER="elinks"
-have firefox && BROWSER="firefox"
-have opera && BROWSER="opera"
-have chromium && BROWSER="chromium"
-have google-chrome && BROWSER="google-chrome"
-export BROWSER
-
-PAGER="more"
-have less && PAGER="less"
-export PAGER

.bash/j.bash

-#!/usr/bin/env bash
-
-#
-# Setting up J
-#
-
-if [ -d $HOME/src/jlang ]; then
-    export JROOT=$HOME/src/jlang
-    export PATH=$PATH:$JROOT/bin
-fi

.bash/keychain.bash

-#!/usr/bin/env bash
-
-#
-# Run keychain with default SSH id
-#
-
-if [ -f /usr/bin/keychain -a -f ~/.ssh/id_rsa ]; then
-    /usr/bin/keychain -q ~/.ssh/id_rsa
-    source $HOME/.keychain/${HOSTNAME}-sh
-fi

.bash/os.bash

-#!/usr/bin/env bash
-
-#
-# Setting OS-specific paths, command aliases and other variables
-#
-
-OS=$(uname -s)
-case $OS in
-    DragonFly)
-        export FORTUNE_SET="dragonfly-tips"
-        export PATH=/bin:/usr/bin:/usr/sbin:/sbin:/usr/pkg/bin:/usr/pkg/sbin:/usr/local/bin:/usr/local/sbin:/usr/games/:/usr/local/games
-        alias pkg_add="pkg_radd -v"
-        alias pkg_upd="pkg_radd -u -u -v"
-        ;;
-    OpenBSD)
-        VERSION=$(uname -r)
-        ARCH=$(uname -m)
-        export PKG_PATH="ftp://carroll.cac.psu.edu/pub/OpenBSD/${VERSION}/packages/${ARCH}/"
-        export PATH=/bin:/usr/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11R6/bin:/usr/local/sbin:/usr/games/:/usr/local/games
-        alias pkg_add="pkg_add -i -v"
-        alias pkg_upd="pkg_add -u -i -v"
-        ;;
-    FreeBSD)
-        export PATH=/bin:/usr/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/sbin:/usr/games/:/usr/local/games
-        export FORTUNE_SET="freebsd-tips"
-        export FTP_PASSIVE_MODE=YES
-        alias pkg_add="pkg_add -r"
-        alias mv="mv -v"
-        alias cp="cp -v"
-        alias mkdir="mkdir -v"
-        alias ln="ln -v"      
-	if [ ${TERM} != "dumb" ]; then
-            alias ls="ls -FG"
-	    alias grep="grep --color=auto"
-	fi
-        ;;
-    Linux)
-	export PATH=/bin:/usr/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/sbin:/usr/games/:/usr/local/games
-        alias rm="rm --preserve-root"
-        alias cp="cp -v"
-        alias mv="mv -v"
-        alias mkdir="mkdir -v"
-        alias ln="ln -v"
-        if [ ${TERM} != "dumb" ]; then
-	    alias ls="ls -Fh --color=auto"
-            alias grep="grep --color=auto"
-        else alias ls="ls -h"
-        fi
-	;;
-    *)
-        export PATH=/bin:/usr/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/sbin:/usr/games/:/usr/local/games
-        ;;
-esac

.bash/prompt.bash

-#!/usr/bin/env bash
-
-#
-# If we're in a chroot, display a special prompt, otherwise display default
-#
-
-case $UID in
-    0)
-        h="\[\e[1;37m\]\h\[\e[m\]"
-        w="\[\e[1;37m\]\W# \[\e[m\]"
-        at="\[\e[1;37m\]@\[\e[m\]"
-        if [ -f /etc/debian_chroot ]; then
-            c="\[\e[1;37m\]`cat /etc/debian_chroot`\[\e[m\]"
-            export PS1="($c)$h:$w"
-        else 
-            export PS1="$h:$w"
-        fi
-        unset h w c at
-        ;;
-    *)
-        h="\[\e[1;31m\]\h\[\e[m\]"
-        u="\[\e[1;31m\]\u\[\e[m\]"
-        w="\[\e[1;32m\]\W$ \[\e[m\]"
-        at="\[\e[1;37m\]@\[\e[m\]"
-        if [ -f /etc/debian_chroot ]; then
-            c="\[\e[1;37m\]`cat /etc/debian_chroot`\[\e[m\]"
-            export PS1="$u$at($c)$h:$w"
-        else 
-            export PS1="$u$at$h:$w"
-        fi
-        unset h u w c at
-        ;;
-esac

.bash_profile

-#!/usr/bin/env bash
-# .bash_profile: bash startup script for interactive shells
-
-source $HOME/.bash/keychain.bash
-source $HOME/.bash/prompt.bash
-source $HOME/.bash/os.bash
-source $HOME/.bash/alias.bash
-source $HOME/.bash/have.bash
-source $HOME/.bash/go.bash
-source $HOME/.bash/j.bash
-source $HOME/.bash/gnustep.bash
-source $HOME/.bash/emacs.bash
-
-[ -d $HOME/bin ] && export PATH=$PATH:$HOME/bin
-[ -d $HOME/.cabal ] && export PATH=$PATH:$HOME/.cabal/bin
-
-#
-# Local changes go in this file
-#
-
-[ -f $HOME/.bash.local ] && . $HOME/.bash.local
-
-#
-# Run fortune
-#
-
-fortune $FORTUNE_SET
 #!/usr/bin/env bash
-# .bashrc: bash startup script for non-interactive shells
 
-source $HOME/.bash/os.bash
-source $HOME/.bash/have.bash
-source $HOME/.bash/go.bash
-source $HOME/.bash/j.bash
-source $HOME/.bash/gnustep.bash
+alias tmux="~/bin/tmux.sh"
+alias cd="pushd . >/dev/null; cd"
+alias pd="popd &>/dev/null"
+alias cp="cp -v"
+alias mv="mv -v"
+alias mg="mg -n"
+alias mkdir="mkdir -v"
+alias grep="grep --color=auto"
+alias ls="ls --color=auto"
+alias ln="ln -v"
+
+if [ -f /usr/bin/keychain -a -f ~/.ssh/id_rsa ]; then
+    /usr/bin/keychain -q ~/.ssh/id_rsa
+    source $HOME/.keychain/${HOSTNAME}-sh
+fi
+if [ $UID == 0 ]; then
+    export PS1="# "
+else
+    export PS1="$ "
+fi
+export EDITOR=mg
+export PAGER=less
+export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
+#export GOROOT="/store/src/go"
+#export GOARCH="amd64"
+#export GOOS="linux"
+#export GOBIN="/usr/local/bin"
 
 [ -d $HOME/bin ] && export PATH=$PATH:$HOME/bin
 [ -d $HOME/.cabal ] && export PATH=$PATH:$HOME/.cabal/bin
-
-#
-# Local changes go there
-#
-
-[ -f $HOME/.bash.local ] && . $HOME/.bash.local
 
 set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin /usr/local/games $HOME/bin)
 
-setenv EDITOR vi
-setenv BROWSER uzbl-tabbed
+setenv EDITOR mg
 setenv PAGER less
 setenv BLOCKSIZE K
-setenv UID 1001
 
 if ($?prompt) then
     if ($USER == root) then
+# Lines configured by zsh-newuser-install
+HISTFILE=~/.histfile
+HISTSIZE=1000
+SAVEHIST=1000
+bindkey -e
+# End of lines configured by zsh-newuser-install
+# The following lines were added by compinstall
+zstyle :compinstall filename '/home/michael/.zshrc'
+
+autoload -Uz compinit
+compinit
+# End of lines added by compinstall
+
+alias tmux="~/bin/tmux.sh"
+alias cp="cp -v"
+alias mv="mv -v"
+alias ec="emacsclient -nw"
+alias ecc="emacsclient -n -c"
+alias mg="mg -n"
+alias halt="halt -p"
+alias mkdir="mkdir -v"
+alias grep="grep --color=auto"
+alias ls="ls --color=auto"
+alias ln="ln -v"
+export PROMPT="%% "
+export GOROOT="/store/src/go"
+export GOARCH="amd64"
+export GOOS="linux"
+export GOBIN="/usr/local/bin"

ksh.kshrc

-#
-# .kshrc
-#
-OS=${OS:-`uname -s`}
-case $OS in
-    OpenBSD)
-        alias pkg_add="pkg_add -i -v"
-        alias pkg_upd="pkg_add -i -v -u"
-        ;;      
-    FreeBSD)
-        alias pkg_add="pkg_add -r -v"
-        alias mv="mv -v"
-        alias cp="cp -v"
-        alias mkdir="mkdir -v"
-        alias ln="ln -v"      
-        alias ls="ls -FG"
-        ;;
-    DragonFly)
-        alias pkg_add="pkg_add -v"
-        alias pkg_upd="pkg_add -u -u -v"
-        ;;
-    *)
-        ;;      
-esac
-alias df="df -h"
-alias du="du -h"
-alias ls="ls -h"
-alias tmuxa="tmux attach"
-alias tmuxn="tmux new"
-alias nao="telnet nethack.alt.org"
-#
-# Local changes go there
-#
-if [ -f $HOME/.ksh.local ]; then . $HOME/.ksh.local; fi
-#
-# Gets a quote from fortune if it is found
-#
-fortune $FORTUNE_SET

ksh.profile

-#!/usr/bin/env ksh
-#
-# ~/.profile 
-# ksh profile
-#
-OS=${OS:-`uname -s`}
-case $OS in
-    OpenBSD)
-        VERSION=${VERSION:-`uname -r`}
-        ARCH=${ARCH:-`uname -m`}
-        export PATH=/bin:/usr/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11R6/bin:/usr/local/sbin:/usr/games/:/usr/local/games
-        if [ -d $HOME/bin ]; then export PATH=$PATH:$HOME/bin; fi
-        export PKG_PATH="ftp://carroll.cac.psu.edu/pub/OpenBSD/${VERSION}/packages/${ARCH}/"
-        export EDITOR="vi"
-        ;;
-    FreeBSD)
-        export EDITOR="vi"
-        export FORTUNE_SET="freebsd-tips"
-        export FTP_PASSIVE_MODE="YES"
-        
-        ;;
-    DragonFly)
-        export PATH=/bin:/usr/bin:/usr/sbin:/sbin:/usr/pkg/bin:/usr/pkg/sbin:/usr/local/bin:/usr/local/sbin:/usr/games/:/usr/local/games
-        ;;
-    *)
-        ;;
-esac
-case $USER in
-    root)
-        export PS1="\h:\W# "
-        ;;
-    *)
-        export PS1="\u@\h:\W$ "
-        ;;
-esac
-# Go crap
-if [ -d $HOME/src/go ]; then
-    . ~/.go.sh
-    if [ -n $GOARCH -a -n $GOOS ]; then
-        export GOROOT=$HOME/src/go
-        export GOBIN=$HOME/bin
-    fi
-fi
-. ~/.kshrc

naturalize.sh

-#!/usr/bin/env bash
-#
-# Script to pull dotfiles and put them in the right place
-#
-
-function backup {
-    if [ -f $HOME/$1 ]; then
-        echo "* Backing up $HOME/$1 to $HOME/$1.backup"
-        mv $HOME/$1 $HOME/$1.backup
-    fi
-}
-
-function link_with_new_name {
-    echo "* Linking $PWD/$1 to $HOME/$2..."
-    ln -s $PWD/$1 $HOME/$2
-}
-
-function link {
-    link_with_new_name "$1" "$1"
-}
-
-function backup_and_link {
-    backup $1
-    link $1
-}
-
-ksh() {
-    backup ".kshrc"
-    backup ".profile"
-    link_with_new_name "ksh.kshrc" ".kshrc"
-    link_with_new_name "ksh.profile" ".profile"
-}
-
-bash() {
-    backup_and_link ".bash_profile"
-    backup_and_link ".bashrc"
-    backup_and_link ".bash"
-}
-
-# tmux() {
-#     backup_and_link ".tmux.conf"
-# }
-
-# screen() {
-#     backup_and_link ".screenrc"
-# }
-
-# vim() {
-#     backup_and_link ".vimrc"
-# }
-
-# emacs() {
-#     backup_and_link ".emacs"
-# }
-
-# xsession() {
-#     backup_and_link ".xsession"
-# }
-
-[ $1 = 'ksh' ] && ksh
-[ $1 = 'bash' ] && bash
-# [ $1 = 'tmux' ] && tmux
-# [ $1 = 'screen' ] && screen
-# [ $1 = 'vim' ] && vim
-# [ $1 = 'emacs' ] && emacs
-# [ $1 = 'xsession' ] && xsession

runschroot.sh

-#!/bin/sh
-#########################################################
-# runschroot.sh : run programs from in a schroot easily #
-#########################################################
-#
-# Example: run the Inform 7 from your sid chroot in the main environment 
-#
-# $ ln -s runschroot.sh ~/bin/gnome-inform7
-# $ gnome-inform7
-#
-exec schroot -p -c sid -q -- "`basename $0`" "$@"

thumbs.sh

-#!/bin/sh
-#############################################################
-# thumbs.sh : generate readable PNG thumbnails to documents #
-#############################################################
-#
-# Creates a directory ./thumbs, and runs evince-thumbnail on each
-# document in the current directory.
-#
-# Example: 
-#
-# $ ~/bin/thumb.sh
-# /usr/bin/evince-thumbnailer -s 900 MyDocument.pdf thumbs/MyDocument.pdf.png
-# ...
-#
-size=900
-thumbnailer=`which evince-thumbnailer`
-if [ -z $thumbnailer ]; then
-    echo "Can't find evince-thumbnailer! Are you sure it's in your PATH?"
-else
-    if [ ! -d $PWD/thumbs ]; then 
-	echo "Creating ./thumbs"
-	mkdir thumbs
-    fi
-    ls *.pdf *.ps *.djvu | xargs -n1 -t -I yos -- $thumbnailer -s $size yos thumbs/yos.png  
-fi

tmux.sh

-#!/bin/sh
-
-if $(tmux has-session); then
-    tmux attach-session
-else tmux new-session
-fi

wallrotate.rb

-#!/usr/bin/ruby
-############################################################
-# Simple wallpaper-rotation script. You can run it in cron.#
-############################################################
-#
-# Defaulting parameters which can be specified at the CLI
-#
-walldir = ARGV[0] || "/home/michael/Wallpapers/"
-#
-# Selects proper wallpaper randomly from the images in the directory
-#
-srand
-wallpaper = Dir[walldir + "*.{jpg,png,jpeg,gif,BMP,bmp}"].choice
-#
-# Now it actually sets the wallpaper
-#
-%x{ gconftool-2 --type string --set /desktop/gnome/background/picture_filename "#{ wallpaper }" } unless wallpaper.empty?