Thursday, June 7. 2007
Downloadbereich
#Based on http://www.michael-prokop.at/computer/config/.zshrc + others
PROMPT=$'%n@%m %0(3c,%c,%~) %0(?,%{\e[0;32m%}:%),%{\e[0;31m%}:(%s)%b %# '
type compinit &>/dev/null || { autoload -U compinit && compinit }
export COLORTERM="yes"
alias -g C='|wc -l'
alias -g M='| more'
alias -g G='| grep'
alias -g dt='dmesg | tail'
alias -g T='| tail'
alias -g N='&>/dev/null'
alias 'mbox'='screen -x mbox'
# Xterm resizing-fu.
# Based on http://svn.kitenet.net/trunk/home-full/.zshrc?rev=11710&view=log (by Joey Hess)
alias hide='echo -en "\033]50;nil2\007"'
alias tiny='echo -en "\033]50;-misc-fixed-medium-r-normal-*--80-*--c-*-iso8859-15\007"'
alias small='echo -en "\033]50;6x10\007"'
alias medium='echo -en "\033]50;-misc-fixed-medium-r-normal--13-120-75-75-c-80-iso8859-15\007"'
alias default='echo -e "\033]50;-misc-fixed-medium-r-normal-*--140-*--c-*-iso8859-15\007"'
alias large='echo -en "\033]50;-misc-fixed-medium-r-normal-*--150-*--c-*-iso8859-15\007"'
alias huge='echo -en "\033]50;-misc-fixed-medium-r-normal-*--210-*--c-*-iso8859-15\007"'
alias smartfont='echo -en "\033]50;-artwiz-smoothansi-*--*--*--*--*--*-\007"'
alias semifont='echo -en "\033]50;-misc-fixed-medium-r-semicondensed-*--120-*--*--iso8859-15\007"'
# listing stuff
alias dir="ls -lSrah"
alias lad='ls -d .*(/)' # only show dot-directories
alias lsa='ls -a .*(.)' # only show dot-files
alias lss='ls -l (s,S,t)' # only files with setgid/setuid/sticky flag
alias lsl='ls -l (@[1,10])' # only symlinks
alias lsx='ls -l (*[1,10])' # only executables
alias lsw='ls -ld (R,W,X.^ND/)' # world-{readable,writable,executable} files
alias lsbig="ls -flh (.OL[1,10])" # display the biggest files
alias lsd='ls -d (/)' # only show directories
alias lse='ls -d (/^F)' # only show empty directories
alias lsnew="ls -rl (D.om[1,10])" # display the newest files
alias lsold="ls -rtlh (D.om[1,10])" # display the oldest files
alias lssmall="ls -Srl (.oL[1,10])" # display the smallest files
mdiff() { diff -udrP "$1" "$2" > diff.`date "+%Y-%m-%d"`."$1" }
memusage(){ ps aux | awk '{if (NR > 1) print $5; if (NR > 2) print "+"} END { print "p" }' | dc }
shtar() { gunzip -c $1 | tar -tf - -- | $PAGER }
shtgz() { tar -ztf $1 | $PAGER }
shzip() { unzip -l $1 | $PAGER }
# list files which have been modified within the last x days
new() { print -l (m-$1) }
# UTF-8 change
isutfenv () {
case "$LANG $CHARSET $LANGUAGE" in
(*utf*) return 0 ;;
(*UTF*) return 0 ;;
(*) return 1 ;;
esac
}
alias term2iso="echo 'Setting terminal to iso mode' ; echo -e '^[%@'"
alias term2utf="echo 'Setting terminal to utf-8 mode'; echo -e '^[%G'"
# alias utf2iso=`if isutfenv ; then
# for ENV in 'env | grep UTF' ; do
# eval export "$(echo $ENV | sed 's/UTF-8/iso885915/')"
# done
# fi`
# alias iso2utf=`if isutfenv ; then
# for ENV in 'env | grep "\.iso"' ; do
# eval export '$(echo $ENV | sed "s/iso.*/UTF-8/")'
# done
# fi`
#if [[ "$TERM" == screen ]]; then
bindkey "\e[1~" beginning-of-line # home
bindkey "^[[4~" end-of-line # End
bindkey "^[[A" up-line-or-search # cursor up
bindkey "^[[B" down-line-or-search # -
bindkey '^x' history-beginning-search-backward # alternative ways of searching the shell history
# bindkey '\e[7~' beginning-of-line # home
# bindkey '\e[8~' end-of-line # end
#fi
fetchmail 1> /dev/null 2>&1
OARK=`ps -ef | grep screen..x.mbox | grep -v grep`
if [ ! "$OARK" ] ; then
#conky -c ~/torsmo/server_info 1> /dev/null 2>&1
conky -c ~/torsmo/icq_msg 1> /dev/null 2>&1
pkill osdsh ; pkill osdctl ; sleep 1 ; osdsh -o 1 -p 1
screen -x mbox
fi
|