From: Simon Ruderich Date: Thu, 12 Sep 2013 00:55:07 +0000 (+0200) Subject: zsh/rc: Display errors from ~/.xinitrc.errors on startup. X-Git-Url: https://ruderich.org/simon/gitweb/?p=config%2Fdotfiles.git;a=commitdiff_plain;h=202cacb4e429c5c65ae95fe15e23a0e0da606971 zsh/rc: Display errors from ~/.xinitrc.errors on startup. See ~/.xinitrc for details. --- diff --git a/zsh/rc b/zsh/rc index fc4b4f3..7429b9b 100644 --- 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() {