From 51b59e76c26da000de8a3d3f32d440d4213c2964 Mon Sep 17 00:00:00 2001
From: Tomas Chvatal <scarabeus@gentoo.org>
Date: Mon, 1 Nov 2010 16:46:36 +0100
Subject: [PATCH] Gentoo customizations.

Signed-off-by: Tomas Chvatal <scarabeus@gentoo.org>
---
 xinitrc.cpp | 26 ++++++++++++++++++--------
 1 file changed, 18 insertions(+), 8 deletions(-)

diff --git ./xinitrc.cpp ./xinitrc.cpp
index fa1675c..7cff166 100644
--- ./xinitrc.cpp
+++ ./xinitrc.cpp
@@ -9,8 +9,8 @@ xmodmap=XMODMAP
 
 userresources=$HOME/.Xresources
 usermodmap=$HOME/.Xmodmap
-sysresources=$xinitdir/.Xresources
-sysmodmap=$xinitdir/.Xmodmap
+sysresources=$xinitdir/Xresources
+sysmodmap=$xinitdir/Xmodmap
 
 XCOMM merge in defaults and keymaps
 
@@ -40,15 +40,25 @@ fi
 
 XCOMM start some nice programs
 
+if [ -n "`/etc/X11/chooser.sh`" ]; then
+	command="`/etc/X11/chooser.sh`"
+else
+	failsafe="yes"
+fi
+
 if [ -d $xinitdir/xinitrc.d ] ; then
-	for f in "$xinitdir/xinitrc.d"/?*.sh ; do
+	for f in "$xinitdir/xinitrc.d"/?* ; do
 		[ -x "$f" ] && . "$f"
 	done
 	unset f
 fi
 
-$twm &
-$xclock -geometry 50x50-1+1 &
-$xterm -geometry 80x50+494+51 &
-$xterm -geometry 80x20+494-0 &
-exec $xterm -geometry 80x66+0+0 -name login
+if [ -n "$failsafe" ]; then
+	$twm &
+	$xclock -geometry 50x50-1+1 &
+	$xterm -geometry 80x50+494+51 &
+	$xterm -geometry 80x20+494-0 &
+	exec $xterm -geometry 80x66+0+0 -name login
+else
+	exec $command
+fi
-- 
2.45.2

