]> ruderich.org/simon Gitweb - config/dotfiles.git/commitdiff
zsh/rc: Display errors from ~/.xinitrc.errors on startup.
authorSimon Ruderich <simon@ruderich.org>
Thu, 12 Sep 2013 00:55:07 +0000 (02:55 +0200)
committerSimon Ruderich <simon@ruderich.org>
Thu, 12 Sep 2013 00:59:11 +0000 (02:59 +0200)
See ~/.xinitrc for details.

zsh/rc

diff --git a/zsh/rc b/zsh/rc
index fc4b4f3bae9d8bd7da569ac6c08e571e7a1c2554..7429b9b6f8e7baf2619c5086617af27ec672ce63 100644 (file)
--- a/zsh/rc
+++ b/zsh/rc
@@ -903,6 +903,17 @@ exec 2>>(while read -r -k -u 0 line; do
     print -n $'\0'
 done &)
 
+# Display possible log messages from ~/.xinitrc (if `xmessage` wasn't
+# installed). No race condition as xinitrc has finished before a shell is
+# executed and only one shell is started on login.
+if [[ -f ~/.xinitrc.errors ]]; then
+    echo "${fg_bold[red]}xinitrc failed!${fg_bold[default]}"
+    echo
+    cat ~/.xinitrc.errors
+    rm ~/.xinitrc.errors
+    echo
+fi
+
 # Run the following programs every 4 hours (and when zsh starts).
 PERIOD=14400
 periodic() {