]> ruderich.org/simon Gitweb - config/dotfiles.git/commitdiff
xinitrc: Write errors to ~/.xinitrc.errors if xmessage is not installed.
authorSimon Ruderich <simon@ruderich.org>
Tue, 28 May 2013 11:06:41 +0000 (13:06 +0200)
committerSimon Ruderich <simon@ruderich.org>
Tue, 28 May 2013 11:06:41 +0000 (13:06 +0200)
xinitrc

diff --git a/xinitrc b/xinitrc
index d3b62b4cbd48d5d70ef8a54950fb3501818b659e..fc4582de641725f94539543ff680abbdb08df034 100755 (executable)
--- a/xinitrc
+++ b/xinitrc
@@ -38,7 +38,12 @@ installed() {
     type "$1" >/dev/null 2>&1
 }
 error() {
-    xmessage "$@" &
+    if installed xmessage; then
+        xmessage "$@" &
+    else
+        # Log message to a file which is displayed by my Zsh setup on startup.
+        echo "$@" >> "$HOME/.xinitrc.errors"
+    fi
 }
 # Save PID of the most recently started background process. Used to terminate
 # them when logging out to prevent unused background processes. On some