printf 'GRML_WARN_SKEL=0\n' >>! ~/.zshrc.pre
}
-grml_warn_skel_main
-grml_warn_skel_remove
+# let's try to guess how the user uses us.
+if is-at-least 4.3.7 ; then
+ # funcsourcetrace requires at least version 4.3.7 of zsh.
+ GRML_SRC_FILE="${${funcsourcetrace[1]}%:*}"
+
+ grml_warn_skel_main
+ case ${GRML_SRC_FILE} in
+ (${HOME}/.zshrc.global)
+ grml_warn_skel_remove
+ printf '\nIt looks like you copied the grml zshrc to '\''~/.zshrc.global'\''.\n'
+ printf 'Nowadays you just copy the global zshrc to '\''~/.zshrc'\'' to use\n'
+ printf 'it on a non-grml-system.\n'
+ ;;
+ (${HOME}/.zshrc)
+ printf '\nIt looks like you copied the grml zshrc to '\''~/.zshrc'\''.\n'
+ printf 'We'\''ll disable this warning automatically for later sessions.\n'
+ grml_do_not_warn_skel
+ ;;
+ (*)
+ grml_do_not_warn_skel
+ ;;
+ esac
+else
+ grml_warn_skel_main
+ grml_warn_skel_remove
+fi
unfunction grml_warn_skel_remove grml_warn_skel_main
# }}}
# {{{ some aliases
-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"
-else
- [[ -r /etc/grml/screenrc_grml ]] && alias screen='/usr/bin/screen -c /etc/grml/screenrc_grml'
+if check_com -c screen ; then
+ if [[ $UID -eq 0 ]] ; then
+ [[ -r /etc/grml/screenrc ]] && alias screen="${commands[screen]} -c /etc/grml/screenrc"
+ elif [[ -r $HOME/.screenrc ]] ; then
+ alias screen="${commands[screen]} -c $HOME/.screenrc"
+ else
+ [[ -r /etc/grml/screenrc_grml ]] && alias screen="${commands[screen]} -c /etc/grml/screenrc_grml"
+ fi
fi
# do we have GNU ls with color-support?
zstyle ':completion:*:manuals.*' insert-sections true
zstyle ':completion:*:man:*' menu yes select
+ # provide .. as a completion
+ zstyle ':completion:*' special-dirs ..
+
# run rehash on completion so new installed program are found automatically:
_force_rehash() {
(( CURRENT == 1 )) && rehash
print ""
print "Date..: "$(date "+%Y-%m-%d %H:%M:%S")""
print "Shell.: Zsh $ZSH_VERSION (PID = $$, $SHLVL nests)"
- print "Term..: $TTY ($TERM), $BAUD bauds, $COLUMNS x $LINES cars"
+ print "Term..: $TTY ($TERM), ${BAUD:+$BAUD bauds, }$COLUMNS x $LINES cars"
print "Login.: $LOGNAME (UID = $EUID) on $HOST"
print "System: $(cat /etc/[A-Za-z]*[_-][rv]e[lr]*)"
print "Uptime:$(uptime)"
mkdir -p ${root}/${subdir}/{cur,new,tmp}
}
-# xtrename() rename xterm from within GNU-screen
+#f5# Change the xterm title from within GNU-screen
xtrename() {
- if [[ -z ${DISPLAY} ]] ; then
- printf 'xtrename only makes sense in X11.\n'
- return 1
+ if [[ ${1} != "-f" ]] ; then
+ if [[ -z ${DISPLAY} ]] ; then
+ printf 'xtrename only makes sense in X11.\n'
+ return 1
+ fi
+ else
+ shift
fi
if [[ -z ${1} ]] ; then
- printf 'usage: xtrename() "title for xterm"\n'
+ printf 'usage: xtrename [-f] "title for xterm"\n'
printf ' renames the title of xterm from _within_ screen.\n'
- printf ' Also works without screen.\n'
+ printf ' also works without screen.\n'
+ printf ' will not work if DISPLAY is unset, use -f to override.\n'
return 0
fi
print -n "\eP\e]0;${1}\C-G\e\\"