# precmd() call.
window_reset=yes
# Is set to a non empty value when the shell is running as root.
- if [[ $(id -u) -eq 0 ]]; then
+ if [[ $UID -eq 0 ]]; then
window_root=yes
fi
# Ignore often used commands which are only running for a very short
# time. This prevents a "blinking" name when it's changed to "cd" for
# example and then some milliseconds later back to "zsh".
- [[ $program_name == (cd*|ls|la|ll|clear|c) ]] && return
+ [[ $program_name == (cd*|d|ls|l|la|ll|clear|c) ]] && return
# Change my shortcuts so the real name of the program is displayed.
case $program_name in
# If screen is running in SSH then display "@:hostname" as title
# in the term/outer screen.
if [[ $program_name == @screen ]]; then
- program_name="@:${$(hostname)//.*/}"
+ program_name="@:${HOST//.*/}"
# Use "@:!hostname" for root screens.
elif [[ $program_name == @!screen ]]; then
- program_name="@:!${$(hostname)//.*/}"
+ program_name="@:!${HOST//.*/}"
fi
fi
$@
}
+# Pipe output through less.
+tree() {
+ command tree -C "$@" | less
+}
+
+# Automatically disown.
+xpdf() {
+ command xpdf "$@" &
+ disown %command
+}
-# OS SPECIFIC SETTINGS
-local uname=$(uname)
+# OS SPECIFIC SETTINGS
-if [[ $uname == Linux ]]; then
+if [[ $OSTYPE == linux* ]]; then
# Settings when creating Debian packages.
DEBEMAIL=simon@ruderich.org
export DEBEMAIL
DEBFULLNAME='Simon Ruderich'
export DEBFULLNAME
-
-elif [[ $uname == Darwin ]]; then # Mac OS X
- # Store the current clipboard in CLIPBOARD before every command so it can
- # be used in commands.
- os_darwin_preexec() {
- export CLIPBOARD="$(pbpaste)"
- }
- # Add the function as preexec hook.
- add-zsh-hook preexec os_darwin_preexec
-
- # Initialize CLIPBOARD so it's available for completion directly after
- # startup.
- CLIPBOARD=""
- export CLIPBOARD
-
- # Fetch current URL in clipboard with wget.
- alias wnc='wget --no-proxy $CLIPBOARD'
fi
# LOAD ADDITIONAL CONFIGURATION FILES
-source_config ~/.zsh.rc.local
+source_config ~/.zsh/rc.local
# RUN COMMANDS