summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.am5
-rw-r--r--Makefile.bsd-wrapper5
-rw-r--r--configure.ac14
-rw-r--r--xinitrc.cpp63
4 files changed, 40 insertions, 47 deletions
diff --git a/Makefile.am b/Makefile.am
index 3867bea..2a648bb 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -19,6 +19,7 @@
# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
+XINITDIR = $(datadir)/X11/xinit
SUBDIRS = man
if LAUNCHD
SUBDIRS += launchd
@@ -46,7 +47,9 @@ PROGCPPDEFS = \
-DXTERM=@XTERM@ \
-DXSERVER=@XSERVER@ \
-DXAUTH=@XAUTH@ \
- -DXINIT=@XINIT@
+ -DXINIT=@XINIT@ \
+ -DWM=@WM@ \
+ -DXCONSOLE=@XCONSOLE@
CPP_FILES_FLAGS = \
-DXINITDIR=$(XINITDIR) $(PROGCPPDEFS) -DLIBDIR=$(libdir) \
diff --git a/Makefile.bsd-wrapper b/Makefile.bsd-wrapper
new file mode 100644
index 0000000..30496f3
--- /dev/null
+++ b/Makefile.bsd-wrapper
@@ -0,0 +1,5 @@
+# $OpenBSD: Makefile.bsd-wrapper,v 1.3 2006/11/29 12:16:07 matthieu Exp $
+
+CONFIGURE_ARGS= --datadir=/etc
+
+.include <bsd.xorg.mk>
diff --git a/configure.ac b/configure.ac
index c7fb0ab..680cdc5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -51,6 +51,8 @@ DEFAULT_XSERVER=${bindir}/X
DEFAULT_XAUTH=xauth
DEFAULT_XINIT=xinit
DEFAULT_XINITDIR=${sysconfdir}/X11/xinit
+DEFAULT_WM=fvwm
+DEFAULT_XCONSOLE=xconsole
AC_ARG_WITH(xrdb,
AS_HELP_STRING([--with-xrdb=XRDB], [Path to xrdb]),
@@ -97,6 +99,16 @@ AC_ARG_WITH(xinitdir,
[XINITDIR="$withval"],
[XINITDIR="$DEFAULT_XINITDIR"])
+AC_ARG_WITH(wm,
+ AS_HELP_STRING([--with-wm=WM], [Path to default window manager]),
+ [WM="$withval"],
+ [WM="$DEFAULT_WM"])
+
+AC_ARG_WITH(xconsole,
+ AS_HELP_STRING([--with-xconsole=XCONSOLE], [Path to xconsole]),
+ [XCONSOLE="$withval"],
+ [XCONSOLE="$DEFAULT_XCONSOLE"])
+
AC_ARG_WITH(launchd, AS_HELP_STRING([--with-launchd], [Build with support for Apple's launchd (default: auto)]), [LAUNCHD=$withval], [LAUNCHD=auto])
AC_ARG_WITH(launchagents-dir, AS_HELP_STRING([--with-launchagents-dir=PATH], [Path to launchd's LaunchAgents directory (default: /Library/LaunchAgents)]),
[ launchagentsdir="${withval}" ],
@@ -205,6 +217,8 @@ AC_SUBST(XSERVER)
AC_SUBST(XAUTH)
AC_SUBST(XINIT)
AC_SUBST(XINITDIR)
+AC_SUBST(WM)
+AC_SUBST(XCONSOLE)
AC_CONFIG_FILES([Makefile
man/Makefile
diff --git a/xinitrc.cpp b/xinitrc.cpp
index 049a8e4..e926b19 100644
--- a/xinitrc.cpp
+++ b/xinitrc.cpp
@@ -39,50 +39,17 @@ if [ -f "$usermodmap" ]; then
XMODMAP "$usermodmap"
fi
-XCOMM start some nice programs
-
-#if defined(__SCO__) || defined(__UNIXWARE__)
-if [ -r /etc/default/xdesktops ]; then
- . /etc/default/xdesktops
-fi
-
-if [ -r $HOME/.x11rc ]; then
- . $HOME/.x11rc
-else
- if [ -r /etc/default/X11 ]; then
- . /etc/default/X11
- fi
+XCOMM if we have private ssh key(s), start ssh-agent and add the key(s)
+id1=$HOME/.ssh/identity
+id2=$HOME/.ssh/id_dsa
+id3=$HOME/.ssh/id_rsa
+if [ -x /usr/bin/ssh-agent ] && [ -f $id1 -o -f $id2 -o -f $id3 ];
+then
+ eval `ssh-agent -s`
+ ssh-add < /dev/null
fi
-#if defined(__SCO__)
-if [ -n "$XSESSION" ]; then
- case "$XSESSION" in
- [Yy][Ee][Ss])
- [ -x /usr/bin/X11/scosession ] && exec /usr/bin/X11/scosession
- ;;
- esac
-fi
-
-if [ -n "$XDESKTOP" ]; then
- exec `eval echo $"$XDESKTOP"`
-else
- if [ -x /usr/bin/X11/pmwm -a -x /usr/bin/X11/scoterm ]; then
- /usr/bin/X11/scoterm 2> /dev/null &
- exec /usr/bin/X11/pmwm 2> /dev/null
- fi
-fi
-#elif defined(__UNIXWARE__)
-if [ -n "$XDESKTOP" ]; then
- exec `eval echo $"$XDESKTOP"`
-else
- if [ -x /usr/X/bin/pmwm ]; then
- exec /usr/X/bin/pmwm 2> /dev/null
- fi
-fi
-#endif
-
-XCOMM This is the fallback case if nothing else is executed above
-#endif /* !defined(__SCO__) && !defined(__UNIXWARE__) */
+XCOMM start some nice programs
if [ -d XINITDIR/xinitrc.d ] ; then
for f in XINITDIR/xinitrc.dXSLASHGLOB.sh ; do
@@ -91,8 +58,12 @@ if [ -d XINITDIR/xinitrc.d ] ; then
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
+XCONSOLE -iconic &
+XTERM -geometry 80x24 &
+WM || XTERM
+
+if [ "$SSH_AGENT_PID" ]; then
+ ssh-add -D < /dev/null
+ eval `ssh-agent -s -k`
+fi