mirror of
https://github.com/NaomiAmethyst/dots.git
synced 2025-08-31 22:08:34 +00:00
Merge branch 'master' of gitosis@majnematic.com:davesdots
Conflicts: bashrc commonsh/02_term commonsh/10_alias commonsh/10_rlwrap
This commit is contained in:
commit
2f7f5c16ef
27 changed files with 340 additions and 85 deletions
|
@ -1,3 +1,3 @@
|
|||
for file in /etc/bash_completion /opt/local/etc/bash_completion ; do
|
||||
[ -f ${file} ] && source $file && break
|
||||
[ -f ${file} ] && . $file && break
|
||||
done
|
||||
|
|
2
bash/git
2
bash/git
|
@ -1,3 +1,3 @@
|
|||
if [ -x /usr/local/git/contrib/completion/git-completion.bash ]; then
|
||||
source /usr/local/git/contrib/completion/git-completion.bash
|
||||
. /usr/local/git/contrib/completion/git-completion.bash
|
||||
fi
|
||||
|
|
|
@ -12,12 +12,12 @@ function do_prompt ()
|
|||
fi
|
||||
export PS1="\[\033[01;32m\]\u@\h \[\033[01;34m\]\w ${ERROR_PROMPT}${BASE} \[\033[00m\]"
|
||||
|
||||
[[ $TERM != "cons*" ]] && [[ $TERM != "linux" ]] &&
|
||||
[[ $TERM != cons* ]] && [ $TERM != linux ] &&
|
||||
echo -ne "\033]0;${USER}@${HOSTNAME}\007"
|
||||
}
|
||||
|
||||
|
||||
PROMPT_COMMAND=do_prompt
|
||||
|
||||
[[ $TERM != "cons*" ]] && [[ $TERM != "linux" ]] &&
|
||||
[[ $TERM != cons* ]] && [ $TERM != linux ] &&
|
||||
trap 'echo -e "\e]1;${USER}@${HOSTNAME}: $BASH_COMMAND\007\c"' DEBUG
|
||||
|
|
8
bashrc
8
bashrc
|
@ -3,14 +3,14 @@
|
|||
# If not running interactively, don't do anything
|
||||
[ -z "$PS1" ] && return
|
||||
|
||||
if [[ -d "${HOME}/.commonsh" ]] ; then
|
||||
if [ -d "${HOME}/.commonsh" ] ; then
|
||||
for file in "${HOME}"/.commonsh/* ; do
|
||||
source $file
|
||||
. $file
|
||||
done
|
||||
fi
|
||||
|
||||
if [[ -d "${HOME}/.bash" ]] ; then
|
||||
if [ -d "${HOME}/.bash" ] ; then
|
||||
for file in "${HOME}"/.bash/* ; do
|
||||
source $file
|
||||
. $file
|
||||
done
|
||||
fi
|
||||
|
|
|
@ -1,25 +1,27 @@
|
|||
if [[ -d /opt/local/man ]] ; then
|
||||
if [[ -z "${MANPATH}" ]] ; then
|
||||
MANPATH="/opt/local/man":$(manpath)
|
||||
#! /bin/sh
|
||||
|
||||
if [ -d /opt/local/man ] ; then
|
||||
if [ -z "${MANPATH}" ] ; then
|
||||
MANPATH="/opt/local/man":`manpath`
|
||||
else
|
||||
MANPATH="/opt/local/man:${MANPATH}"
|
||||
fi
|
||||
export MANPATH
|
||||
fi
|
||||
|
||||
if [[ -d /opt/local/bin ]] ; then
|
||||
if [[ -z "${PATH}" ]] ; then
|
||||
if [ -d /opt/local/bin ] ; then
|
||||
if [ -z "${PATH}" ] ; then
|
||||
PATH="/opt/local/bin"
|
||||
else
|
||||
PATH="/opt/local/bin:${PATH}"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ -d /opt/local/sbin ]] ; then
|
||||
if [ -d /opt/local/sbin ] ; then
|
||||
PATH="/opt/local/sbin:${PATH}"
|
||||
fi
|
||||
|
||||
if [[ -d /opt/local/libexec ]] ; then
|
||||
if [ -d /opt/local/libexec ] ; then
|
||||
PATH="/opt/local/libexec:${PATH}"
|
||||
fi
|
||||
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
#! /bin/sh
|
||||
|
||||
# terminal fallback stuff
|
||||
function fix_term ()
|
||||
fix_term ()
|
||||
{
|
||||
if (infocmp $1 &> /dev/null) ; then
|
||||
if (infocmp $1 > /dev/null 2>&1) ; then
|
||||
echo $1
|
||||
else
|
||||
case $1 in
|
||||
|
@ -38,12 +40,14 @@ function fix_term ()
|
|||
}
|
||||
|
||||
# sorta hacky, but I cannot find a better way to do this :/
|
||||
function fix_terminfo_db ()
|
||||
fix_terminfo_db ()
|
||||
{
|
||||
if [[ `type -p infocmp` = "$1/bin/infocmp" ]] ; then
|
||||
export TERMINFO="$1/share/terminfo"
|
||||
if [ `command -v infocmp 2>/dev/null` = "$1/bin/infocmp" ] ; then
|
||||
TERMINFO="$1/share/terminfo"
|
||||
export TERMINFO
|
||||
fi
|
||||
}
|
||||
|
||||
# terminal surgery
|
||||
case `uname -s` in
|
||||
Interix)
|
||||
|
@ -52,12 +56,25 @@ case `uname -s` in
|
|||
SunOS)
|
||||
fix_terminfo_db "/opt/csw"
|
||||
;;
|
||||
Darwin)
|
||||
fix_terminfo_db "/opt/local"
|
||||
;;
|
||||
esac
|
||||
|
||||
export TERM=$(fix_term $TERM)
|
||||
TERM=`fix_term $TERM`
|
||||
|
||||
if [[ $TERM == *256* ]] ; then
|
||||
SCREEN_TERM=$(fix_term screen-256color-bce)
|
||||
alias screen="screen -T ${SCREEN_TERM}"
|
||||
# I am sorry to hear that you are running an
|
||||
# xterm that has no colors (I am looking at you solaris)
|
||||
if [ $TERM = xterm ] && (type -p tput > /dev/null 2>&1) && [ `tput -T xterm colors` = -1 ] ; then
|
||||
# lets see what we can do about your terrible term
|
||||
TERM=`fix_term xterm-color`
|
||||
fi
|
||||
|
||||
export TERM
|
||||
|
||||
case $TERM in
|
||||
*256*)
|
||||
SCREEN_TERM=$(fix_term screen-256color-bce)
|
||||
alias screen="screen -T ${SCREEN_TERM}"
|
||||
;;
|
||||
esac
|
||||
|
|
|
@ -1,18 +1,23 @@
|
|||
#! /bin/sh
|
||||
# colors
|
||||
for dircolors in gdircolors dircolors ; do
|
||||
if (type -p $dircolors &> /dev/null) ; then
|
||||
[ -f /etc/DIR_COLORS ] && eval $($dircolors -b /etc/DIR_COLORS) && break
|
||||
[ -f "${HOME}/.dir_colors" ] && eval $($dircolors -b "${HOME}/.dir_colors") && break
|
||||
eval $($dircolors -b) && break
|
||||
if (command -v $dircolors > /dev/null 2>&1) ; then
|
||||
[ -f "${HOME}/.dir_colors" ] && eval `$dircolors -b "${HOME}/.dir_colors"` && break
|
||||
[ -f /etc/DIR_COLORS ] && eval `$dircolors -b /etc/DIR_COLORS` && break
|
||||
eval `$dircolors -b` && break
|
||||
fi
|
||||
done
|
||||
|
||||
# gimmie an editor, make it a nice vi clone
|
||||
for EDITOR in vim elvis vile nvi vi ; do
|
||||
(type -p $EDITOR &> /dev/null) && break
|
||||
(command -v $EDITOR > /dev/null 2>&1) && break
|
||||
done
|
||||
export EDITOR
|
||||
|
||||
# make the history editor the editor we want
|
||||
FCEDIT=$EDITOR
|
||||
export $FCEDIT
|
||||
|
||||
# aliases
|
||||
alias cd..='cd ..'
|
||||
|
||||
|
@ -23,7 +28,8 @@ case `uname -s` in
|
|||
alias grep='grep -d skip --color=auto'
|
||||
;;
|
||||
FreeBSD|Darwin|DragonFly)
|
||||
export LSCOLORS=ExGxFxDxCxDxDxHbaDacec
|
||||
LSCOLORS=ExGxFxDxCxDxDxHbaDacec
|
||||
export LSCOLORS
|
||||
alias ls="ls -Gh"
|
||||
alias grep='grep -d skip --color=auto'
|
||||
;;
|
||||
|
@ -31,7 +37,7 @@ case `uname -s` in
|
|||
alias ls="ls --color"
|
||||
;;
|
||||
SunOS)
|
||||
if (type -p gls &> /dev/null) ; then
|
||||
if (command -v gls > /dev/null 2>&1) ; then
|
||||
alias ls="gls -h --color=auto"
|
||||
else
|
||||
# you have a GNU ls, surprise...
|
||||
|
@ -45,7 +51,7 @@ case `uname -s` in
|
|||
esac
|
||||
fi
|
||||
|
||||
if (type -p ggrep &> /dev/null) ; then
|
||||
if (command -v ggrep > /dev/null 2>&1) ; then
|
||||
alias grep='ggrep -d skip --color=auto'
|
||||
else
|
||||
# woah, you have a GNU grep...
|
||||
|
@ -57,7 +63,7 @@ case `uname -s` in
|
|||
fi
|
||||
|
||||
for locate in glocate slocate ; do
|
||||
(type -p $locate &> /dev/null) && alias locate=$locate && break
|
||||
(command -v $locate > /dev/null 2>&1) && alias locate=$locate
|
||||
done
|
||||
;;
|
||||
esac
|
||||
|
@ -67,4 +73,4 @@ alias du='du -h'
|
|||
|
||||
alias ping='ping -c4'
|
||||
|
||||
(type -p time &> /dev/null) && alias time='command time'
|
||||
(command -v time > /dev/null 2>&1) && alias time='command time'
|
||||
|
|
|
@ -1,21 +1,23 @@
|
|||
if [[ -d /usr/local/git/man ]] ; then
|
||||
if [[ -z "${MANPATH}" ]] ; then
|
||||
MANPATH="/usr/local/git/man":$(manpath)
|
||||
#! /bin/sh
|
||||
|
||||
if [ -d /usr/local/git/man ] ; then
|
||||
if [ -z "${MANPATH}" ] ; then
|
||||
MANPATH="/usr/local/git/man":`manpath`
|
||||
else
|
||||
MANPATH="/usr/local/git/man:${MANPATH}"
|
||||
fi
|
||||
export MANPATH
|
||||
fi
|
||||
|
||||
if [[ -d /usr/local/git/bin ]] ; then
|
||||
if [[ -z "${PATH}" ]] ; then
|
||||
if [ -d /usr/local/git/bin ] ; then
|
||||
if [ -z "${PATH}" ] ; then
|
||||
PATH="/usr/local/git/bin"
|
||||
else
|
||||
PATH="/usr/local/git/bin:${PATH}"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ -d /usr/local/git/libexec/git-core ]] ; then
|
||||
if [ -d /usr/local/git/libexec/git-core ] ; then
|
||||
PATH="/usr/local/git/libexec/git-core:${PATH}"
|
||||
fi
|
||||
|
||||
|
|
|
@ -1,17 +1,23 @@
|
|||
for PAGER in less more pg ; do
|
||||
(type -p $PAGER &> /dev/null) && break
|
||||
(command -v $PAGER > /dev/null 2>&1) && break
|
||||
done
|
||||
export PAGER
|
||||
|
||||
# if we are in less, we can set some options and use lesspipe
|
||||
if [[ $PAGER = "less" ]] ; then
|
||||
# lesspipe can go by either lesspipe or lesspipe.sh
|
||||
if [ $PAGER = less ] ; then
|
||||
for lesspipe in lesspipe lesspipe.sh ; do
|
||||
if (type -p $lesspipe &> /dev/null) ; then
|
||||
eval $(SHELL=/bin/sh $lesspipe) && break
|
||||
lesspipe_test=`command -v ${lesspipe} 2>/dev/null`
|
||||
if [ -n $lesspipe_test ] ; then
|
||||
LESSOPEN="| ${lesspipe_test} %s" && break
|
||||
export LESSOPEN
|
||||
fi
|
||||
done
|
||||
if [ $lesspipe = lesspipe ] ; then
|
||||
LESSCLOSE="${lesspipe_test} %s %s"
|
||||
export LESSCLOSE
|
||||
fi
|
||||
|
||||
# let less be case insensitive
|
||||
export LESS='-i -R -M'
|
||||
LESS='-R -M'
|
||||
export LESS
|
||||
fi
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#! /bin/sh
|
||||
for wrap in rlwrap rlfe cle ; do
|
||||
(type -p $wrap > /dev/null 2>&1) && alias ocaml="$wrap ocaml" && break
|
||||
(command -v $wrap > /dev/null 2>&1) && alias ocaml="$wrap ocaml" && break
|
||||
done
|
||||
|
|
|
@ -1,15 +1,16 @@
|
|||
#! /bin/sh
|
||||
# utility.sh
|
||||
# Miscellaneous Utility Functions
|
||||
|
||||
function unkey-host ()
|
||||
unkey_host ()
|
||||
{
|
||||
[ ${#} -ne 1 ] && return 1
|
||||
sed -i -e "/$1/d" $HOME/.ssh/known_hosts
|
||||
}
|
||||
|
||||
function mkcd ()
|
||||
mkcd ()
|
||||
{
|
||||
if [[ -d "$1" ]] ; then
|
||||
if [ -d "$1" ] ; then
|
||||
cd "$1"
|
||||
return
|
||||
fi
|
||||
|
@ -17,16 +18,14 @@ function mkcd ()
|
|||
mkdir -p "$1" && cd "$1"
|
||||
}
|
||||
|
||||
function extract ()
|
||||
extract ()
|
||||
{
|
||||
if [[ ! -f "$1" ]] ; then
|
||||
if [ ! -f "$1" ] ; then
|
||||
echo "The file ("$1") does not exist!"
|
||||
return
|
||||
fi
|
||||
|
||||
local filename
|
||||
|
||||
filename=$(echo "$1" | tr '[:upper:]' '[:lower:]')
|
||||
filename=`echo "$1" | tr '[:upper:]' '[:lower:]'`
|
||||
|
||||
case "$filename" in
|
||||
*.tar)
|
||||
|
@ -42,10 +41,10 @@ function extract ()
|
|||
unzip -qo "${1}"
|
||||
;;
|
||||
*.gz|*.z)
|
||||
gzip -dc "${1}" > $(basename "${1%.*}")
|
||||
gzip -dc "${1}" > `basename "${1%.*}"`
|
||||
;;
|
||||
*.bz2)
|
||||
bzip2 -dc "${1}" > $(basename "${1%.*}")
|
||||
bzip2 -dc "${1}" > `basename "${1%.*}"`
|
||||
;;
|
||||
*.rar)
|
||||
unrar x -idq "${1}"
|
||||
|
@ -60,7 +59,7 @@ function extract ()
|
|||
lzma -dc "${1}" | tar xf
|
||||
;;
|
||||
*.lzma)
|
||||
lzma -dc "${1}" > $(basename "${1%.*}")
|
||||
lzma -dc "${1}" > `basename "${1%.*}"`
|
||||
;;
|
||||
*)
|
||||
echo "Unable to extract '"$1"'"
|
||||
|
|
170
dir_colors
Normal file
170
dir_colors
Normal file
|
@ -0,0 +1,170 @@
|
|||
# Configuration file for dircolors, a utility to help you set the
|
||||
# LS_COLORS environment variable used by GNU ls with the --color option.
|
||||
# Copyright (C) 1996, 1999-2008
|
||||
# Free Software Foundation, Inc.
|
||||
# Copying and distribution of this file, with or without modification,
|
||||
# are permitted provided the copyright notice and this notice are preserved.
|
||||
# The keywords COLOR, OPTIONS, and EIGHTBIT (honored by the
|
||||
# slackware version of dircolors) are recognized but ignored.
|
||||
# Below, there should be one TERM entry for each termtype that is colorizable
|
||||
TERM Eterm
|
||||
TERM ansi
|
||||
TERM color-xterm
|
||||
TERM con132x25
|
||||
TERM con132x30
|
||||
TERM con132x43
|
||||
TERM con132x60
|
||||
TERM con80x25
|
||||
TERM con80x28
|
||||
TERM con80x30
|
||||
TERM con80x43
|
||||
TERM con80x50
|
||||
TERM con80x60
|
||||
TERM cons25
|
||||
TERM console
|
||||
TERM cygwin
|
||||
TERM dtterm
|
||||
TERM eterm-color
|
||||
TERM gnome
|
||||
TERM gnome-256color
|
||||
TERM konsole
|
||||
TERM kterm
|
||||
TERM linux
|
||||
TERM linux-c
|
||||
TERM mach-color
|
||||
TERM mlterm
|
||||
TERM putty
|
||||
TERM rxvt
|
||||
TERM rxvt-cygwin
|
||||
TERM rxvt-cygwin-native
|
||||
TERM rxvt-unicode
|
||||
TERM screen
|
||||
TERM screen-256color
|
||||
TERM screen-bce
|
||||
TERM screen-w
|
||||
TERM screen.linux
|
||||
TERM vt100
|
||||
TERM xterm
|
||||
TERM xterm-16color
|
||||
TERM xterm-256color
|
||||
TERM xterm-88color
|
||||
TERM xterm-color
|
||||
TERM xterm-debian
|
||||
# Below are the color init strings for the basic file types. A color init
|
||||
# string consists of one or more of the following numeric codes:
|
||||
# Attribute codes:
|
||||
# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed
|
||||
# Text color codes:
|
||||
# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white
|
||||
# Background color codes:
|
||||
# 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white
|
||||
NORMAL 00 # global default, although everything should be something.
|
||||
FILE 00 # normal file
|
||||
DIR 01;34 # directory
|
||||
LINK 01;36 # symbolic link. (If you set this to 'target' instead of a
|
||||
# numerical value, the color is as for the file pointed to.)
|
||||
FIFO 40;33 # pipe
|
||||
SOCK 01;35 # socket
|
||||
DOOR 01;35 # door
|
||||
BLK 40;33;01 # block device driver
|
||||
CHR 40;33;01 # character device driver
|
||||
ORPHAN 40;31;01 # symlink to nonexistent file, or non-stat'able file
|
||||
# SETUID 37;41 # file that is setuid (u+s)
|
||||
# SETGID 30;43 # file that is setgid (g+s)
|
||||
# STICKY_OTHER_WRITABLE 30;42 # dir that is sticky and other-writable (+t,o+w)
|
||||
# OTHER_WRITABLE 34;42 # dir that is other-writable (o+w) and not sticky
|
||||
# STICKY 37;44 # dir with the sticky bit set (+t) and not other-writable
|
||||
# This is for files with execute permission:
|
||||
EXEC 01;32
|
||||
# List any file extensions like '.gz' or '.tar' that you would like ls
|
||||
# to colorize below. Put the extension, a space, and the color init string.
|
||||
# (and any comments you want to add after a '#')
|
||||
# If you use DOS-style suffixes, you may want to uncomment the following:
|
||||
.cmd 01;32 # executables (bright green)
|
||||
.exe 01;32
|
||||
.com 01;32
|
||||
.btm 01;32
|
||||
.bat 01;32
|
||||
# Or if you want to colorize scripts even if they do not have the
|
||||
# executable bit actually set.
|
||||
#.sh 01;32
|
||||
#.csh 01;32
|
||||
# archives or compressed (bright red)
|
||||
.tar 01;31
|
||||
.tgz 01;31
|
||||
.svgz 01;31
|
||||
.arj 01;31
|
||||
.taz 01;31
|
||||
.lzh 01;31
|
||||
.lzma 01;31
|
||||
.zip 01;31
|
||||
.z 01;31
|
||||
.Z 01;31
|
||||
.dz 01;31
|
||||
.gz 01;31
|
||||
.bz2 01;31
|
||||
.bz 01;31
|
||||
.tbz2 01;31
|
||||
.tz 01;31
|
||||
.deb 01;31
|
||||
.rpm 01;31
|
||||
.jar 01;31
|
||||
.rar 01;31
|
||||
.ace 01;31
|
||||
.zoo 01;31
|
||||
.cpio 01;31
|
||||
.7z 01;31
|
||||
.rz 01;31
|
||||
# image formats
|
||||
.jpg 01;35
|
||||
.jpeg 01;35
|
||||
.gif 01;35
|
||||
.bmp 01;35
|
||||
.pbm 01;35
|
||||
.pgm 01;35
|
||||
.ppm 01;35
|
||||
.tga 01;35
|
||||
.xbm 01;35
|
||||
.xpm 01;35
|
||||
.tif 01;35
|
||||
.tiff 01;35
|
||||
.png 01;35
|
||||
.svg 01;35
|
||||
.mng 01;35
|
||||
.pcx 01;35
|
||||
.mov 01;35
|
||||
.mpg 01;35
|
||||
.mpeg 01;35
|
||||
.m2v 01;35
|
||||
.mkv 01;35
|
||||
.ogm 01;35
|
||||
.mp4 01;35
|
||||
.m4v 01;35
|
||||
.mp4v 01;35
|
||||
.vob 01;35
|
||||
.qt 01;35
|
||||
.nuv 01;35
|
||||
.wmv 01;35
|
||||
.asf 01;35
|
||||
.rm 01;35
|
||||
.rmvb 01;35
|
||||
.flc 01;35
|
||||
.avi 01;35
|
||||
.fli 01;35
|
||||
.gl 01;35
|
||||
.dl 01;35
|
||||
.xcf 01;35
|
||||
.xwd 01;35
|
||||
.yuv 01;35
|
||||
# audio formats
|
||||
.aac 00;36
|
||||
.au 00;36
|
||||
.flac 00;36
|
||||
.mid 00;36
|
||||
.midi 00;36
|
||||
.mka 00;36
|
||||
.mp3 00;36
|
||||
.mpc 00;36
|
||||
.ogg 00;36
|
||||
.ra 00;36
|
||||
.wav 00;36
|
|
@ -39,6 +39,7 @@ unless(eval {symlink('', ''); 1;}) {
|
|||
my %links = (
|
||||
screenrc => '.screenrc',
|
||||
toprc => '.toprc',
|
||||
dir_colors => '.dir_colors',
|
||||
lessfilter => '.lessfilter',
|
||||
|
||||
vim => '.vim',
|
||||
|
@ -56,6 +57,13 @@ my %links = (
|
|||
zsh => '.zsh',
|
||||
zshrc => '.zshrc',
|
||||
|
||||
ksh => '.ksh',
|
||||
kshrc => '.kshrc',
|
||||
mkshrc => '.mkshrc',
|
||||
|
||||
sh => '.sh',
|
||||
shinit => '.shinit',
|
||||
|
||||
Xdefaults => '.Xdefaults',
|
||||
Xresources => '.Xresources',
|
||||
|
||||
|
|
4
ksh/options
Executable file
4
ksh/options
Executable file
|
@ -0,0 +1,4 @@
|
|||
set -o emacs
|
||||
|
||||
HISTSIZE=1000
|
||||
export HISTSIZE
|
9
ksh/prompt
Executable file
9
ksh/prompt
Executable file
|
@ -0,0 +1,9 @@
|
|||
if [ $USER = root ] ; then
|
||||
BASE="#"
|
||||
else
|
||||
BASE="$"
|
||||
fi
|
||||
|
||||
|
||||
PS1=$'\E[01;32m'"${USER} "$'\E[01;34m''$PWD'" ${BASE} "$'\E[0m'
|
||||
export PS1
|
11
kshrc
Normal file
11
kshrc
Normal file
|
@ -0,0 +1,11 @@
|
|||
if [ -d "${HOME}/.commonsh" ] ; then
|
||||
for file in "${HOME}"/.commonsh/* ; do
|
||||
. $file
|
||||
done
|
||||
fi
|
||||
|
||||
if [ -d "${HOME}/.ksh" ] ; then
|
||||
for file in "${HOME}"/.ksh/* ; do
|
||||
. $file
|
||||
done
|
||||
fi
|
|
@ -1,4 +1,4 @@
|
|||
#!/bin/sh
|
||||
#! /bin/sh
|
||||
# Decode file for less
|
||||
case `echo "$1" | tr '[:upper:]' '[:lower:]'` in
|
||||
# we don't handle archives, we let the big guy do it
|
||||
|
|
1
mkshrc
Symbolic link
1
mkshrc
Symbolic link
|
@ -0,0 +1 @@
|
|||
shinit
|
8
sh/title
Normal file
8
sh/title
Normal file
|
@ -0,0 +1,8 @@
|
|||
if [ $USER = root ] ; then
|
||||
BASE="#"
|
||||
else
|
||||
BASE="$"
|
||||
fi
|
||||
|
||||
PS1="${USER} ${BASE} "
|
||||
export PS1
|
11
shinit
Normal file
11
shinit
Normal file
|
@ -0,0 +1,11 @@
|
|||
if [ -d "${HOME}/.commonsh" ] ; then
|
||||
for file in "${HOME}"/.commonsh/* ; do
|
||||
. $file
|
||||
done
|
||||
fi
|
||||
|
||||
if [ -d "${HOME}/.sh" ] ; then
|
||||
for file in "${HOME}"/.sh/* ; do
|
||||
. $file
|
||||
done
|
||||
fi
|
19
xmonad.hs
19
xmonad.hs
|
@ -1,8 +1,7 @@
|
|||
import XMonad
|
||||
|
||||
import XMonad.Layout
|
||||
import XMonad.Layout.Grid
|
||||
import XMonad.Layout.NoBorders
|
||||
import XMonad.Layout.NoBorders(smartBorders)
|
||||
|
||||
import XMonad.Hooks.DynamicLog
|
||||
import XMonad.Hooks.ManageDocks
|
||||
|
@ -11,10 +10,9 @@ import XMonad.Util.Run(spawnPipe)
|
|||
import XMonad.Util.EZConfig(additionalKeys)
|
||||
|
||||
import XMonad.Prompt
|
||||
import XMonad.Prompt.Shell
|
||||
import XMonad.Prompt.Ssh
|
||||
import XMonad.Prompt.Shell(shellPrompt)
|
||||
|
||||
import System.IO
|
||||
import System.IO(hPutStrLn)
|
||||
|
||||
myLayoutHook = tiled ||| Mirror tiled ||| Grid ||| Full
|
||||
where
|
||||
|
@ -30,6 +28,8 @@ myLayoutHook = tiled ||| Mirror tiled ||| Grid ||| Full
|
|||
-- Percent of screen to increment by when resizing panes
|
||||
delta = 3/100
|
||||
|
||||
myModMask = mod1Mask
|
||||
|
||||
main = do
|
||||
xmproc <- spawnPipe "xmobar"
|
||||
xmonad $ defaultConfig {
|
||||
|
@ -38,9 +38,10 @@ main = do
|
|||
logHook = dynamicLogWithPP $ xmobarPP {
|
||||
ppOutput = hPutStrLn xmproc,
|
||||
ppTitle = xmobarColor "green" ""
|
||||
}
|
||||
} `additionalKeys`
|
||||
},
|
||||
modMask = myModMask
|
||||
} `additionalKeys`
|
||||
[
|
||||
((mod1Mask, xK_o), shellPrompt defaultXPConfig { position = Top }),
|
||||
((mod1Mask, xK_b), sendMessage ToggleStruts)
|
||||
((myModMask, xK_o), shellPrompt defaultXPConfig { position = Top }),
|
||||
((myModMask, xK_b), sendMessage ToggleStruts)
|
||||
]
|
||||
|
|
|
@ -44,7 +44,7 @@ case `uname -s` in
|
|||
zstyle ':completion:*:processes-names' command 'ps -e -o args | awk "NR != 1"'
|
||||
;;
|
||||
Darwin)
|
||||
if [[ $(sw_vers -productVersion) > 10.4 ]] ; then
|
||||
if [[ `sw_vers -productVersion` = 10<5->.<-> ]] ; then
|
||||
zstyle ':completion:*:processes-names' command 'ps -e -o command | awk "NR != 1"'
|
||||
else
|
||||
zstyle ':completion:*:processes-names' command 'ps -A -o command | awk "NR != 1"'
|
||||
|
@ -81,7 +81,7 @@ case `uname -s` in
|
|||
zstyle ':completion:*:*:killall:*:processes-names' command "ps -u '${USERNAME}' -s"
|
||||
;;
|
||||
Darwin)
|
||||
if [[ $(sw_vers -productVersion) > 10.4 ]] ; then
|
||||
if [[ `sw_vers -productVersion` = 10<5->.<-> ]] ; then
|
||||
zstyle ':completion:*:*:killall:*:processes-names' command "ps -U '${USERNAME}' -o comm"
|
||||
else
|
||||
zstyle ':completion:*:*:killall:*:processes-names' command "ps -U '${USERNAME}' -o command"
|
||||
|
|
8
zsh/icc
8
zsh/icc
|
@ -1,7 +1,7 @@
|
|||
local iccvars_path;
|
||||
if [[ -d "/opt/intel/Compiler" ]] ; then
|
||||
if [ -d "/opt/intel/Compiler" ] ; then
|
||||
iccvars_path=$(echo /opt/intel/Compiler/11.*/*/bin/iccvars.sh(On[1]))
|
||||
if [[ -r $iccvars_path ]] ; then
|
||||
if [ -r $iccvars_path ] ; then
|
||||
case `uname -m` in
|
||||
x86_64)
|
||||
source $iccvars_path intel64
|
||||
|
@ -14,9 +14,9 @@ if [[ -d "/opt/intel/Compiler" ]] ; then
|
|||
;;
|
||||
esac
|
||||
fi
|
||||
elif [[ -d "/opt/intel/cc" ]] || [[ -d "/opt/intel/cce" ]] ; then
|
||||
elif [ -d "/opt/intel/cc" ] || [ -d "/opt/intel/cce" ] ; then
|
||||
iccvars_path=$(echo /opt/intel/cc*/(10|9).*/bin/iccvars.sh(On[1]))
|
||||
if [[ -r $iccvars_path ]] ; then
|
||||
if [ -r $iccvars_path ] ; then
|
||||
source $iccvars_path
|
||||
fi
|
||||
fi
|
||||
|
|
|
@ -41,4 +41,3 @@ setopt HIST_IGNORE_ALL_DUPS
|
|||
|
||||
unsetopt HIST_BEEP
|
||||
unsetopt EXTENDED_HISTORY
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# prompt
|
||||
if [[ -z ${SSH_TTY} ]] ; then
|
||||
if [ -z ${SSH_TTY} ] ; then
|
||||
PROMPT=$'%{\e[01;32m%}%n@%m %{\e[01;34m%}%~ %(?..%{\e[01;31m%})%(!.#.$) %{\e[00;00m%}'
|
||||
RPROMPT=$'%1(j.%{\e[00;36m%}[%j].)%{\e[01;33m%}[%t]%{\e[00;00m%}'
|
||||
else
|
||||
|
|
|
@ -3,7 +3,7 @@ precmd()
|
|||
{
|
||||
local termtitle
|
||||
|
||||
termtitle=$(print -P "%n@%m")
|
||||
termtitle=`print -P "%n@%m"`
|
||||
title zsh "$termtitle"
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,7 @@ preexec()
|
|||
|
||||
# Prepend this string to the title.
|
||||
# termtitle=$(print -P "%(!.-=*[ROOT]*=- | .)%n@%m:")
|
||||
termtitle=$(print -P "%n@%m:")
|
||||
termtitle=`print -P "%n@%m:"`
|
||||
|
||||
case $cmd[1] in
|
||||
fg)
|
||||
|
|
14
zshrc
14
zshrc
|
@ -8,7 +8,7 @@ autoload -U compinit; compinit -d "${HOME}/.zsh/.zcompdump"
|
|||
autoload -U age
|
||||
autoload -U zmv
|
||||
|
||||
if [[ ${ZSH_VERSION//.} -gt 420 ]] ; then
|
||||
if [ ${ZSH_VERSION//.} -gt 420 ] ; then
|
||||
autoload -U url-quote-magic
|
||||
zle -N self-insert url-quote-magic
|
||||
fi
|
||||
|
@ -22,11 +22,11 @@ export LOGCHECK=30
|
|||
export WATCHFMT=$'\e[01;36m'" -- %n@%m has %(a.Logged In.Logged out) --"$'\e[00;00m'
|
||||
|
||||
# directory hashes
|
||||
if [[ -d "${HOME}/sandbox" ]] ; then
|
||||
if [ -d "${HOME}/sandbox" ] ; then
|
||||
hash -d sandbox="${HOME}/sandbox"
|
||||
fi
|
||||
|
||||
if [[ -d "${HOME}/work" ]] ; then
|
||||
if [ -d "${HOME}/work" ] ; then
|
||||
hash -d work="${HOME}/work"
|
||||
|
||||
for dir in "${HOME}"/work/*(N-/) ; do
|
||||
|
@ -35,15 +35,15 @@ if [[ -d "${HOME}/work" ]] ; then
|
|||
fi
|
||||
|
||||
# common shell utils
|
||||
if [[ -d "${HOME}/.commonsh" ]] ; then
|
||||
if [ -d "${HOME}/.commonsh" ] ; then
|
||||
for file in "${HOME}"/.commonsh/*(N.x:t) ; do
|
||||
source "${HOME}/.commonsh/${file}"
|
||||
. "${HOME}/.commonsh/${file}"
|
||||
done
|
||||
fi
|
||||
|
||||
# extras
|
||||
if [[ -d "${HOME}/.zsh" ]] ; then
|
||||
if [ -d "${HOME}/.zsh" ] ; then
|
||||
for file in "${HOME}"/.zsh/*(N.x:t) ; do
|
||||
source "${HOME}/.zsh/${file}"
|
||||
. "${HOME}/.zsh/${file}"
|
||||
done
|
||||
fi
|
||||
|
|
Loading…
Add table
Reference in a new issue