summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.am4
-rw-r--r--Makefile.bsd-wrapper5
-rw-r--r--configure.ac14
-rw-r--r--startx.cpp3
-rw-r--r--xinitrc.cpp39
5 files changed, 52 insertions, 13 deletions
diff --git a/Makefile.am b/Makefile.am
index 8b09369..4424c00 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -46,7 +46,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 b0a22b7..2b2a8a1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -50,6 +50,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]),
@@ -96,6 +98,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}" ],
@@ -191,6 +203,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/startx.cpp b/startx.cpp
index 125c398..a3c5fd2 100644
--- a/startx.cpp
+++ b/startx.cpp
@@ -270,7 +270,7 @@ if [ x"$enable_xauth" = x1 ] ; then
dummy=0
XCOMM create a file with auth information for the server. ':0' is a dummy.
- xserverauthfile=$HOME/.serverauth.$$
+ xserverauthfile=`mktemp ${HOME}/.serverauth.XXXXXXXXXX`
trap "rm -f '$xserverauthfile'" HUP INT QUIT ILL TRAP KILL BUS TERM
xauth -q -f "$xserverauthfile" << EOF
add :$dummy . $mcookie
@@ -332,4 +332,3 @@ kbd_mode -a
#endif
exit $retval
-
diff --git a/xinitrc.cpp b/xinitrc.cpp
index 14d3cbc..1bcfd96 100644
--- a/xinitrc.cpp
+++ b/xinitrc.cpp
@@ -1,4 +1,5 @@
XCOMM!SHELL_CMD
+XCOMM $OpenBSD: xinitrc.cpp,v 1.12 2014/02/26 14:21:28 matthieu Exp $
userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
@@ -39,17 +40,35 @@ if [ -f "$usermodmap" ]; then
XMODMAP "$usermodmap"
fi
-XCOMM start some nice programs
+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
+id4=$HOME/.ssh/id_ecdsa
+id5=$HOME/.ssh/id_ed25519
+
+if [ -z "$SSH_AGENT_PID" ];
+then
+ if [ -x /usr/bin/ssh-agent ] && [ -f $id1 -o -f $id2 -o -f $id3 -o -f $id4 -o -f $id5 ];
+ then
+ eval `ssh-agent -s`
+ ssh-add < /dev/null
+ fi
+fi
-if [ -d XINITDIR/xinitrc.d ] ; then
- for f in XINITDIR/xinitrc.d/?*.sh ; do
- [ -x "$f" ] && . "$f"
- done
- unset f
+XCOMM if dbus is installed, start its daemon
+if [ -x /usr/local/bin/dbus-launch -a -z "${DBUS_SESSION_BUS_ADDRESS}" ]; then
+ eval `dbus-launch --sh-syntax --exit-with-session`
fi
-TWM &
+XCOMM start some nice programs
+
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