]> ruderich.org/simon Gitweb - config/dotfiles.git/commitdiff
zsh/rc: Reduce calls to external programs.
authorSimon Ruderich <simon@ruderich.org>
Wed, 13 Oct 2010 21:07:30 +0000 (23:07 +0200)
committerSimon Ruderich <simon@ruderich.org>
Wed, 13 Oct 2010 21:08:22 +0000 (23:08 +0200)
zsh/rc

diff --git a/zsh/rc b/zsh/rc
index da5edc4a98197024afc0b77a4d3df831e75166f1..7f518caa0e266d533406a03bcf7c86696612bd6b 100644 (file)
--- a/zsh/rc
+++ b/zsh/rc
@@ -319,7 +319,7 @@ if [[ $TERM == screen* || $TERM == xterm* || $TERM == rxvt* ]]; then
     # 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
 
@@ -372,10 +372,10 @@ if [[ $TERM == screen* || $TERM == xterm* || $TERM == rxvt* ]]; then
             # 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
 
@@ -583,9 +583,7 @@ tig() {
 
 # OS SPECIFIC SETTINGS
 
-local uname=$(uname)
-
-if [[ $uname == Linux ]]; then
+if [[ $OSTYPE == linux* ]]; then
     # Settings when creating Debian packages.
     DEBEMAIL=simon@ruderich.org
     export DEBEMAIL