grml-etc-core (0.3.41) unstable; urgency=low
- * /etc/zsh/zshrc and /etc/skel/.zshrc:
- - replace $(which ...) with $(type ...)
- - add alias 'g' for git
- - standarized the use of brackets - double instead of single ones -
- for test situations like if-clauses. Thanks for the patch,
- Alexander Steinböck! [Testing: issue354]
+ [ Alexander Steinböck]
+ * zsh: standarized the use of brackets - double instead of
+ single ones - for test situations like if-clauses.
+ [Testing: issue354]
+
+ [ Michael Prokop ]
+ * zsh: add alias 'g' for git
+
+ [ Frank Terbeck ]
+ * zsh: several small cleanups by ft [thanks!]
-- Michael Prokop <mika@grml.org> Sun, 02 Dec 2007 19:54:45 +0100
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"'
-# if [[ "$TERM" = "xterm" ]] && [[ "$LINES" -ge 50 ]] && [[ "$COLUMNS" -ge 100 ]] && [[ -z "$SSH_CONNECTION" ]] ; then
+# if [[ "$TERM" == "xterm" ]] && [[ "$LINES" -ge 50 ]] && [[ "$COLUMNS" -ge 100 ]] && [[ -z "$SSH_CONNECTION" ]] ; then
# large
# fi
isutfenv && [[ -n "$LANG" ]] && alias mrxvt="LANG=${LANG/(#b)(*)[.@]*/$match[1].iso885915} luit mrxvt"
fi
- if [[ -x $(type aterm) ] ; then
+ if [[ -x $(type aterm) ]] ; then
isutfenv && [[ -n "$LANG" ]] && alias aterm="LANG=${LANG/(#b)(*)[.@]*/$match[1].iso885915} luit aterm"
fi
local ans
echo -n "Remove these files? [y/n] "
read -q ans
- if [[ $ans == "y" ]]
- then
+ if [[ $ans == "y" ]] ; then
rm ${FILES}
echo ">> $PWD purged, $NBFILES files removed"
else
#f5# List all occurrences of programm in current PATH
plap() {
- if [[ $# = 0 ]]
- then
+ if [[ $# = 0 ]] ; then
echo "Usage: $0 program"
echo "Example: $0 zsh"
echo "Lists all occurrences of program in the current PATH."
# Usage: simple-extract <file>
#f5# Smart archive extractor
simple-extract () {
- if [[ -f $1 ]]
- then
+ if [[ -f $1 ]] ; then
case $1 in
*.tar.bz2) bzip2 -v -d $1 ;;
*.tar.gz) tar -xvzf $1 ;;
# Usage: smartcompress <file> (<type>)
#f5# Smart archive creator
smartcompress() {
- if [[ $2 ]] ; then
+ if [[ -n $2 ]] ; then
case $2 in
tgz | tar.gz) tar -zcvf$1.$2 $1 ;;
tbz2 | tar.bz2) tar -jcvf$1.$2 $1 ;;
# Usage: show-archive <archive>
#f5# List an archive's content
show-archive() {
- if [[ -f $1 ]]
- then
+ if [[ -f $1 ]] ; then
case $1 in
*.tar.gz) gunzip -c $1 | tar -tf - -- ;;
*.tar) tar -tf $1 ;;
print
wget -T 10 --no-verbose --output-file=$LOG --output-document=$FILE --timestamping http://weather.noaa.gov/pub/data/observations/metar/decoded/$PLACE.TXT
- if [[ $? = 0 ]] ; then
+ if [[ $? -eq 0 ]] ; then
if [[ -n "$VERBOSE" ]] ; then
cat $FILE
else
# some useful commands often hard to remember - let's grep for them {{{
# Work around ion/xterm resize bug.
-#if [[ "$SHLVL" = 1 ]]; then
+#if [[ "$SHLVL" -eq 1 ]]; then
# if [[ -x $(type resize) ]]; then
# eval `resize </dev/null`
# fi
#compdef grml-wallpaper
+local -a dirs
+
dirs=(. /usr/share/grml/)
_description files expl 'set desktop wallpaper on grml system'
_files "$expl[@]" -W dirs -g '*.{jpg,png}(-.)'
-if [ -f /usr/share/grml/"$1" ] ; then
+if [[ -f /usr/share/grml/"$1" ]] ; then
Esetroot -scale /usr/share/grml/"$1"
else
Esetroot -scale "$@"
setopt localoptions nomarkdirs nonomatch nocshnullglob nullglob
kept=() # Erase old value in case of error on next line
kept=($~*)
- if [[ ! -t 0 ]]; then
+ if [[ ! -t 0 ]] ; then
local line
while read line; do
kept+=( $line ) # += is a zsh 4.2+ feature
(( $#kept )) || return 1
local action
zstyle -s :completion:$curcontext insert-kept action
- if [[ -n $action ]]
- then compstate[insert]=$action
- elif [[ $WIDGET = *expand* ]]
- then compstate[insert]=all
+ if [[ -n $action ]] ; then
+ compstate[insert]=$action
+ elif [[ $WIDGET == *expand* ]] ; then
+ compstate[insert]=all
fi
- if [[ $WIDGET = *expand* ]]
- then compadd -U ${(M)kept:#${~words[CURRENT]}}
- else compadd -a kept
+ if [[ $WIDGET == *expand* ]] ; then
+ compadd -U ${(M)kept:#${~words[CURRENT]}}
+ else
+ compadd -a kept
fi
}
function compadd() {
local -A args
zparseopts -E -A args J:
- if [[ $args[-J] == all-expansions ]]
- then
+ if [[ $args[-J] == all-expansions ]] ; then
builtin compadd -A kept "$@"
kept=( ${(Q)${(z)kept}} )
fi
# }}}
# locale setup {{{
- if [[ -n "$LANG" ]] ; then
+ if [[ -n "$LANG" ]] ; then
export LANG
else
[[ -r /etc/default/locale ]] && source /etc/default/locale
# just type 'cd ...' to get 'cd ../..'
# rationalise-dot() {
-# if [[ $LBUFFER = *.. ]] ; then
+# if [[ $LBUFFER == *.. ]] ; then
# LBUFFER+=/..
# else
# LBUFFER+=.
# }}}
# {{{ some aliases
- if [[ $UID = 0 ]] ; then
+ if [[ $UID -eq 0 ]] ; then
[[ -r /etc/grml/screenrc ]] && alias screen='/usr/bin/screen -c /etc/grml/screenrc'
elif [[ -r $HOME/.screenrc ]] ; then
alias screen="/usr/bin/screen -c $HOME/.screenrc"
fi
# do we have GNU ls with color-support?
- if ls --help 2>/dev/null |grep -- --color= >/dev/null && [[ "$TERM" != dumb ]] ; then
+ if ls --help 2>/dev/null | grep -- --color= >/dev/null && [[ "$TERM" != dumb ]] ; then
#a1# execute \kbd{@a@}:\quad ls with colors
alias ls='ls -b -CF --color=auto'
#a1# execute \kbd{@a@}:\quad list all files, with colors
_last_try="$HISTNO$BUFFER$CURSOR"
reply=(_complete _match _ignored _prefix _files)
else
- if [[ $words[1] = (rm|mv) ]] ; then
+ if [[ $words[1] == (rm|mv) ]] ; then
reply=(_complete _files)
else
reply=(_oldlist _expand _force_rehash _complete _ignored _correct _approximate _files)